-rw-r--r-- | scripts/kconfig/qconf.cc | 16 | ||||
-rw-r--r-- | scripts/kconfig/qconf.h | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 52419ad..0459caf 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc | |||
@@ -12,30 +12,30 @@ | |||
12 | #include <qtextview.h> | 12 | #include <qtextview.h> |
13 | #include <qlineedit.h> | 13 | #include <qlineedit.h> |
14 | #include <qmenubar.h> | 14 | #include <qmenubar.h> |
15 | #include <qmessagebox.h> | 15 | #include <qmessagebox.h> |
16 | #include <qaction.h> | 16 | #include <qaction.h> |
17 | #include <qheader.h> | 17 | #include <qheader.h> |
18 | #include <qfiledialog.h> | 18 | #include <qfiledialog.h> |
19 | #include <qregexp.h> | 19 | #include <qregexp.h> |
20 | #if QT_VERSION >= 300 | 20 | #if QT_VERSION >= 0x030000 |
21 | #include <qsettings.h> | 21 | #include <qsettings.h> |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
25 | 25 | ||
26 | #include "lkc.h" | 26 | #include "lkc.h" |
27 | #include "qconf.h" | 27 | #include "qconf.h" |
28 | 28 | ||
29 | #include "qconf.moc" | 29 | #include "qconf.moc" |
30 | #include "images.c" | 30 | #include "images.c" |
31 | 31 | ||
32 | static QApplication *configApp; | 32 | static QApplication *configApp; |
33 | #if QT_VERSION >= 300 | 33 | #if QT_VERSION >= 0x030000 |
34 | static QSettings *configSettings; | 34 | static QSettings *configSettings; |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * update all the children of a menu entry | 38 | * update all the children of a menu entry |
39 | * removes/adds the entries from the parent widget as necessary | 39 | * removes/adds the entries from the parent widget as necessary |
40 | * | 40 | * |
41 | * parent: either the menu list widget or a menu entry widget | 41 | * parent: either the menu list widget or a menu entry widget |
@@ -97,17 +97,17 @@ void ConfigList::updateMenuList(P* parent, struct menu* menu) | |||
97 | last = 0; | 97 | last = 0; |
98 | else while (last->nextSibling() != item) | 98 | else while (last->nextSibling() != item) |
99 | last = last->nextSibling(); | 99 | last = last->nextSibling(); |
100 | delete item; | 100 | delete item; |
101 | } | 101 | } |
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||
105 | #if QT_VERSION >= 300 | 105 | #if QT_VERSION >= 0x030000 |
106 | /* | 106 | /* |
107 | * set the new data | 107 | * set the new data |
108 | * TODO check the value | 108 | * TODO check the value |
109 | */ | 109 | */ |
110 | void ConfigItem::okRename(int col) | 110 | void ConfigItem::okRename(int col) |
111 | { | 111 | { |
112 | Parent::okRename(col); | 112 | Parent::okRename(col); |
113 | sym_set_string_value(menu->sym, text(dataColIdx).latin1()); | 113 | sym_set_string_value(menu->sym, text(dataColIdx).latin1()); |
@@ -210,17 +210,17 @@ void ConfigItem::updateMenu(void) | |||
210 | setText(dataColIdx, QChar(ch)); | 210 | setText(dataColIdx, QChar(ch)); |
211 | break; | 211 | break; |
212 | case S_INT: | 212 | case S_INT: |
213 | case S_HEX: | 213 | case S_HEX: |
214 | case S_STRING: | 214 | case S_STRING: |
215 | const char* data; | 215 | const char* data; |
216 | 216 | ||
217 | data = sym_get_string_value(sym); | 217 | data = sym_get_string_value(sym); |
218 | #if QT_VERSION >= 300 | 218 | #if QT_VERSION >= 0x030000 |
219 | int i = list->mapIdx(dataColIdx); | 219 | int i = list->mapIdx(dataColIdx); |
220 | if (i >= 0) | 220 | if (i >= 0) |
221 | setRenameEnabled(i, TRUE); | 221 | setRenameEnabled(i, TRUE); |
222 | #endif | 222 | #endif |
223 | setText(dataColIdx, data); | 223 | setText(dataColIdx, data); |
224 | if (type == S_STRING) | 224 | if (type == S_STRING) |
225 | prompt.sprintf("%s: %s", prompt.latin1(), data); | 225 | prompt.sprintf("%s: %s", prompt.latin1(), data); |
226 | else | 226 | else |
@@ -485,17 +485,17 @@ void ConfigList::changeValue(ConfigItem* item) | |||
485 | item->setOpen(TRUE); | 485 | item->setOpen(TRUE); |
486 | } | 486 | } |
487 | if (oldexpr != newexpr) | 487 | if (oldexpr != newexpr) |
488 | parent()->updateList(item); | 488 | parent()->updateList(item); |
489 | break; | 489 | break; |
490 | case S_INT: | 490 | case S_INT: |
491 | case S_HEX: | 491 | case S_HEX: |
492 | case S_STRING: | 492 | case S_STRING: |
493 | #if QT_VERSION >= 300 | 493 | #if QT_VERSION >= 0x030000 |
494 | if (colMap[dataColIdx] >= 0) | 494 | if (colMap[dataColIdx] >= 0) |
495 | item->startRename(colMap[dataColIdx]); | 495 | item->startRename(colMap[dataColIdx]); |
496 | else | 496 | else |
497 | #endif | 497 | #endif |
498 | parent()->lineEdit->show(item); | 498 | parent()->lineEdit->show(item); |
499 | break; | 499 | break; |
500 | } | 500 | } |
501 | } | 501 | } |
@@ -746,17 +746,17 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
746 | QMenuBar* menu; | 746 | QMenuBar* menu; |
747 | QSplitter* split1; | 747 | QSplitter* split1; |
748 | QSplitter* split2; | 748 | QSplitter* split2; |
749 | bool ok; | 749 | bool ok; |
750 | int x, y, width, height; | 750 | int x, y, width, height; |
751 | 751 | ||
752 | QWidget *d = configApp->desktop(); | 752 | QWidget *d = configApp->desktop(); |
753 | 753 | ||
754 | #if QT_VERSION >= 300 | 754 | #if QT_VERSION >= 0x030000 |
755 | width = configSettings->readNumEntry("/kconfig/qconf/window width", d->width() - 64); | 755 | width = configSettings->readNumEntry("/kconfig/qconf/window width", d->width() - 64); |
756 | height = configSettings->readNumEntry("/kconfig/qconf/window height", d->height() - 64); | 756 | height = configSettings->readNumEntry("/kconfig/qconf/window height", d->height() - 64); |
757 | resize(width, height); | 757 | resize(width, height); |
758 | x = configSettings->readNumEntry("/kconfig/qconf/window x", 0, &ok); | 758 | x = configSettings->readNumEntry("/kconfig/qconf/window x", 0, &ok); |
759 | if (ok) | 759 | if (ok) |
760 | y = configSettings->readNumEntry("/kconfig/qconf/window y", 0, &ok); | 760 | y = configSettings->readNumEntry("/kconfig/qconf/window y", 0, &ok); |
761 | if (ok) | 761 | if (ok) |
762 | move(x, y); | 762 | move(x, y); |
@@ -1261,17 +1261,17 @@ int main(int ac, char** av) | |||
1261 | const char *name; | 1261 | const char *name; |
1262 | 1262 | ||
1263 | #ifndef LKC_DIRECT_LINK | 1263 | #ifndef LKC_DIRECT_LINK |
1264 | kconfig_load(); | 1264 | kconfig_load(); |
1265 | #endif | 1265 | #endif |
1266 | 1266 | ||
1267 | progname = av[0]; | 1267 | progname = av[0]; |
1268 | configApp = new QApplication(ac, av); | 1268 | configApp = new QApplication(ac, av); |
1269 | #if QT_VERSION >= 300 | 1269 | #if QT_VERSION >= 0x030000 |
1270 | configSettings = new QSettings; | 1270 | configSettings = new QSettings; |
1271 | #endif | 1271 | #endif |
1272 | if (ac > 1 && av[1][0] == '-') { | 1272 | if (ac > 1 && av[1][0] == '-') { |
1273 | switch (av[1][1]) { | 1273 | switch (av[1][1]) { |
1274 | case 'h': | 1274 | case 'h': |
1275 | case '?': | 1275 | case '?': |
1276 | usage(); | 1276 | usage(); |
1277 | } | 1277 | } |
@@ -1288,17 +1288,17 @@ int main(int ac, char** av) | |||
1288 | 1288 | ||
1289 | v = new ConfigMainWindow(); | 1289 | v = new ConfigMainWindow(); |
1290 | 1290 | ||
1291 | //zconfdump(stdout); | 1291 | //zconfdump(stdout); |
1292 | v->show(); | 1292 | v->show(); |
1293 | configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit())); | 1293 | configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit())); |
1294 | configApp->exec(); | 1294 | configApp->exec(); |
1295 | 1295 | ||
1296 | #if QT_VERSION >= 300 | 1296 | #if QT_VERSION >= 0x030000 |
1297 | configSettings->writeEntry("/kconfig/qconf/window x", v->pos().x()); | 1297 | configSettings->writeEntry("/kconfig/qconf/window x", v->pos().x()); |
1298 | configSettings->writeEntry("/kconfig/qconf/window y", v->pos().y()); | 1298 | configSettings->writeEntry("/kconfig/qconf/window y", v->pos().y()); |
1299 | configSettings->writeEntry("/kconfig/qconf/window width", v->size().width()); | 1299 | configSettings->writeEntry("/kconfig/qconf/window width", v->size().width()); |
1300 | configSettings->writeEntry("/kconfig/qconf/window height", v->size().height()); | 1300 | configSettings->writeEntry("/kconfig/qconf/window height", v->size().height()); |
1301 | delete configSettings; | 1301 | delete configSettings; |
1302 | #endif | 1302 | #endif |
1303 | return 0; | 1303 | return 0; |
1304 | } | 1304 | } |
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index c548884..dee5254 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h | |||
@@ -136,17 +136,17 @@ public: | |||
136 | } | 136 | } |
137 | ConfigItem(QListView *parent, ConfigItem *after, bool v) | 137 | ConfigItem(QListView *parent, ConfigItem *after, bool v) |
138 | : Parent(parent, after), menu(0), visible(v), goParent(true) | 138 | : Parent(parent, after), menu(0), visible(v), goParent(true) |
139 | { | 139 | { |
140 | init(); | 140 | init(); |
141 | } | 141 | } |
142 | ~ConfigItem(void); | 142 | ~ConfigItem(void); |
143 | void init(void); | 143 | void init(void); |
144 | #if QT_VERSION >= 300 | 144 | #if QT_VERSION >= 0x030000 |
145 | void okRename(int col); | 145 | void okRename(int col); |
146 | #endif | 146 | #endif |
147 | void updateMenu(void); | 147 | void updateMenu(void); |
148 | void testUpdateMenu(bool v); | 148 | void testUpdateMenu(bool v); |
149 | ConfigList* listView() const | 149 | ConfigList* listView() const |
150 | { | 150 | { |
151 | return (ConfigList*)Parent::listView(); | 151 | return (ConfigList*)Parent::listView(); |
152 | } | 152 | } |