author | ar <ar> | 2005-01-21 19:56:15 (UTC) |
---|---|---|
committer | ar <ar> | 2005-01-21 19:56:15 (UTC) |
commit | cd51d382be50bc021739395309e23760f1619759 (patch) (side-by-side diff) | |
tree | e76155f772df7faea5fcf38667c6da8c916208db /scripts | |
parent | fdc37fbd908472e28735a8f0b01e3e66a43535e0 (diff) | |
download | opie-cd51d382be50bc021739395309e23760f1619759.zip opie-cd51d382be50bc021739395309e23760f1619759.tar.gz opie-cd51d382be50bc021739395309e23760f1619759.tar.bz2 |
- make opie compilable against qte 2.3.10 snapshot
check QT_VERSION against 0x030000 instead of 300
-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 @@ -8,38 +8,38 @@ #include <qtoolbar.h> #include <qvbox.h> #include <qsplitter.h> #include <qlistview.h> #include <qtextview.h> #include <qlineedit.h> #include <qmenubar.h> #include <qmessagebox.h> #include <qaction.h> #include <qheader.h> #include <qfiledialog.h> #include <qregexp.h> -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 #include <qsettings.h> #endif #include <stdlib.h> #include "lkc.h" #include "qconf.h" #include "qconf.moc" #include "images.c" static QApplication *configApp; -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 static QSettings *configSettings; #endif /* * update all the children of a menu entry * removes/adds the entries from the parent widget as necessary * * parent: either the menu list widget or a menu entry widget * menu: entry to be updated */ template <class P> void ConfigList::updateMenuList(P* parent, struct menu* menu) @@ -93,25 +93,25 @@ void ConfigList::updateMenuList(P* parent, struct menu* menu) hide: if (item && item->menu == child) { last = parent->firstChild(); if (last == item) last = 0; else while (last->nextSibling() != item) last = last->nextSibling(); delete item; } } } -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 /* * set the new data * TODO check the value */ void ConfigItem::okRename(int col) { Parent::okRename(col); sym_set_string_value(menu->sym, text(dataColIdx).latin1()); } #endif /* @@ -206,25 +206,25 @@ void ConfigItem::updateMenu(void) setText(modColIdx, sym_tristate_within_range(sym, mod) ? "_" : 0); if (expr != yes) setText(yesColIdx, sym_tristate_within_range(sym, yes) ? "_" : 0); setText(dataColIdx, QChar(ch)); break; case S_INT: case S_HEX: case S_STRING: const char* data; data = sym_get_string_value(sym); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 int i = list->mapIdx(dataColIdx); if (i >= 0) setRenameEnabled(i, TRUE); #endif setText(dataColIdx, data); if (type == S_STRING) prompt.sprintf("%s: %s", prompt.latin1(), data); else prompt.sprintf("(%s) %s", data, prompt.latin1()); break; } if (!sym_has_value(sym) && visible) @@ -481,25 +481,25 @@ void ConfigList::changeValue(ConfigItem* item) if (item->menu->list) { if (oldexpr == newexpr) item->setOpen(!item->isOpen()); else if (oldexpr == no) item->setOpen(TRUE); } if (oldexpr != newexpr) parent()->updateList(item); break; case S_INT: case S_HEX: case S_STRING: -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 if (colMap[dataColIdx] >= 0) item->startRename(colMap[dataColIdx]); else #endif parent()->lineEdit->show(item); break; } } void ConfigList::setRootMenu(struct menu *menu) { enum prop_type type; @@ -742,25 +742,25 @@ void ConfigView::updateListAll(void) * Construct the complete config widget */ ConfigMainWindow::ConfigMainWindow(void) { QMenuBar* menu; QSplitter* split1; QSplitter* split2; bool ok; int x, y, width, height; QWidget *d = configApp->desktop(); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 width = configSettings->readNumEntry("/kconfig/qconf/window width", d->width() - 64); height = configSettings->readNumEntry("/kconfig/qconf/window height", d->height() - 64); resize(width, height); x = configSettings->readNumEntry("/kconfig/qconf/window x", 0, &ok); if (ok) y = configSettings->readNumEntry("/kconfig/qconf/window y", 0, &ok); if (ok) move(x, y); #else width = d->width() - 64; height = d->height() - 64; resize(width, height); @@ -1257,25 +1257,25 @@ static void usage(void) int main(int ac, char** av) { ConfigMainWindow* v; const char *name; #ifndef LKC_DIRECT_LINK kconfig_load(); #endif progname = av[0]; configApp = new QApplication(ac, av); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 configSettings = new QSettings; #endif if (ac > 1 && av[1][0] == '-') { switch (av[1][1]) { case 'h': case '?': usage(); } name = av[2]; } else name = av[1]; if (!name) @@ -1284,21 +1284,21 @@ int main(int ac, char** av) conf_parse(name); fixup_rootmenu(&rootmenu); conf_read(NULL); //zconfdump(stdout); v = new ConfigMainWindow(); //zconfdump(stdout); v->show(); configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit())); configApp->exec(); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 configSettings->writeEntry("/kconfig/qconf/window x", v->pos().x()); configSettings->writeEntry("/kconfig/qconf/window y", v->pos().y()); configSettings->writeEntry("/kconfig/qconf/window width", v->size().width()); configSettings->writeEntry("/kconfig/qconf/window height", v->size().height()); delete configSettings; #endif return 0; } 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 @@ -132,25 +132,25 @@ public: ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v) : Parent(parent, after), menu(m), visible(v), goParent(false) { init(); } ConfigItem(QListView *parent, ConfigItem *after, bool v) : Parent(parent, after), menu(0), visible(v), goParent(true) { init(); } ~ConfigItem(void); void init(void); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 void okRename(int col); #endif void updateMenu(void); void testUpdateMenu(bool v); ConfigList* listView() const { return (ConfigList*)Parent::listView(); } ConfigItem* firstChild() const { return (ConfigItem *)Parent::firstChild(); } |