aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@informatik.tu-chemnitz.de>2010-08-31 11:34:37 -0400
committerMichal Marek <mmarek@suse.cz>2010-09-01 10:14:29 -0400
commit133c5f7c10e4552ba41bcf03b9bda6c4e3413804 (patch)
tree06af2cdf01dfa289937537f31c88ce0498e1ac13 /scripts/kconfig
parentc94d3fb01fb6db1899cdf53ea4eb9d38e08a08fe (diff)
kconfig qconf: port to QT4
A straight forward port to QT4 using qt3to4 and compiling against qt3support * Use pkg-config to detect QT4 which is hopefully portable enough * If no QT4, QT3 will by tried instead * Classes renamed using qt3to4 * If build using QT3 renamed to QT3 class names using defines * ConfigInfoView::menu has to be renamed as QT4 moc strips struct from struct menu and creates a name conflict * QT2 support has been dropped * The hidden options inserted in 39a4897c1bb66e8a36043c105d7fd73d8b32b480 are use in native API Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/Makefile76
-rw-r--r--scripts/kconfig/qconf.cc162
-rw-r--r--scripts/kconfig/qconf.h76
3 files changed, 168 insertions, 146 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 06c1c2f80bb7..cef3f75e1c2b 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -235,40 +235,50 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile
235# QT needs some extra effort... 235# QT needs some extra effort...
236$(obj)/.tmp_qtcheck: 236$(obj)/.tmp_qtcheck:
237 @set -e; echo " CHECK qt"; dir=""; pkg=""; \ 237 @set -e; echo " CHECK qt"; dir=""; pkg=""; \
238 pkg-config --exists qt 2> /dev/null && pkg=qt; \ 238 if ! pkg-config --exists QtCore 2> /dev/null; then \
239 pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ 239 echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \
240 if [ -n "$$pkg" ]; then \ 240 pkg-config --exists qt 2> /dev/null && pkg=qt; \
241 cflags="\$$(shell pkg-config $$pkg --cflags)"; \ 241 pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \
242 libs="\$$(shell pkg-config $$pkg --libs)"; \ 242 if [ -n "$$pkg" ]; then \
243 moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ 243 cflags="\$$(shell pkg-config $$pkg --cflags)"; \
244 dir="$$(pkg-config $$pkg --variable=prefix)"; \ 244 libs="\$$(shell pkg-config $$pkg --libs)"; \
245 moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \
246 dir="$$(pkg-config $$pkg --variable=prefix)"; \
247 else \
248 for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \
249 if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \
250 done; \
251 if [ -z "$$dir" ]; then \
252 echo "*"; \
253 echo "* Unable to find any QT installation. Please make sure that"; \
254 echo "* the QT4 or QT3 development package is correctly installed and"; \
255 echo "* either qmake can be found or install pkg-config or set"; \
256 echo "* the QTDIR environment variable to the correct location."; \
257 echo "*"; \
258 false; \
259 fi; \
260 libpath=$$dir/lib; lib=qt; osdir=""; \
261 $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
262 osdir=x$$($(HOSTCXX) -print-multi-os-directory); \
263 test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \
264 test -f $$libpath/libqt-mt.so && lib=qt-mt; \
265 cflags="-I$$dir/include"; \
266 libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \
267 moc="$$dir/bin/moc"; \
268 fi; \
269 if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \
270 echo "*"; \
271 echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \
272 echo "*"; \
273 moc="/usr/bin/moc"; \
274 fi; \
245 else \ 275 else \
246 for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ 276 headerpath="\$$(shell qmake -query QT_INSTALL_HEADERS)"; \
247 if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ 277 libpath="\$$(shell qmake -query QT_INSTALL_LIBS)"; \
248 done; \ 278 binpath="\$$(shell qmake -query QT_INSTALL_BINS)"; \
249 if [ -z "$$dir" ]; then \ 279 cflags="-I$$headerpath -I$$headerpath/QtCore -I$$headerpath/QtGui -I$$headerpath/Qt3Support -DQT3_SUPPORT"; \
250 echo "*"; \ 280 libs="-L$$libpath -Wl,-rpath,$$libpath -lQtCore -lQtGui -lQt3Support"; \
251 echo "* Unable to find the QT3 installation. Please make sure that"; \ 281 moc="$$binpath/moc"; \
252 echo "* the QT3 development package is correctly installed and"; \
253 echo "* either install pkg-config or set the QTDIR environment"; \
254 echo "* variable to the correct location."; \
255 echo "*"; \
256 false; \
257 fi; \
258 libpath=$$dir/lib; lib=qt; osdir=""; \
259 $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
260 osdir=x$$($(HOSTCXX) -print-multi-os-directory); \
261 test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \
262 test -f $$libpath/libqt-mt.so && lib=qt-mt; \
263 cflags="-I$$dir/include"; \
264 libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \
265 moc="$$dir/bin/moc"; \
266 fi; \
267 if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \
268 echo "*"; \
269 echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \
270 echo "*"; \
271 moc="/usr/bin/moc"; \
272 fi; \ 282 fi; \
273 echo "KC_QT_CFLAGS=$$cflags" > $@; \ 283 echo "KC_QT_CFLAGS=$$cflags" > $@; \
274 echo "KC_QT_LIBS=$$libs" >> $@; \ 284 echo "KC_QT_LIBS=$$libs" >> $@; \
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 820df2d1217b..88d3874ca8f4 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -3,25 +3,42 @@
3 * Released under the terms of the GNU GPL v2.0. 3 * Released under the terms of the GNU GPL v2.0.
4 */ 4 */
5 5
6#include <qapplication.h> 6#include <qglobal.h>
7
8#if QT_VERSION < 0x040000
7#include <qmainwindow.h> 9#include <qmainwindow.h>
10#include <qvbox.h>
11#include <qvaluelist.h>
12#include <qtextbrowser.h>
13#include <qaction.h>
14#include <qheader.h>
15#include <qfiledialog.h>
16#include <qdragobject.h>
17#include <qpopupmenu.h>
18#else
19#include <q3mainwindow.h>
20#include <q3vbox.h>
21#include <q3valuelist.h>
22#include <q3textbrowser.h>
23#include <q3action.h>
24#include <q3header.h>
25#include <q3filedialog.h>
26#include <q3dragobject.h>
27#include <q3popupmenu.h>
28#endif
29
30#include <qapplication.h>
8#include <qdesktopwidget.h> 31#include <qdesktopwidget.h>
9#include <qtoolbar.h> 32#include <qtoolbar.h>
10#include <qlayout.h> 33#include <qlayout.h>
11#include <qvbox.h>
12#include <qsplitter.h> 34#include <qsplitter.h>
13#include <qlistview.h>
14#include <qtextbrowser.h>
15#include <qlineedit.h> 35#include <qlineedit.h>
16#include <qlabel.h> 36#include <qlabel.h>
17#include <qpushbutton.h> 37#include <qpushbutton.h>
18#include <qmenubar.h> 38#include <qmenubar.h>
19#include <qmessagebox.h> 39#include <qmessagebox.h>
20#include <qaction.h>
21#include <qheader.h>
22#include <qfiledialog.h>
23#include <qdragobject.h>
24#include <qregexp.h> 40#include <qregexp.h>
41#include <qevent.h>
25 42
26#include <stdlib.h> 43#include <stdlib.h>
27 44
@@ -39,7 +56,7 @@
39static QApplication *configApp; 56static QApplication *configApp;
40static ConfigSettings *configSettings; 57static ConfigSettings *configSettings;
41 58
42QAction *ConfigMainWindow::saveAction; 59Q3Action *ConfigMainWindow::saveAction;
43 60
44static inline QString qgettext(const char* str) 61static inline QString qgettext(const char* str)
45{ 62{
@@ -54,9 +71,9 @@ static inline QString qgettext(const QString& str)
54/** 71/**
55 * Reads a list of integer values from the application settings. 72 * Reads a list of integer values from the application settings.
56 */ 73 */
57QValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok) 74Q3ValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
58{ 75{
59 QValueList<int> result; 76 Q3ValueList<int> result;
60 QStringList entryList = readListEntry(key, ok); 77 QStringList entryList = readListEntry(key, ok);
61 QStringList::Iterator it; 78 QStringList::Iterator it;
62 79
@@ -69,10 +86,10 @@ QValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
69/** 86/**
70 * Writes a list of integer values to the application settings. 87 * Writes a list of integer values to the application settings.
71 */ 88 */
72bool ConfigSettings::writeSizes(const QString& key, const QValueList<int>& value) 89bool ConfigSettings::writeSizes(const QString& key, const Q3ValueList<int>& value)
73{ 90{
74 QStringList stringList; 91 QStringList stringList;
75 QValueList<int>::ConstIterator it; 92 Q3ValueList<int>::ConstIterator it;
76 93
77 for (it = value.begin(); it != value.end(); ++it) 94 for (it = value.begin(); it != value.end(); ++it)
78 stringList.push_back(QString::number(*it)); 95 stringList.push_back(QString::number(*it));
@@ -80,7 +97,6 @@ bool ConfigSettings::writeSizes(const QString& key, const QValueList<int>& value
80} 97}
81 98
82 99
83#if QT_VERSION >= 300
84/* 100/*
85 * set the new data 101 * set the new data
86 * TODO check the value 102 * TODO check the value
@@ -91,7 +107,6 @@ void ConfigItem::okRename(int col)
91 sym_set_string_value(menu->sym, text(dataColIdx).latin1()); 107 sym_set_string_value(menu->sym, text(dataColIdx).latin1());
92 listView()->updateList(this); 108 listView()->updateList(this);
93} 109}
94#endif
95 110
96/* 111/*
97 * update the displayed of a menu entry 112 * update the displayed of a menu entry
@@ -195,11 +210,9 @@ void ConfigItem::updateMenu(void)
195 210
196 data = sym_get_string_value(sym); 211 data = sym_get_string_value(sym);
197 212
198#if QT_VERSION >= 300
199 int i = list->mapIdx(dataColIdx); 213 int i = list->mapIdx(dataColIdx);
200 if (i >= 0) 214 if (i >= 0)
201 setRenameEnabled(i, TRUE); 215 setRenameEnabled(i, TRUE);
202#endif
203 setText(dataColIdx, data); 216 setText(dataColIdx, data);
204 if (type == S_STRING) 217 if (type == S_STRING)
205 prompt = QString("%1: %2").arg(prompt).arg(data); 218 prompt = QString("%1: %2").arg(prompt).arg(data);
@@ -432,7 +445,7 @@ void ConfigList::updateList(ConfigItem* item)
432 if (!rootEntry) { 445 if (!rootEntry) {
433 if (mode != listMode) 446 if (mode != listMode)
434 goto update; 447 goto update;
435 QListViewItemIterator it(this); 448 Q3ListViewItemIterator it(this);
436 ConfigItem* item; 449 ConfigItem* item;
437 450
438 for (; it.current(); ++it) { 451 for (; it.current(); ++it) {
@@ -527,11 +540,9 @@ void ConfigList::changeValue(ConfigItem* item)
527 case S_INT: 540 case S_INT:
528 case S_HEX: 541 case S_HEX:
529 case S_STRING: 542 case S_STRING:
530#if QT_VERSION >= 300
531 if (colMap[dataColIdx] >= 0) 543 if (colMap[dataColIdx] >= 0)
532 item->startRename(colMap[dataColIdx]); 544 item->startRename(colMap[dataColIdx]);
533 else 545 else
534#endif
535 parent()->lineEdit->show(item); 546 parent()->lineEdit->show(item);
536 break; 547 break;
537 } 548 }
@@ -563,7 +574,7 @@ void ConfigList::setParentMenu(void)
563 return; 574 return;
564 setRootMenu(menu_get_parent_menu(rootEntry->parent)); 575 setRootMenu(menu_get_parent_menu(rootEntry->parent));
565 576
566 QListViewItemIterator it(this); 577 Q3ListViewItemIterator it(this);
567 for (; (item = (ConfigItem*)it.current()); it++) { 578 for (; (item = (ConfigItem*)it.current()); it++) {
568 if (item->menu == oldroot) { 579 if (item->menu == oldroot) {
569 setCurrentItem(item); 580 setCurrentItem(item);
@@ -645,7 +656,7 @@ void ConfigList::updateMenuList(P* parent, struct menu* menu)
645 656
646void ConfigList::keyPressEvent(QKeyEvent* ev) 657void ConfigList::keyPressEvent(QKeyEvent* ev)
647{ 658{
648 QListViewItem* i = currentItem(); 659 Q3ListViewItem* i = currentItem();
649 ConfigItem* item; 660 ConfigItem* item;
650 struct menu *menu; 661 struct menu *menu;
651 enum prop_type type; 662 enum prop_type type;
@@ -811,10 +822,10 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
811{ 822{
812 if (e->y() <= header()->geometry().bottom()) { 823 if (e->y() <= header()->geometry().bottom()) {
813 if (!headerPopup) { 824 if (!headerPopup) {
814 QAction *action; 825 Q3Action *action;
815 826
816 headerPopup = new QPopupMenu(this); 827 headerPopup = new Q3PopupMenu(this);
817 action = new QAction(NULL, _("Show Name"), 0, this); 828 action = new Q3Action(NULL, _("Show Name"), 0, this);
818 action->setToggleAction(TRUE); 829 action->setToggleAction(TRUE);
819 connect(action, SIGNAL(toggled(bool)), 830 connect(action, SIGNAL(toggled(bool)),
820 parent(), SLOT(setShowName(bool))); 831 parent(), SLOT(setShowName(bool)));
@@ -822,7 +833,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
822 action, SLOT(setOn(bool))); 833 action, SLOT(setOn(bool)));
823 action->setOn(showName); 834 action->setOn(showName);
824 action->addTo(headerPopup); 835 action->addTo(headerPopup);
825 action = new QAction(NULL, _("Show Range"), 0, this); 836 action = new Q3Action(NULL, _("Show Range"), 0, this);
826 action->setToggleAction(TRUE); 837 action->setToggleAction(TRUE);
827 connect(action, SIGNAL(toggled(bool)), 838 connect(action, SIGNAL(toggled(bool)),
828 parent(), SLOT(setShowRange(bool))); 839 parent(), SLOT(setShowRange(bool)));
@@ -830,7 +841,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
830 action, SLOT(setOn(bool))); 841 action, SLOT(setOn(bool)));
831 action->setOn(showRange); 842 action->setOn(showRange);
832 action->addTo(headerPopup); 843 action->addTo(headerPopup);
833 action = new QAction(NULL, _("Show Data"), 0, this); 844 action = new Q3Action(NULL, _("Show Data"), 0, this);
834 action->setToggleAction(TRUE); 845 action->setToggleAction(TRUE);
835 connect(action, SIGNAL(toggled(bool)), 846 connect(action, SIGNAL(toggled(bool)),
836 parent(), SLOT(setShowData(bool))); 847 parent(), SLOT(setShowData(bool)));
@@ -914,7 +925,7 @@ void ConfigView::setShowData(bool b)
914 925
915void ConfigList::setAllOpen(bool open) 926void ConfigList::setAllOpen(bool open)
916{ 927{
917 QListViewItemIterator it(this); 928 Q3ListViewItemIterator it(this);
918 929
919 for (; it.current(); it++) 930 for (; it.current(); it++)
920 it.current()->setOpen(open); 931 it.current()->setOpen(open);
@@ -937,7 +948,7 @@ void ConfigView::updateListAll(void)
937} 948}
938 949
939ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) 950ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
940 : Parent(parent, name), sym(0), menu(0) 951 : Parent(parent, name), sym(0), _menu(0)
941{ 952{
942 if (name) { 953 if (name) {
943 configSettings->beginGroup(name); 954 configSettings->beginGroup(name);
@@ -960,7 +971,7 @@ void ConfigInfoView::setShowDebug(bool b)
960{ 971{
961 if (_showDebug != b) { 972 if (_showDebug != b) {
962 _showDebug = b; 973 _showDebug = b;
963 if (menu) 974 if (_menu)
964 menuInfo(); 975 menuInfo();
965 else if (sym) 976 else if (sym)
966 symbolInfo(); 977 symbolInfo();
@@ -970,11 +981,11 @@ void ConfigInfoView::setShowDebug(bool b)
970 981
971void ConfigInfoView::setInfo(struct menu *m) 982void ConfigInfoView::setInfo(struct menu *m)
972{ 983{
973 if (menu == m) 984 if (_menu == m)
974 return; 985 return;
975 menu = m; 986 _menu = m;
976 sym = NULL; 987 sym = NULL;
977 if (!menu) 988 if (!_menu)
978 clear(); 989 clear();
979 else 990 else
980 menuInfo(); 991 menuInfo();
@@ -1001,11 +1012,11 @@ void ConfigInfoView::menuInfo(void)
1001 struct symbol* sym; 1012 struct symbol* sym;
1002 QString head, debug, help; 1013 QString head, debug, help;
1003 1014
1004 sym = menu->sym; 1015 sym = _menu->sym;
1005 if (sym) { 1016 if (sym) {
1006 if (menu->prompt) { 1017 if (_menu->prompt) {
1007 head += "<big><b>"; 1018 head += "<big><b>";
1008 head += print_filter(_(menu->prompt->text)); 1019 head += print_filter(_(_menu->prompt->text));
1009 head += "</b></big>"; 1020 head += "</b></big>";
1010 if (sym->name) { 1021 if (sym->name) {
1011 head += " ("; 1022 head += " (";
@@ -1031,23 +1042,23 @@ void ConfigInfoView::menuInfo(void)
1031 debug = debug_info(sym); 1042 debug = debug_info(sym);
1032 1043
1033 struct gstr help_gstr = str_new(); 1044 struct gstr help_gstr = str_new();
1034 menu_get_ext_help(menu, &help_gstr); 1045 menu_get_ext_help(_menu, &help_gstr);
1035 help = print_filter(str_get(&help_gstr)); 1046 help = print_filter(str_get(&help_gstr));
1036 str_free(&help_gstr); 1047 str_free(&help_gstr);
1037 } else if (menu->prompt) { 1048 } else if (_menu->prompt) {
1038 head += "<big><b>"; 1049 head += "<big><b>";
1039 head += print_filter(_(menu->prompt->text)); 1050 head += print_filter(_(_menu->prompt->text));
1040 head += "</b></big><br><br>"; 1051 head += "</b></big><br><br>";
1041 if (showDebug()) { 1052 if (showDebug()) {
1042 if (menu->prompt->visible.expr) { 1053 if (_menu->prompt->visible.expr) {
1043 debug += "&nbsp;&nbsp;dep: "; 1054 debug += "&nbsp;&nbsp;dep: ";
1044 expr_print(menu->prompt->visible.expr, expr_print_help, &debug, E_NONE); 1055 expr_print(_menu->prompt->visible.expr, expr_print_help, &debug, E_NONE);
1045 debug += "<br><br>"; 1056 debug += "<br><br>";
1046 } 1057 }
1047 } 1058 }
1048 } 1059 }
1049 if (showDebug()) 1060 if (showDebug())
1050 debug += QString().sprintf("defined at %s:%d<br><br>", menu->file->name, menu->lineno); 1061 debug += QString().sprintf("defined at %s:%d<br><br>", _menu->file->name, _menu->lineno);
1051 1062
1052 setText(head + debug + help); 1063 setText(head + debug + help);
1053} 1064}
@@ -1150,10 +1161,10 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char
1150 *text += str2; 1161 *text += str2;
1151} 1162}
1152 1163
1153QPopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos) 1164Q3PopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos)
1154{ 1165{
1155 QPopupMenu* popup = Parent::createPopupMenu(pos); 1166 Q3PopupMenu* popup = Parent::createPopupMenu(pos);
1156 QAction* action = new QAction(NULL, _("Show Debug Info"), 0, popup); 1167 Q3Action* action = new Q3Action(NULL, _("Show Debug Info"), 0, popup);
1157 action->setToggleAction(TRUE); 1168 action->setToggleAction(TRUE);
1158 connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); 1169 connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
1159 connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); 1170 connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
@@ -1210,7 +1221,7 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
1210 y = configSettings->readNumEntry("/window y", 0, &ok); 1221 y = configSettings->readNumEntry("/window y", 0, &ok);
1211 if (ok) 1222 if (ok)
1212 move(x, y); 1223 move(x, y);
1213 QValueList<int> sizes = configSettings->readSizes("/split", &ok); 1224 Q3ValueList<int> sizes = configSettings->readSizes("/split", &ok);
1214 if (ok) 1225 if (ok)
1215 split->setSizes(sizes); 1226 split->setSizes(sizes);
1216 configSettings->endGroup(); 1227 configSettings->endGroup();
@@ -1297,42 +1308,42 @@ ConfigMainWindow::ConfigMainWindow(void)
1297 configList->setFocus(); 1308 configList->setFocus();
1298 1309
1299 menu = menuBar(); 1310 menu = menuBar();
1300 toolBar = new QToolBar("Tools", this); 1311 toolBar = new Q3ToolBar("Tools", this);
1301 1312
1302 backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); 1313 backAction = new Q3Action("Back", QPixmap(xpm_back), _("Back"), 0, this);
1303 connect(backAction, SIGNAL(activated()), SLOT(goBack())); 1314 connect(backAction, SIGNAL(activated()), SLOT(goBack()));
1304 backAction->setEnabled(FALSE); 1315 backAction->setEnabled(FALSE);
1305 QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this); 1316 Q3Action *quitAction = new Q3Action("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this);
1306 connect(quitAction, SIGNAL(activated()), SLOT(close())); 1317 connect(quitAction, SIGNAL(activated()), SLOT(close()));
1307 QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this); 1318 Q3Action *loadAction = new Q3Action("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this);
1308 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); 1319 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
1309 saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this); 1320 saveAction = new Q3Action("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this);
1310 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); 1321 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
1311 conf_set_changed_callback(conf_changed); 1322 conf_set_changed_callback(conf_changed);
1312 // Set saveAction's initial state 1323 // Set saveAction's initial state
1313 conf_changed(); 1324 conf_changed();
1314 QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); 1325 Q3Action *saveAsAction = new Q3Action("Save As...", _("Save &As..."), 0, this);
1315 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); 1326 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
1316 QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this); 1327 Q3Action *searchAction = new Q3Action("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this);
1317 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); 1328 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
1318 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); 1329 Q3Action *singleViewAction = new Q3Action("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this);
1319 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); 1330 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
1320 QAction *splitViewAction = new QAction("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this); 1331 Q3Action *splitViewAction = new Q3Action("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this);
1321 connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView())); 1332 connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView()));
1322 QAction *fullViewAction = new QAction("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this); 1333 Q3Action *fullViewAction = new Q3Action("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this);
1323 connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView())); 1334 connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView()));
1324 1335
1325 QAction *showNameAction = new QAction(NULL, _("Show Name"), 0, this); 1336 Q3Action *showNameAction = new Q3Action(NULL, _("Show Name"), 0, this);
1326 showNameAction->setToggleAction(TRUE); 1337 showNameAction->setToggleAction(TRUE);
1327 connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool))); 1338 connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool)));
1328 connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool))); 1339 connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool)));
1329 showNameAction->setOn(configView->showName()); 1340 showNameAction->setOn(configView->showName());
1330 QAction *showRangeAction = new QAction(NULL, _("Show Range"), 0, this); 1341 Q3Action *showRangeAction = new Q3Action(NULL, _("Show Range"), 0, this);
1331 showRangeAction->setToggleAction(TRUE); 1342 showRangeAction->setToggleAction(TRUE);
1332 connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool))); 1343 connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
1333 connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool))); 1344 connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool)));
1334 showRangeAction->setOn(configList->showRange); 1345 showRangeAction->setOn(configList->showRange);
1335 QAction *showDataAction = new QAction(NULL, _("Show Data"), 0, this); 1346 Q3Action *showDataAction = new Q3Action(NULL, _("Show Data"), 0, this);
1336 showDataAction->setToggleAction(TRUE); 1347 showDataAction->setToggleAction(TRUE);
1337 connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool))); 1348 connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
1338 connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool))); 1349 connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool)));
@@ -1345,9 +1356,15 @@ ConfigMainWindow::ConfigMainWindow(void)
1345 connect(optGroup, SIGNAL(selected(QAction *)), menuView, 1356 connect(optGroup, SIGNAL(selected(QAction *)), menuView,
1346 SLOT(setOptionMode(QAction *))); 1357 SLOT(setOptionMode(QAction *)));
1347 1358
1348 configView->showNormalAction = new QAction(NULL, _("Show Normal Options"), 0, optGroup); 1359#if QT_VERSION >= 0x040000
1349 configView->showAllAction = new QAction(NULL, _("Show All Options"), 0, optGroup); 1360 configView->showNormalAction = new QAction(_("Show Normal Options"), optGroup);
1350 configView->showPromptAction = new QAction(NULL, _("Show Prompt Options"), 0, optGroup); 1361 configView->showAllAction = new QAction(_("Show All Options"), optGroup);
1362 configView->showPromptAction = new QAction(_("Show Prompt Options"), optGroup);
1363#else
1364 configView->showNormalAction = new QAction(_("Show Normal Options"), 0, optGroup);
1365 configView->showAllAction = new QAction(_("Show All Options"), 0, optGroup);
1366 configView->showPromptAction = new QAction(_("Show Prompt Options"), 0, optGroup);
1367#endif
1351 configView->showNormalAction->setToggleAction(TRUE); 1368 configView->showNormalAction->setToggleAction(TRUE);
1352 configView->showNormalAction->setOn(configList->optMode == normalOpt); 1369 configView->showNormalAction->setOn(configList->optMode == normalOpt);
1353 configView->showAllAction->setToggleAction(TRUE); 1370 configView->showAllAction->setToggleAction(TRUE);
@@ -1355,15 +1372,15 @@ ConfigMainWindow::ConfigMainWindow(void)
1355 configView->showPromptAction->setToggleAction(TRUE); 1372 configView->showPromptAction->setToggleAction(TRUE);
1356 configView->showPromptAction->setOn(configList->optMode == promptOpt); 1373 configView->showPromptAction->setOn(configList->optMode == promptOpt);
1357 1374
1358 QAction *showDebugAction = new QAction(NULL, _("Show Debug Info"), 0, this); 1375 Q3Action *showDebugAction = new Q3Action(NULL, _("Show Debug Info"), 0, this);
1359 showDebugAction->setToggleAction(TRUE); 1376 showDebugAction->setToggleAction(TRUE);
1360 connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool))); 1377 connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));
1361 connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool))); 1378 connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool)));
1362 showDebugAction->setOn(helpText->showDebug()); 1379 showDebugAction->setOn(helpText->showDebug());
1363 1380
1364 QAction *showIntroAction = new QAction(NULL, _("Introduction"), 0, this); 1381 Q3Action *showIntroAction = new Q3Action(NULL, _("Introduction"), 0, this);
1365 connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro())); 1382 connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro()));
1366 QAction *showAboutAction = new QAction(NULL, _("About"), 0, this); 1383 Q3Action *showAboutAction = new Q3Action(NULL, _("About"), 0, this);
1367 connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout())); 1384 connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout()));
1368 1385
1369 // init tool bar 1386 // init tool bar
@@ -1377,7 +1394,7 @@ ConfigMainWindow::ConfigMainWindow(void)
1377 fullViewAction->addTo(toolBar); 1394 fullViewAction->addTo(toolBar);
1378 1395
1379 // create config menu 1396 // create config menu
1380 QPopupMenu* config = new QPopupMenu(this); 1397 Q3PopupMenu* config = new Q3PopupMenu(this);
1381 menu->insertItem(_("&File"), config); 1398 menu->insertItem(_("&File"), config);
1382 loadAction->addTo(config); 1399 loadAction->addTo(config);
1383 saveAction->addTo(config); 1400 saveAction->addTo(config);
@@ -1386,12 +1403,12 @@ ConfigMainWindow::ConfigMainWindow(void)
1386 quitAction->addTo(config); 1403 quitAction->addTo(config);
1387 1404
1388 // create edit menu 1405 // create edit menu
1389 QPopupMenu* editMenu = new QPopupMenu(this); 1406 Q3PopupMenu* editMenu = new Q3PopupMenu(this);
1390 menu->insertItem(_("&Edit"), editMenu); 1407 menu->insertItem(_("&Edit"), editMenu);
1391 searchAction->addTo(editMenu); 1408 searchAction->addTo(editMenu);
1392 1409
1393 // create options menu 1410 // create options menu
1394 QPopupMenu* optionMenu = new QPopupMenu(this); 1411 Q3PopupMenu* optionMenu = new Q3PopupMenu(this);
1395 menu->insertItem(_("&Option"), optionMenu); 1412 menu->insertItem(_("&Option"), optionMenu);
1396 showNameAction->addTo(optionMenu); 1413 showNameAction->addTo(optionMenu);
1397 showRangeAction->addTo(optionMenu); 1414 showRangeAction->addTo(optionMenu);
@@ -1399,10 +1416,9 @@ ConfigMainWindow::ConfigMainWindow(void)
1399 optionMenu->insertSeparator(); 1416 optionMenu->insertSeparator();
1400 optGroup->addTo(optionMenu); 1417 optGroup->addTo(optionMenu);
1401 optionMenu->insertSeparator(); 1418 optionMenu->insertSeparator();
1402 showDebugAction->addTo(optionMenu);
1403 1419
1404 // create help menu 1420 // create help menu
1405 QPopupMenu* helpMenu = new QPopupMenu(this); 1421 Q3PopupMenu* helpMenu = new Q3PopupMenu(this);
1406 menu->insertSeparator(); 1422 menu->insertSeparator();
1407 menu->insertItem(_("&Help"), helpMenu); 1423 menu->insertItem(_("&Help"), helpMenu);
1408 showIntroAction->addTo(helpMenu); 1424 showIntroAction->addTo(helpMenu);
@@ -1437,7 +1453,7 @@ ConfigMainWindow::ConfigMainWindow(void)
1437 showSplitView(); 1453 showSplitView();
1438 1454
1439 // UI setup done, restore splitter positions 1455 // UI setup done, restore splitter positions
1440 QValueList<int> sizes = configSettings->readSizes("/split1", &ok); 1456 Q3ValueList<int> sizes = configSettings->readSizes("/split1", &ok);
1441 if (ok) 1457 if (ok)
1442 split1->setSizes(sizes); 1458 split1->setSizes(sizes);
1443 1459
@@ -1448,7 +1464,7 @@ ConfigMainWindow::ConfigMainWindow(void)
1448 1464
1449void ConfigMainWindow::loadConfig(void) 1465void ConfigMainWindow::loadConfig(void)
1450{ 1466{
1451 QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this); 1467 QString s = Q3FileDialog::getOpenFileName(conf_get_configname(), NULL, this);
1452 if (s.isNull()) 1468 if (s.isNull())
1453 return; 1469 return;
1454 if (conf_read(QFile::encodeName(s))) 1470 if (conf_read(QFile::encodeName(s)))
@@ -1464,7 +1480,7 @@ void ConfigMainWindow::saveConfig(void)
1464 1480
1465void ConfigMainWindow::saveConfigAs(void) 1481void ConfigMainWindow::saveConfigAs(void)
1466{ 1482{
1467 QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this); 1483 QString s = Q3FileDialog::getSaveFileName(conf_get_configname(), NULL, this);
1468 if (s.isNull()) 1484 if (s.isNull())
1469 return; 1485 return;
1470 if (conf_write(QFile::encodeName(s))) 1486 if (conf_write(QFile::encodeName(s)))
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index 636a74b23bf9..91677d900dbd 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -3,26 +3,25 @@
3 * Released under the terms of the GNU GPL v2.0. 3 * Released under the terms of the GNU GPL v2.0.
4 */ 4 */
5 5
6#if QT_VERSION < 0x040000
6#include <qlistview.h> 7#include <qlistview.h>
7#if QT_VERSION >= 300
8#include <qsettings.h>
9#else 8#else
10class QSettings { 9#include <q3listview.h>
11public: 10#endif
12 void beginGroup(const QString& group) { } 11#include <qsettings.h>
13 void endGroup(void) { } 12
14 bool readBoolEntry(const QString& key, bool def = FALSE, bool* ok = 0) const 13#if QT_VERSION < 0x040000
15 { if (ok) *ok = FALSE; return def; } 14#define Q3ValueList QValueList
16 int readNumEntry(const QString& key, int def = 0, bool* ok = 0) const 15#define Q3PopupMenu QPopupMenu
17 { if (ok) *ok = FALSE; return def; } 16#define Q3ListView QListView
18 QString readEntry(const QString& key, const QString& def = QString::null, bool* ok = 0) const 17#define Q3ListViewItem QListViewItem
19 { if (ok) *ok = FALSE; return def; } 18#define Q3VBox QVBox
20 QStringList readListEntry(const QString& key, bool* ok = 0) const 19#define Q3TextBrowser QTextBrowser
21 { if (ok) *ok = FALSE; return QStringList(); } 20#define Q3MainWindow QMainWindow
22 template <class t> 21#define Q3Action QAction
23 bool writeEntry(const QString& key, t value) 22#define Q3ToolBar QToolBar
24 { return TRUE; } 23#define Q3ListViewItemIterator QListViewItemIterator
25}; 24#define Q3FileDialog QFileDialog
26#endif 25#endif
27 26
28class ConfigView; 27class ConfigView;
@@ -31,11 +30,10 @@ class ConfigItem;
31class ConfigLineEdit; 30class ConfigLineEdit;
32class ConfigMainWindow; 31class ConfigMainWindow;
33 32
34
35class ConfigSettings : public QSettings { 33class ConfigSettings : public QSettings {
36public: 34public:
37 QValueList<int> readSizes(const QString& key, bool *ok); 35 Q3ValueList<int> readSizes(const QString& key, bool *ok);
38 bool writeSizes(const QString& key, const QValueList<int>& value); 36 bool writeSizes(const QString& key, const Q3ValueList<int>& value);
39}; 37};
40 38
41enum colIdx { 39enum colIdx {
@@ -48,9 +46,9 @@ enum optionMode {
48 normalOpt = 0, allOpt, promptOpt 46 normalOpt = 0, allOpt, promptOpt
49}; 47};
50 48
51class ConfigList : public QListView { 49class ConfigList : public Q3ListView {
52 Q_OBJECT 50 Q_OBJECT
53 typedef class QListView Parent; 51 typedef class Q3ListView Parent;
54public: 52public:
55 ConfigList(ConfigView* p, const char *name = 0); 53 ConfigList(ConfigView* p, const char *name = 0);
56 void reinit(void); 54 void reinit(void);
@@ -135,17 +133,17 @@ public:
135 struct menu *rootEntry; 133 struct menu *rootEntry;
136 QColorGroup disabledColorGroup; 134 QColorGroup disabledColorGroup;
137 QColorGroup inactivedColorGroup; 135 QColorGroup inactivedColorGroup;
138 QPopupMenu* headerPopup; 136 Q3PopupMenu* headerPopup;
139 137
140private: 138private:
141 int colMap[colNr]; 139 int colMap[colNr];
142 int colRevMap[colNr]; 140 int colRevMap[colNr];
143}; 141};
144 142
145class ConfigItem : public QListViewItem { 143class ConfigItem : public Q3ListViewItem {
146 typedef class QListViewItem Parent; 144 typedef class Q3ListViewItem Parent;
147public: 145public:
148 ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v) 146 ConfigItem(Q3ListView *parent, ConfigItem *after, struct menu *m, bool v)
149 : Parent(parent, after), menu(m), visible(v), goParent(false) 147 : Parent(parent, after), menu(m), visible(v), goParent(false)
150 { 148 {
151 init(); 149 init();
@@ -155,16 +153,14 @@ public:
155 { 153 {
156 init(); 154 init();
157 } 155 }
158 ConfigItem(QListView *parent, ConfigItem *after, bool v) 156 ConfigItem(Q3ListView *parent, ConfigItem *after, bool v)
159 : Parent(parent, after), menu(0), visible(v), goParent(true) 157 : Parent(parent, after), menu(0), visible(v), goParent(true)
160 { 158 {
161 init(); 159 init();
162 } 160 }
163 ~ConfigItem(void); 161 ~ConfigItem(void);
164 void init(void); 162 void init(void);
165#if QT_VERSION >= 300
166 void okRename(int col); 163 void okRename(int col);
167#endif
168 void updateMenu(void); 164 void updateMenu(void);
169 void testUpdateMenu(bool v); 165 void testUpdateMenu(bool v);
170 ConfigList* listView() const 166 ConfigList* listView() const
@@ -219,9 +215,9 @@ public:
219 ConfigItem *item; 215 ConfigItem *item;
220}; 216};
221 217
222class ConfigView : public QVBox { 218class ConfigView : public Q3VBox {
223 Q_OBJECT 219 Q_OBJECT
224 typedef class QVBox Parent; 220 typedef class Q3VBox Parent;
225public: 221public:
226 ConfigView(QWidget* parent, const char *name = 0); 222 ConfigView(QWidget* parent, const char *name = 0);
227 ~ConfigView(void); 223 ~ConfigView(void);
@@ -252,9 +248,9 @@ public:
252 static QAction *showPromptAction; 248 static QAction *showPromptAction;
253}; 249};
254 250
255class ConfigInfoView : public QTextBrowser { 251class ConfigInfoView : public Q3TextBrowser {
256 Q_OBJECT 252 Q_OBJECT
257 typedef class QTextBrowser Parent; 253 typedef class Q3TextBrowser Parent;
258public: 254public:
259 ConfigInfoView(QWidget* parent, const char *name = 0); 255 ConfigInfoView(QWidget* parent, const char *name = 0);
260 bool showDebug(void) const { return _showDebug; } 256 bool showDebug(void) const { return _showDebug; }
@@ -274,11 +270,11 @@ protected:
274 QString debug_info(struct symbol *sym); 270 QString debug_info(struct symbol *sym);
275 static QString print_filter(const QString &str); 271 static QString print_filter(const QString &str);
276 static void expr_print_help(void *data, struct symbol *sym, const char *str); 272 static void expr_print_help(void *data, struct symbol *sym, const char *str);
277 QPopupMenu* createPopupMenu(const QPoint& pos); 273 Q3PopupMenu* createPopupMenu(const QPoint& pos);
278 void contentsContextMenuEvent(QContextMenuEvent *e); 274 void contentsContextMenuEvent(QContextMenuEvent *e);
279 275
280 struct symbol *sym; 276 struct symbol *sym;
281 struct menu *menu; 277 struct menu *_menu;
282 bool _showDebug; 278 bool _showDebug;
283}; 279};
284 280
@@ -302,10 +298,10 @@ protected:
302 struct symbol **result; 298 struct symbol **result;
303}; 299};
304 300
305class ConfigMainWindow : public QMainWindow { 301class ConfigMainWindow : public Q3MainWindow {
306 Q_OBJECT 302 Q_OBJECT
307 303
308 static QAction *saveAction; 304 static Q3Action *saveAction;
309 static void conf_changed(void); 305 static void conf_changed(void);
310public: 306public:
311 ConfigMainWindow(void); 307 ConfigMainWindow(void);
@@ -334,8 +330,8 @@ protected:
334 ConfigView *configView; 330 ConfigView *configView;
335 ConfigList *configList; 331 ConfigList *configList;
336 ConfigInfoView *helpText; 332 ConfigInfoView *helpText;
337 QToolBar *toolBar; 333 Q3ToolBar *toolBar;
338 QAction *backAction; 334 Q3Action *backAction;
339 QSplitter* split1; 335 QSplitter* split1;
340 QSplitter* split2; 336 QSplitter* split2;
341}; 337};