From patchwork Tue Jul 13 19:26:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 111829 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6DJmp1g001991 for ; Tue, 13 Jul 2010 19:48:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756766Ab0GMTsv (ORCPT ); Tue, 13 Jul 2010 15:48:51 -0400 Received: from jack.hrz.tu-chemnitz.de ([134.109.132.46]:34924 "EHLO jack.hrz.tu-chemnitz.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754636Ab0GMTsu (ORCPT ); Tue, 13 Jul 2010 15:48:50 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 13 Jul 2010 19:48:52 +0000 (UTC) X-Greylist: delayed 1544 seconds by postgrey-1.27 at vger.kernel.org; Tue, 13 Jul 2010 15:48:49 EDT Received: from 77-64-191-116.dynamic.primacom.net ([77.64.191.116] helo=kongar.lan.local) by jack.hrz.tu-chemnitz.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1OYl4B-0004BA-LW; Tue, 13 Jul 2010 21:23:01 +0200 From: Alexander Stein To: linux-kbuild@vger.kernel.org Cc: Michal Marek , Roman Zippel , lkml , Alexander Stein Subject: [PATCH v2] kconfig qconf: port to QT4 Date: Tue, 13 Jul 2010 21:26:56 +0200 Message-Id: <1279049216-22480-1-git-send-email-alexander.stein@informatik.tu-chemnitz.de> X-Mailer: git-send-email 1.7.1.1 In-Reply-To: <4C0D64A2.9020701@suse.cz> References: <4C0D64A2.9020701@suse.cz> X-Spam-Score: -0.9 (/) X-Spam-Report: --- Start der SpamAssassin 3.3.0 Textanalyse (-0.9 Punkte) Fragen an/questions to: Postmaster TU Chemnitz * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.1 TVD_RCVD_IP TVD_RCVD_IP --- Ende der SpamAssassin Textanalyse X-Scan-Signature: 28025a3986145a08341b3fd000502fcf Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 7ea649d..eb3c2f6 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -233,40 +233,52 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile # QT needs some extra effort... $(obj)/.tmp_qtcheck: @set -e; echo " CHECK qt"; dir=""; pkg=""; \ - pkg-config --exists qt 2> /dev/null && pkg=qt; \ - pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ - if [ -n "$$pkg" ]; then \ - cflags="\$$(shell pkg-config $$pkg --cflags)"; \ - libs="\$$(shell pkg-config $$pkg --libs)"; \ - moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ - dir="$$(pkg-config $$pkg --variable=prefix)"; \ + qmake=$(shell which qmake); \ + if [ -z $$qmake ]; then \ + echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \ + pkg-config --exists qt 2> /dev/null && pkg=qt; \ + pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ + if [ -n "$$pkg" ]; then \ + cflags="\$$(shell pkg-config $$pkg --cflags)"; \ + libs="\$$(shell pkg-config $$pkg --libs)"; \ + moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ + dir="$$(pkg-config $$pkg --variable=prefix)"; \ + else \ + for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ + if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ + done; \ + if [ -z "$$dir" ]; then \ + echo "*"; \ + echo "* Unable to find any QT installation. Please make sure that"; \ + echo "* the QT4 or QT3 development package is correctly installed and"; \ + echo "* either qmake can be found or install pkg-config or set"; \ + echo "* the QTDIR environment variable to the correct location."; \ + echo "*"; \ + false; \ + fi; \ + libpath=$$dir/lib; lib=qt; osdir=""; \ + $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ + osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ + test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ + test -f $$libpath/libqt-mt.so && lib=qt-mt; \ + cflags="-I$$dir/include"; \ + libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ + moc="$$dir/bin/moc"; \ + fi; \ + if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ + echo "*"; \ + echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ + echo "*"; \ + moc="/usr/bin/moc"; \ + fi; \ + cflags="$$cflags -DUSE_QT3"; \ else \ - for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ - if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ - done; \ - if [ -z "$$dir" ]; then \ - echo "*"; \ - echo "* Unable to find the QT3 installation. Please make sure that"; \ - echo "* the QT3 development package is correctly installed and"; \ - echo "* either install pkg-config or set the QTDIR environment"; \ - echo "* variable to the correct location."; \ - echo "*"; \ - false; \ - fi; \ - libpath=$$dir/lib; lib=qt; osdir=""; \ - $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ - osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ - test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ - test -f $$libpath/libqt-mt.so && lib=qt-mt; \ - cflags="-I$$dir/include"; \ - libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ - moc="$$dir/bin/moc"; \ - fi; \ - if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ - echo "*"; \ - echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ - echo "*"; \ - moc="/usr/bin/moc"; \ + headerpath="\$$(shell $$qmake -query QT_INSTALL_HEADERS)"; \ + libpath="\$$(shell $$qmake -query QT_INSTALL_LIBS)"; \ + binpath="\$$(shell $$qmake -query QT_INSTALL_BINS)"; \ + cflags="-I$$headerpath -I$$headerpath/QtCore -I$$headerpath/QtGui -I$$headerpath/Qt3Support -DQT3_SUPPORT"; \ + libs="-L$$libpath -Wl,-rpath,$$libpath -lQtCore -lQtGui -lQt3Support"; \ + moc="$$binpath/moc"; \ fi; \ echo "KC_QT_CFLAGS=$$cflags" > $@; \ echo "KC_QT_LIBS=$$libs" >> $@; \ diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 00c5150..d287689 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -3,25 +3,40 @@ * Released under the terms of the GNU GPL v2.0. */ -#include +#ifdef USE_QT3 #include +#include +#include +#include +#include +#include +#include +#include +#include +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#include #include #include #include -#include #include -#include -#include #include #include #include #include #include -#include -#include -#include -#include #include +#include #include @@ -39,7 +54,7 @@ static QApplication *configApp; static ConfigSettings *configSettings; -QAction *ConfigMainWindow::saveAction; +Q3Action *ConfigMainWindow::saveAction; static inline QString qgettext(const char* str) { @@ -54,9 +69,9 @@ static inline QString qgettext(const QString& str) /** * Reads a list of integer values from the application settings. */ -QValueList ConfigSettings::readSizes(const QString& key, bool *ok) +Q3ValueList ConfigSettings::readSizes(const QString& key, bool *ok) { - QValueList result; + Q3ValueList result; QStringList entryList = readListEntry(key, ok); if (ok) { QStringList::Iterator it; @@ -70,10 +85,10 @@ QValueList ConfigSettings::readSizes(const QString& key, bool *ok) /** * Writes a list of integer values to the application settings. */ -bool ConfigSettings::writeSizes(const QString& key, const QValueList& value) +bool ConfigSettings::writeSizes(const QString& key, const Q3ValueList& value) { QStringList stringList; - QValueList::ConstIterator it; + Q3ValueList::ConstIterator it; for (it = value.begin(); it != value.end(); ++it) stringList.push_back(QString::number(*it)); @@ -422,7 +437,7 @@ void ConfigList::updateList(ConfigItem* item) if (!rootEntry) { if (mode != listMode) goto update; - QListViewItemIterator it(this); + Q3ListViewItemIterator it(this); ConfigItem* item; for (; it.current(); ++it) { @@ -553,7 +568,7 @@ void ConfigList::setParentMenu(void) return; setRootMenu(menu_get_parent_menu(rootEntry->parent)); - QListViewItemIterator it(this); + Q3ListViewItemIterator it(this); for (; (item = (ConfigItem*)it.current()); it++) { if (item->menu == oldroot) { setCurrentItem(item); @@ -635,7 +650,7 @@ void ConfigList::updateMenuList(P* parent, struct menu* menu) void ConfigList::keyPressEvent(QKeyEvent* ev) { - QListViewItem* i = currentItem(); + Q3ListViewItem* i = currentItem(); ConfigItem* item; struct menu *menu; enum prop_type type; @@ -801,10 +816,10 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) { if (e->y() <= header()->geometry().bottom()) { if (!headerPopup) { - QAction *action; + Q3Action *action; - headerPopup = new QPopupMenu(this); - action = new QAction(NULL, _("Show Name"), 0, this); + headerPopup = new Q3PopupMenu(this); + action = new Q3Action(NULL, _("Show Name"), 0, this); action->setToggleAction(TRUE); connect(action, SIGNAL(toggled(bool)), parent(), SLOT(setShowName(bool))); @@ -812,7 +827,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) action, SLOT(setOn(bool))); action->setOn(showName); action->addTo(headerPopup); - action = new QAction(NULL, _("Show Range"), 0, this); + action = new Q3Action(NULL, _("Show Range"), 0, this); action->setToggleAction(TRUE); connect(action, SIGNAL(toggled(bool)), parent(), SLOT(setShowRange(bool))); @@ -820,7 +835,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) action, SLOT(setOn(bool))); action->setOn(showRange); action->addTo(headerPopup); - action = new QAction(NULL, _("Show Data"), 0, this); + action = new Q3Action(NULL, _("Show Data"), 0, this); action->setToggleAction(TRUE); connect(action, SIGNAL(toggled(bool)), parent(), SLOT(setShowData(bool))); @@ -898,7 +913,7 @@ void ConfigView::setShowData(bool b) void ConfigList::setAllOpen(bool open) { - QListViewItemIterator it(this); + Q3ListViewItemIterator it(this); for (; it.current(); it++) it.current()->setOpen(open); @@ -921,7 +936,7 @@ void ConfigView::updateListAll(void) } ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) - : Parent(parent, name), sym(0), menu(0) + : Parent(parent, name), sym(0), _menu(0) { if (name) { configSettings->beginGroup(name); @@ -944,7 +959,7 @@ void ConfigInfoView::setShowDebug(bool b) { if (_showDebug != b) { _showDebug = b; - if (menu) + if (_menu) menuInfo(); else if (sym) symbolInfo(); @@ -954,11 +969,11 @@ void ConfigInfoView::setShowDebug(bool b) void ConfigInfoView::setInfo(struct menu *m) { - if (menu == m) + if (_menu == m) return; - menu = m; + _menu = m; sym = NULL; - if (!menu) + if (!_menu) clear(); else menuInfo(); @@ -968,17 +983,17 @@ void ConfigInfoView::setSource(const QString& name) { const char *p = name.latin1(); - menu = NULL; + _menu = NULL; sym = NULL; switch (p[0]) { case 'm': struct menu *m; - if (sscanf(p, "m%p", &m) == 1 && menu != m) { - menu = m; + if (sscanf(p, "m%p", &m) == 1 && _menu != m) { + _menu = m; menuInfo(); - emit menuSelected(menu); + emit menuSelected(_menu); } break; case 's': @@ -1013,11 +1028,11 @@ void ConfigInfoView::menuInfo(void) struct symbol* sym; QString head, debug, help; - sym = menu->sym; + sym = _menu->sym; if (sym) { - if (menu->prompt) { + if (_menu->prompt) { head += ""; - head += print_filter(_(menu->prompt->text)); + head += print_filter(_(_menu->prompt->text)); head += ""; if (sym->name) { head += " ("; @@ -1043,23 +1058,23 @@ void ConfigInfoView::menuInfo(void) debug = debug_info(sym); struct gstr help_gstr = str_new(); - menu_get_ext_help(menu, &help_gstr); + menu_get_ext_help(_menu, &help_gstr); help = print_filter(str_get(&help_gstr)); str_free(&help_gstr); - } else if (menu->prompt) { + } else if (_menu->prompt) { head += ""; - head += print_filter(_(menu->prompt->text)); + head += print_filter(_(_menu->prompt->text)); head += "

"; if (showDebug()) { - if (menu->prompt->visible.expr) { + if (_menu->prompt->visible.expr) { debug += "  dep: "; - expr_print(menu->prompt->visible.expr, expr_print_help, &debug, E_NONE); + expr_print(_menu->prompt->visible.expr, expr_print_help, &debug, E_NONE); debug += "

"; } } } if (showDebug()) - debug += QString().sprintf("defined at %s:%d

", menu->file->name, menu->lineno); + debug += QString().sprintf("defined at %s:%d

", _menu->file->name, _menu->lineno); setText(head + debug + help); } @@ -1162,10 +1177,10 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char *text += str2; } -QPopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos) +Q3PopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos) { - QPopupMenu* popup = Parent::createPopupMenu(pos); - QAction* action = new QAction(NULL, _("Show Debug Info"), 0, popup); + Q3PopupMenu* popup = Parent::createPopupMenu(pos); + Q3Action* action = new Q3Action(NULL, _("Show Debug Info"), 0, popup); action->setToggleAction(TRUE); connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); @@ -1222,7 +1237,7 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam y = configSettings->readNumEntry("/window y", 0, &ok); if (ok) move(x, y); - QValueList sizes = configSettings->readSizes("/split", &ok); + Q3ValueList sizes = configSettings->readSizes("/split", &ok); if (ok) split->setSizes(sizes); configSettings->endGroup(); @@ -1309,60 +1324,60 @@ ConfigMainWindow::ConfigMainWindow(void) configList->setFocus(); menu = menuBar(); - toolBar = new QToolBar("Tools", this); + toolBar = new Q3ToolBar("Tools", this); - backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); + backAction = new Q3Action("Back", QPixmap(xpm_back), _("Back"), 0, this); connect(backAction, SIGNAL(activated()), SLOT(goBack())); backAction->setEnabled(FALSE); - QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this); + Q3Action *quitAction = new Q3Action("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this); connect(quitAction, SIGNAL(activated()), SLOT(close())); - QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this); + Q3Action *loadAction = new Q3Action("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this); connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); - saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this); + saveAction = new Q3Action("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this); connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); conf_set_changed_callback(conf_changed); // Set saveAction's initial state conf_changed(); - QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); + Q3Action *saveAsAction = new Q3Action("Save As...", _("Save &As..."), 0, this); connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); - QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this); + Q3Action *searchAction = new Q3Action("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this); connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); - QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); + Q3Action *singleViewAction = new Q3Action("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); - QAction *splitViewAction = new QAction("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this); + Q3Action *splitViewAction = new Q3Action("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this); connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView())); - QAction *fullViewAction = new QAction("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this); + Q3Action *fullViewAction = new Q3Action("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this); connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView())); - QAction *showNameAction = new QAction(NULL, _("Show Name"), 0, this); + Q3Action *showNameAction = new Q3Action(NULL, _("Show Name"), 0, this); showNameAction->setToggleAction(TRUE); connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool))); connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool))); showNameAction->setOn(configView->showName()); - QAction *showRangeAction = new QAction(NULL, _("Show Range"), 0, this); + Q3Action *showRangeAction = new Q3Action(NULL, _("Show Range"), 0, this); showRangeAction->setToggleAction(TRUE); connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool))); connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool))); showRangeAction->setOn(configList->showRange); - QAction *showDataAction = new QAction(NULL, _("Show Data"), 0, this); + Q3Action *showDataAction = new Q3Action(NULL, _("Show Data"), 0, this); showDataAction->setToggleAction(TRUE); connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool))); connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool))); showDataAction->setOn(configList->showData); - QAction *showAllAction = new QAction(NULL, _("Show All Options"), 0, this); + Q3Action *showAllAction = new Q3Action(NULL, _("Show All Options"), 0, this); showAllAction->setToggleAction(TRUE); connect(showAllAction, SIGNAL(toggled(bool)), configView, SLOT(setShowAll(bool))); connect(showAllAction, SIGNAL(toggled(bool)), menuView, SLOT(setShowAll(bool))); showAllAction->setOn(configList->showAll); - QAction *showDebugAction = new QAction(NULL, _("Show Debug Info"), 0, this); + Q3Action *showDebugAction = new Q3Action(NULL, _("Show Debug Info"), 0, this); showDebugAction->setToggleAction(TRUE); connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool))); connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool))); showDebugAction->setOn(helpText->showDebug()); - QAction *showIntroAction = new QAction(NULL, _("Introduction"), 0, this); + Q3Action *showIntroAction = new Q3Action(NULL, _("Introduction"), 0, this); connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro())); - QAction *showAboutAction = new QAction(NULL, _("About"), 0, this); + Q3Action *showAboutAction = new Q3Action(NULL, _("About"), 0, this); connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout())); // init tool bar @@ -1376,7 +1391,7 @@ ConfigMainWindow::ConfigMainWindow(void) fullViewAction->addTo(toolBar); // create config menu - QPopupMenu* config = new QPopupMenu(this); + Q3PopupMenu* config = new Q3PopupMenu(this); menu->insertItem(_("&File"), config); loadAction->addTo(config); saveAction->addTo(config); @@ -1385,12 +1400,12 @@ ConfigMainWindow::ConfigMainWindow(void) quitAction->addTo(config); // create edit menu - QPopupMenu* editMenu = new QPopupMenu(this); + Q3PopupMenu* editMenu = new Q3PopupMenu(this); menu->insertItem(_("&Edit"), editMenu); searchAction->addTo(editMenu); // create options menu - QPopupMenu* optionMenu = new QPopupMenu(this); + Q3PopupMenu* optionMenu = new Q3PopupMenu(this); menu->insertItem(_("&Option"), optionMenu); showNameAction->addTo(optionMenu); showRangeAction->addTo(optionMenu); @@ -1400,7 +1415,7 @@ ConfigMainWindow::ConfigMainWindow(void) showDebugAction->addTo(optionMenu); // create help menu - QPopupMenu* helpMenu = new QPopupMenu(this); + Q3PopupMenu* helpMenu = new Q3PopupMenu(this); menu->insertSeparator(); menu->insertItem(_("&Help"), helpMenu); showIntroAction->addTo(helpMenu); @@ -1435,7 +1450,7 @@ ConfigMainWindow::ConfigMainWindow(void) showSplitView(); // UI setup done, restore splitter positions - QValueList sizes = configSettings->readSizes("/split1", &ok); + Q3ValueList sizes = configSettings->readSizes("/split1", &ok); if (ok) split1->setSizes(sizes); @@ -1446,7 +1461,7 @@ ConfigMainWindow::ConfigMainWindow(void) void ConfigMainWindow::loadConfig(void) { - QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this); + QString s = Q3FileDialog::getOpenFileName(conf_get_configname(), NULL, this); if (s.isNull()) return; if (conf_read(QFile::encodeName(s))) @@ -1462,7 +1477,7 @@ void ConfigMainWindow::saveConfig(void) void ConfigMainWindow::saveConfigAs(void) { - QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this); + QString s = Q3FileDialog::getSaveFileName(conf_get_configname(), NULL, this); if (s.isNull()) return; if (conf_write(QFile::encodeName(s))) diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index b3b5657..3853ae8 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h @@ -3,26 +3,25 @@ * Released under the terms of the GNU GPL v2.0. */ +#ifdef USE_QT3 #include -#if QT_VERSION >= 300 -#include #else -class QSettings { -public: - void beginGroup(const QString& group) { } - void endGroup(void) { } - bool readBoolEntry(const QString& key, bool def = FALSE, bool* ok = 0) const - { if (ok) *ok = FALSE; return def; } - int readNumEntry(const QString& key, int def = 0, bool* ok = 0) const - { if (ok) *ok = FALSE; return def; } - QString readEntry(const QString& key, const QString& def = QString::null, bool* ok = 0) const - { if (ok) *ok = FALSE; return def; } - QStringList readListEntry(const QString& key, bool* ok = 0) const - { if (ok) *ok = FALSE; return QStringList(); } - template - bool writeEntry(const QString& key, t value) - { return TRUE; } -}; +#include +#endif +#include + +#ifdef USE_QT3 +#define Q3ValueList QValueList +#define Q3PopupMenu QPopupMenu +#define Q3ListView QListView +#define Q3ListViewItem QListViewItem +#define Q3VBox QVBox +#define Q3TextBrowser QTextBrowser +#define Q3MainWindow QMainWindow +#define Q3Action QAction +#define Q3ToolBar QToolBar +#define Q3ListViewItemIterator QListViewItemIterator +#define Q3FileDialog QFileDialog #endif class ConfigView; @@ -31,11 +30,10 @@ class ConfigItem; class ConfigLineEdit; class ConfigMainWindow; - class ConfigSettings : public QSettings { public: - QValueList readSizes(const QString& key, bool *ok); - bool writeSizes(const QString& key, const QValueList& value); + Q3ValueList readSizes(const QString& key, bool *ok); + bool writeSizes(const QString& key, const Q3ValueList& value); }; enum colIdx { @@ -45,9 +43,9 @@ enum listMode { singleMode, menuMode, symbolMode, fullMode, listMode }; -class ConfigList : public QListView { +class ConfigList : public Q3ListView { Q_OBJECT - typedef class QListView Parent; + typedef class Q3ListView Parent; public: ConfigList(ConfigView* p, const char *name = 0); void reinit(void); @@ -129,17 +127,17 @@ public: struct menu *rootEntry; QColorGroup disabledColorGroup; QColorGroup inactivedColorGroup; - QPopupMenu* headerPopup; + Q3PopupMenu* headerPopup; private: int colMap[colNr]; int colRevMap[colNr]; }; -class ConfigItem : public QListViewItem { - typedef class QListViewItem Parent; +class ConfigItem : public Q3ListViewItem { + typedef class Q3ListViewItem Parent; public: - ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v) + ConfigItem(Q3ListView *parent, ConfigItem *after, struct menu *m, bool v) : Parent(parent, after), menu(m), visible(v), goParent(false) { init(); @@ -149,7 +147,7 @@ public: { init(); } - ConfigItem(QListView *parent, ConfigItem *after, bool v) + ConfigItem(Q3ListView *parent, ConfigItem *after, bool v) : Parent(parent, after), menu(0), visible(v), goParent(true) { init(); @@ -213,9 +211,9 @@ public: ConfigItem *item; }; -class ConfigView : public QVBox { +class ConfigView : public Q3VBox { Q_OBJECT - typedef class QVBox Parent; + typedef class Q3VBox Parent; public: ConfigView(QWidget* parent, const char *name = 0); ~ConfigView(void); @@ -244,9 +242,9 @@ public: ConfigView* nextView; }; -class ConfigInfoView : public QTextBrowser { +class ConfigInfoView : public Q3TextBrowser { Q_OBJECT - typedef class QTextBrowser Parent; + typedef class Q3TextBrowser Parent; public: ConfigInfoView(QWidget* parent, const char *name = 0); bool showDebug(void) const { return _showDebug; } @@ -267,11 +265,11 @@ protected: QString debug_info(struct symbol *sym); static QString print_filter(const QString &str); static void expr_print_help(void *data, struct symbol *sym, const char *str); - QPopupMenu* createPopupMenu(const QPoint& pos); + Q3PopupMenu* createPopupMenu(const QPoint& pos); void contentsContextMenuEvent(QContextMenuEvent *e); struct symbol *sym; - struct menu *menu; + struct menu *_menu; bool _showDebug; }; @@ -295,10 +293,10 @@ protected: struct symbol **result; }; -class ConfigMainWindow : public QMainWindow { +class ConfigMainWindow : public Q3MainWindow { Q_OBJECT - static QAction *saveAction; + static Q3Action *saveAction; static void conf_changed(void); public: ConfigMainWindow(void); @@ -327,8 +325,8 @@ protected: ConfigView *configView; ConfigList *configList; ConfigInfoView *helpText; - QToolBar *toolBar; - QAction *backAction; + Q3ToolBar *toolBar; + Q3Action *backAction; QSplitter* split1; QSplitter* split2; };