1 diff -Nurb b/compile.sh n/compile.sh
2 --- b/compile.sh 2004-07-24 19:34:54.000000000 +0200
3 +++ n/compile.sh 2004-11-09 18:08:04.683558608 +0100
5 moc newkeydialogimpl.h > newkeydialogimpl.moc.cpp
6 moc newdialog.h > newdialog.moc.cpp
8 -cc -I . -I $QTDIR/include -L $QTDIR/lib/ -L /lib -l $QTLIB -lregistry -o regedit main.cpp mainwindowimpl.cpp mainwidget.cpp mainwindowimpl.moc.cpp mainwidget.moc.cpp newkeydialogimpl.moc.cpp newkeydialogimpl.cpp newdialog.moc.cpp newdialog.cpp
9 +cc -I . -I $QTDIR/include -L $QTDIR/lib/ -L /lib -l $QTLIB -lregistry -lkdb -o regedit main.cpp mainwindowimpl.cpp mainwidget.cpp mainwindowimpl.moc.cpp mainwidget.moc.cpp newkeydialogimpl.moc.cpp newkeydialogimpl.cpp newdialog.moc.cpp newdialog.cpp
11 diff -Nurb b/src/keyaddcommand.cpp n/src/keyaddcommand.cpp
12 --- b/src/keyaddcommand.cpp 2004-08-11 11:25:19.000000000 +0200
13 +++ n/src/keyaddcommand.cpp 2004-11-09 18:10:04.390360408 +0100
16 switch (newDialog->getType())
18 - case RG_KEY_TYPE_STRING:
19 + case KEY_TYPE_STRING:
20 item->setPixmap(0, mainWidget->stringIcon);
21 if (vlength) keySetString(key, strdup(newDialog->getValue()));
23 - case RG_KEY_TYPE_BINARY:
24 + case KEY_TYPE_BINARY:
25 item->setPixmap(0, mainWidget->binaryIcon);
26 if (vlength) keySetBinary(key, strdup(newDialog->getValue()), vlength);
28 - case RG_KEY_TYPE_LINK:
30 item->setPixmap(0, mainWidget->linkOverlay);
31 if (vlength) keySetLink(key, strdup(newDialog->getValue()));
33 - case RG_KEY_TYPE_DIR:
35 item->setPixmap(0, mainWidget->dirIcon);
40 KeyAddCommand::~KeyAddCommand()
51 bool KeyAddCommand::execute()
54 - if (registrySetKey(key))
58 mainWidget()->showInStatusBar(strerror(errno));
61 //mainWidget()->keyTree->setSelected(item, true);
68 bool KeyAddCommand::unexecute()
72 char *name = new char[keyGetNameSize(key)];
73 keyGetName(key, name, keyGetNameSize(key));
74 - if (registryRemove(name))
75 + if (kdbRemove(name))
77 mainWidget()->showInStatusBar(strerror(errno));
86 diff -Nurb b/src/keyaddcommand.h n/src/keyaddcommand.h
87 --- b/src/keyaddcommand.h 2004-08-11 10:15:06.000000000 +0200
88 +++ n/src/keyaddcommand.h 2004-11-09 18:10:04.390360408 +0100
93 - #include <registry.h>
98 diff -Nurb b/src/keymodifycommand.cpp n/src/keymodifycommand.cpp
99 --- b/src/keymodifycommand.cpp 2004-08-11 11:25:19.000000000 +0200
100 +++ n/src/keymodifycommand.cpp 2004-11-09 18:10:04.391360256 +0100
102 KeyModifyCommand::KeyModifyCommand(MainWidgetImpl *mainWidget, const char *name)
103 : Command(mainWidget, name), item(mainWidget->keyTree->currentItem())
108 ::Key *selected = this->mainWidget()->getSelected();
121 bool KeyModifyCommand::execute()
124 - if (registrySetKey(newKey))
126 + if (kdbSetKey(newKey))
128 mainWidget()->showInStatusBar(strerror(errno));
129 mainWidget()->showKeyValues(true);
132 bool KeyModifyCommand::unexecute()
135 - if (registrySetKey(oldKey))
137 + if (kdbSetKey(oldKey))
139 mainWidget()->showInStatusBar(strerror(errno));
140 mainWidget()->showKeyValues(true);
143 item->setPixmap(0, oldIcon);
144 mainWidget()->changeSelected(item);
150 diff -Nurb b/src/keymodifycommand.h n/src/keymodifycommand.h
151 --- b/src/keymodifycommand.h 2004-08-11 10:15:06.000000000 +0200
152 +++ n/src/keymodifycommand.h 2004-11-09 18:10:04.392360104 +0100
157 - #include <registry.h>
161 @author Gregor Burger
162 diff -Nurb b/src/keyremovecommand.cpp n/src/keyremovecommand.cpp
163 --- b/src/keyremovecommand.cpp 2004-08-11 10:15:06.000000000 +0200
164 +++ n/src/keyremovecommand.cpp 2004-11-09 18:10:04.392360104 +0100
167 bool KeyRemoveCommand::execute( )
172 char *name = new char[keyGetNameSize(key)];
173 keyGetName(key, name, keyGetNameSize(key));
175 - if (registryRemove(name))
176 + if (kdbRemove(name))
178 mainWidget()->showInStatusBar(strerror(errno));
182 item->setVisible(false);
188 bool KeyRemoveCommand::unexecute( )
191 - if (registrySetKey(key))
193 + if (kdbSetKey(key))
195 mainWidget()->showInStatusBar(strerror(errno));
199 item->setVisible(true);
205 diff -Nurb b/src/keyremovecommand.h n/src/keyremovecommand.h
206 --- b/src/keyremovecommand.h 2004-08-11 10:15:06.000000000 +0200
207 +++ n/src/keyremovecommand.h 2004-11-09 18:10:04.393359952 +0100
212 -#include <registry.h>
217 diff -Nurb b/src/mainwidgetimpl.cpp n/src/mainwidgetimpl.cpp
218 --- b/src/mainwidgetimpl.cpp 2004-08-10 14:41:29.000000000 +0200
219 +++ n/src/mainwidgetimpl.cpp 2004-11-09 18:10:04.396359496 +0100
221 : MainWidget(parent, name, fl), ignoreTextChanges(false), selected(0), selectedAccess(0), parent( (MainWindowImpl *) parentWidget())
224 - types[0] = RG_KEY_TYPE_UNDEFINED;
225 - types[1] = RG_KEY_TYPE_LINK;
226 - types[2] = RG_KEY_TYPE_STRING;
227 - types[3] = RG_KEY_TYPE_BINARY;
228 - types[4] = RG_KEY_TYPE_DIR;
229 + types[0] = KEY_TYPE_UNDEFINED;
230 + types[1] = KEY_TYPE_LINK;
231 + types[2] = KEY_TYPE_STRING;
232 + types[3] = KEY_TYPE_BINARY;
233 + types[4] = KEY_TYPE_DIR;
236 ignoreTextChanges = false; //a flag to indicate wheater the program or the user has edited the fields
237 @@ -128,12 +128,12 @@
238 void MainWidgetImpl::updateKeyTree()
247 - registryGetRootKeys(&roots);
248 + kdbGetRootKeys(&roots);
252 @@ -145,23 +145,23 @@
254 switch (keyGetType(mover))
256 - case RG_KEY_TYPE_DIR:
258 item->setPixmap(0, dirIcon);
260 - case RG_KEY_TYPE_LINK:
261 + case KEY_TYPE_LINK:
262 item->setPixmap(0, linkOverlay);
264 - case RG_KEY_TYPE_STRING:
265 + case KEY_TYPE_STRING:
266 item->setPixmap(0, stringIcon);
268 - case RG_KEY_TYPE_BINARY:
269 + case KEY_TYPE_BINARY:
270 item->setPixmap(0, binaryIcon);
285 - registryGetChildKeys(root->key, &keys, RG_O_DIR|RG_O_SORT);
286 + kdbGetChildKeys(root->key, &keys, KDB_O_DIR|KDB_O_SORT);
288 ::Key *mover = keys.start;
290 @@ -192,17 +192,17 @@
294 - case RG_KEY_TYPE_DIR:
296 subItem->setPixmap(0, dirIcon);
299 - case RG_KEY_TYPE_LINK:
300 + case KEY_TYPE_LINK:
301 subItem->setPixmap(0, linkOverlay);
303 - case RG_KEY_TYPE_STRING:
304 + case KEY_TYPE_STRING:
305 subItem->setPixmap(0, stringIcon);
307 - case RG_KEY_TYPE_BINARY:
308 + case KEY_TYPE_BINARY:
309 subItem->setPixmap(0, binaryIcon);
312 @@ -282,29 +282,29 @@
314 switch (keyGetType(selected))
316 - case RG_KEY_TYPE_BINARY:
317 + case KEY_TYPE_BINARY:
318 typeCombo->setCurrentItem(COMBO_POS_BIN);
319 keyValue->setEnabled(true);
320 keyComment->setEnabled(true);
321 typeCombo->setEnabled(true);
323 - case RG_KEY_TYPE_STRING:
324 + case KEY_TYPE_STRING:
325 typeCombo->setCurrentItem(COMBO_POS_STR);
326 keyValue->setEnabled(true);
327 keyComment->setEnabled(true);
328 typeCombo->setEnabled(true);
330 - case RG_KEY_TYPE_DIR:
332 typeCombo->insertItem("Directory");
333 typeCombo->setCurrentItem(COMBO_POS_DIR);
334 typeCombo->setEnabled(false);
335 keyValue->setEnabled(false);
336 keyComment->setEnabled(false);
338 - case RG_KEY_TYPE_LINK:
339 + case KEY_TYPE_LINK:
340 typeCombo->setCurrentItem(COMBO_POS_LNK);
342 - case RG_KEY_TYPE_UNDEFINED:
343 + case KEY_TYPE_UNDEFINED:
344 typeCombo->setCurrentItem(COMBO_POS_UND);
345 keyValue->setEnabled(false);
346 keyName->setEnabled(false);
347 @@ -321,17 +321,17 @@
348 int size = keyGetDataSize(selected);
349 switch (keyGetType(selected))
351 - case RG_KEY_TYPE_BINARY:
352 + case KEY_TYPE_BINARY:
353 keyGetBinary(selected, buffer, size);
355 - case RG_KEY_TYPE_STRING:
356 + case KEY_TYPE_STRING:
357 keyGetString(selected, buffer, size);
359 - case RG_KEY_TYPE_DIR:
362 - case RG_KEY_TYPE_LINK:
363 + case KEY_TYPE_LINK:
365 - case RG_KEY_TYPE_UNDEFINED:
366 + case KEY_TYPE_UNDEFINED:
372 void MainWidgetImpl::changeSelected(QListViewItem *item)
381 keySetName(selected, strdup(getKeyNameFromItem(item)));
383 - if (registryGetKey(selected))
384 + if (kdbGetKey(selected))
386 showInStatusBar(strerror(errno));
390 selectedAccess = keyGetAccess(selected);
397 @@ -604,17 +604,17 @@
399 void MainWidgetImpl::copyValueToClipboard()
403 char *name = strdup(getKeyNameFromItem(keyTree->currentItem()));
406 keySetName(&key, name);
408 - registryGetKey(&key);
411 buf = new char[keyGetDataSize(&key)];
413 - if (keyGetType(&key) == RG_KEY_TYPE_STRING)
414 + if (keyGetType(&key) == KEY_TYPE_STRING)
415 keyGetString(&key, buf, keyGetDataSize(&key));
417 keyGetBinary(&key, (void *)buf, keyGetDataSize(&key));
419 QClipboard *cp = QApplication::clipboard();
420 cp->setText(buf, QClipboard::Clipboard);
426 bool MainWidgetImpl::canUndo()
427 diff -Nurb b/src/mainwidgetimpl.h n/src/mainwidgetimpl.h
428 --- b/src/mainwidgetimpl.h 2004-08-10 14:41:29.000000000 +0200
429 +++ n/src/mainwidgetimpl.h 2004-11-09 18:10:04.397359344 +0100
434 - #include <registry.h>
439 diff -Nurb b/src/mainwindowimpl.cpp n/src/mainwindowimpl.cpp
440 --- b/src/mainwindowimpl.cpp 2004-08-11 11:25:19.000000000 +0200
441 +++ n/src/mainwindowimpl.cpp 2004-11-09 18:10:04.401358736 +0100
446 - #include <registry.h>
453 statusBar()->clear();
461 keySetName(&y, strdup(keyPrefix + "/gui/y"));
462 //keySetName(&splitter, strdup(keyPrefix + "/gui/splitter"));
464 - checkKeyMake(&width, RG_KEY_TYPE_STRING);
465 - checkKeyMake(&height, RG_KEY_TYPE_STRING);
466 - checkKeyMake(&x, RG_KEY_TYPE_STRING);
467 - checkKeyMake(&y, RG_KEY_TYPE_STRING);
468 - //checkKeyMake(&splitter, RG_KEY_TYPE_STRING);
469 + checkKeyMake(&width, KEY_TYPE_STRING);
470 + checkKeyMake(&height, KEY_TYPE_STRING);
471 + checkKeyMake(&x, KEY_TYPE_STRING);
472 + checkKeyMake(&y, KEY_TYPE_STRING);
473 + //checkKeyMake(&splitter, KEY_TYPE_STRING);
475 int vwidth = this->width();
476 int vheight = this->height();
477 @@ -136,12 +136,12 @@
478 char *w = new char[keyGetDataSize(&splitter)];
479 splitter->moveSplitter(atoi(keyGetString(&splitter, w, keyGetSize(&splitter),
485 void MainWindowImpl::closeEvent(QCloseEvent *e)
492 @@ -160,31 +160,31 @@
493 keySetName(&x, strdup(guiKeyPrefix + "x"));
494 keySetName(&y, strdup(guiKeyPrefix + "y"));
496 - registryGetKey(&width);
498 keySetString(&width, strdup(QString().setNum(this->width())));
499 keySetComment(&width, "This is where regedit stores the width of the window");
500 - registrySetKey(&width);
504 - registryGetKey(&height);
505 + kdbGetKey(&height);
506 keySetString(&height, strdup(QString().setNum(this->height())));
507 keySetComment(&height, "This is where regedit stores the height of the window");
508 - registrySetKey(&height);
509 + kdbSetKey(&height);
512 - registryGetKey(&x);
514 keySetString(&x, strdup(QString().setNum(this->x())));
515 keySetComment(&x, "This is where regedit stores the x position of the window");
516 - registrySetKey(&x);
520 - registryGetKey(&y);
522 keySetString(&y, strdup(QString().setNum(this->y())));
523 keySetComment(&y, "This is where regedit stores the y position of the window");
524 - registrySetKey(&y);
531 QMainWindow::closeEvent(e);
533 @@ -211,14 +211,14 @@
535 ::Key *selected = mainWidget->getSelected();
537 - if (keyGetType(selected) == RG_KEY_TYPE_DIR)
538 + if (keyGetType(selected) == KEY_TYPE_DIR)
541 newkey->setEnabled(true);
545 - if (registryGetChildKeys(selected->key, &childs, RG_O_DIR|RG_O_SORT))
546 + if (kdbGetChildKeys(selected->key, &childs, KDB_O_DIR|KDB_O_SORT))
548 statusBar()->message(strerror(errno));
551 QPixmap undoIcon(iconDir + "/undo.png");
552 QPixmap redoIcon(iconDir + "/redo.png");
554 - newkey = new QAction(QString("add new key to registry"), QIconSet(newIcon), QString("new key"), QKeySequence(CTRL + Key_N), this, "newkey action");
555 - del = new QAction(QString("delete key from registry"), QIconSet(delIcon), QString("delet key"), QKeySequence(Key_Delete), this, "delete action");
556 - reload = new QAction(QString("load the registry"), QIconSet(reloadIcon), QString("refresh"), QKeySequence(Key_F5), this, "refresh action");
557 + newkey = new QAction(QString("add new key to kdb"), QIconSet(newIcon), QString("new key"), QKeySequence(CTRL + Key_N), this, "newkey action");
558 + del = new QAction(QString("delete key from kdb"), QIconSet(delIcon), QString("delet key"), QKeySequence(Key_Delete), this, "delete action");
559 + reload = new QAction(QString("load the kdb"), QIconSet(reloadIcon), QString("refresh"), QKeySequence(Key_F5), this, "refresh action");
560 undo = new QAction(QString("undo last modification"), QIconSet(undoIcon), QString("undo"), QKeySequence(CTRL + Key_Z), this, "undo action");
561 redo = new QAction(QString("redo last modification"), QIconSet(redoIcon), QString("redo"), QKeySequence(CTRL + Key_R), this, "redo action");
563 diff -Nurb b/src/newkeydialogimpl.cpp n/src/newkeydialogimpl.cpp
564 --- b/src/newkeydialogimpl.cpp 2004-08-11 11:25:19.000000000 +0200
565 +++ n/src/newkeydialogimpl.cpp 2004-11-09 18:10:04.404358280 +0100
569 NewKeyDialogImpl::NewKeyDialogImpl(QString parentKey, QWidget *parent)
570 -: NewKeyDialog(parent, "new key dialog2", true), type(RG_KEY_TYPE_STRING)
571 +: NewKeyDialog(parent, "new key dialog2", true), type(KEY_TYPE_STRING)
573 keyName->setText(parentKey + RG_KEY_DELIM);
579 - type = RG_KEY_TYPE_BINARY;
580 + type = KEY_TYPE_BINARY;
581 keyComment->setEnabled(true);
582 keyValue->setEnabled(true);
585 - type = RG_KEY_TYPE_STRING;
586 + type = KEY_TYPE_STRING;
587 keyComment->setEnabled(true);
588 keyValue->setEnabled(true);
591 - type = RG_KEY_TYPE_LINK;
592 + type = KEY_TYPE_LINK;
593 keyComment->setEnabled(false);
594 keyValue->setEnabled(true);
597 - type = RG_KEY_TYPE_DIR;
598 + type = KEY_TYPE_DIR;
599 keyComment->setEnabled(false);
600 keyValue->setEnabled(false);
602 diff -Nurb b/src/newkeydialogimpl.h n/src/newkeydialogimpl.h
603 --- b/src/newkeydialogimpl.h 2004-07-24 19:34:54.000000000 +0200
604 +++ n/src/newkeydialogimpl.h 2004-11-09 18:10:04.404358280 +0100
606 #define NEWDIALOGIMPL_H
609 -#include <registry.h>
613 #include "newdialog.h"
614 diff -Nurb b/src/regedit_globals.cpp n/src/regedit_globals.cpp
615 --- b/src/regedit_globals.cpp 2004-08-09 14:08:06.000000000 +0200
616 +++ n/src/regedit_globals.cpp 2004-11-09 18:10:04.408357672 +0100
619 void checkKeyMake(Key *key, u_int8_t type)
621 - int ret = registryGetKey(key);
622 + int ret = kdbGetKey(key);
624 - if (errno == RG_KEY_RET_NOTFOUND)
625 + if (errno == KDB_RET_NOTFOUND)
627 keySetType(key, type);
628 - registrySetKey(key);
641 keySetName(&iconDir, "system/sw/regedit/gui/iconDir");
643 - int ret = registryGetKey(&iconDir);
644 + int ret = kdbGetKey(&iconDir);
651 keySetName(&iconDir, "user/sw/regedit/gui/iconDir");
652 - checkKeyMake(&iconDir, RG_KEY_TYPE_STRING);
653 + checkKeyMake(&iconDir, KEY_TYPE_STRING);
656 //cout << "using system namespace iconDir" << endl;
658 keyGetString(&iconDir, buf, keyGetDataSize(&iconDir));
669 return QString::null;
672 diff -Nurb b/src/regedit_globals.h n/src/regedit_globals.h
673 --- b/src/regedit_globals.h 2004-08-09 14:08:06.000000000 +0200
674 +++ n/src/regedit_globals.h 2004-11-09 18:10:04.408357672 +0100
679 - #include <registry.h>
684 diff -Nurb b/src/src.pro n/src/src.pro
685 --- b/src/src.pro 2004-08-09 14:08:06.000000000 +0200
686 +++ n/src/src.pro 2004-11-09 18:10:04.479346880 +0100
688 # Subdir relative project main directory: ./src
689 # Target is an application: regedit
692 +LIBS += -lregistry -lkdb