diff options
author | Christian Rüb <christian.rueb@gmail.com> | 2009-11-16 13:20:53 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2009-11-16 13:20:53 +0200 |
commit | 1545457e04cfd625c1c9439e62a6a3b5fb1cf15c (patch) | |
tree | 27d71a5b5138b45216ec93084e43e21f288d7804 | |
parent | 33417cd75c7d07e24c24edef68fae941365ecc07 (diff) | |
download | external_wpa_supplicant_8_ti-1545457e04cfd625c1c9439e62a6a3b5fb1cf15c.zip external_wpa_supplicant_8_ti-1545457e04cfd625c1c9439e62a6a3b5fb1cf15c.tar.gz external_wpa_supplicant_8_ti-1545457e04cfd625c1c9439e62a6a3b5fb1cf15c.tar.bz2 |
wpa_gui-qt4: Fix build with Session Manager disabled in Qt4
When trying to build wpa_gui (Qt4 version) from openembedded it fails
because Qt4 is compiled without session manager and thus wpa_gui fails
to compile.
I attached a patch, that enables compiling without Session Manager (via
preprocessor) if it is not compiled into Qt4; otherwise, it behaves as
it does right now.
I checked to build on my host (Debian unstable, Session Manager
enabled) and openembedded (Session Manager disabled).
-rw-r--r-- | wpa_supplicant/wpa_gui-qt4/main.cpp | 4 | ||||
-rw-r--r-- | wpa_supplicant/wpa_gui-qt4/wpagui.cpp | 4 | ||||
-rw-r--r-- | wpa_supplicant/wpa_gui-qt4/wpagui.h | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_gui-qt4/main.cpp b/wpa_supplicant/wpa_gui-qt4/main.cpp index 9585e1e..c5e285f 100644 --- a/wpa_supplicant/wpa_gui-qt4/main.cpp +++ b/wpa_supplicant/wpa_gui-qt4/main.cpp @@ -24,7 +24,9 @@ class WpaGuiApp : public QApplication public: WpaGuiApp(int &argc, char **argv); +#ifndef QT_NO_SESSIONMANAGER virtual void saveState(QSessionManager &manager); +#endif WpaGui *w; }; @@ -33,11 +35,13 @@ WpaGuiApp::WpaGuiApp(int &argc, char **argv) : QApplication(argc, argv) { } +#ifndef QT_NO_SESSIONMANAGER void WpaGuiApp::saveState(QSessionManager &manager) { QApplication::saveState(manager); w->saveState(); } +#endif int main(int argc, char *argv[]) diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp index 9f35795..c0c207c 100644 --- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp +++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp @@ -147,6 +147,7 @@ WpaGui::WpaGui(QApplication *_app, QWidget *parent, const char *, Qt::WFlags) parse_argv(); +#ifndef QT_NO_SESSIONMANAGER if (app->isSessionRestored()) { QSettings settings("wpa_supplicant", "wpa_gui"); settings.beginGroup("state"); @@ -155,6 +156,7 @@ WpaGui::WpaGui(QApplication *_app, QWidget *parent, const char *, Qt::WFlags) startInTray = settings.value("in_tray").toBool(); settings.endGroup(); } +#endif if (QSystemTrayIcon::isSystemTrayAvailable()) createTrayIcon(startInTray); @@ -1721,6 +1723,7 @@ void WpaGui::addInterface() } +#ifndef QT_NO_SESSIONMANAGER void WpaGui::saveState() { QSettings settings("wpa_supplicant", "wpa_gui"); @@ -1729,3 +1732,4 @@ void WpaGui::saveState() settings.setValue("in_tray", inTray); settings.endGroup(); } +#endif diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.h b/wpa_supplicant/wpa_gui-qt4/wpagui.h index 4b206c6..a9b8cd3 100644 --- a/wpa_supplicant/wpa_gui-qt4/wpagui.h +++ b/wpa_supplicant/wpa_gui-qt4/wpagui.h @@ -40,7 +40,9 @@ public: virtual void disableNetwork(const QString &sel); virtual int getNetworkDisabled(const QString &sel); void setBssFromScan(const QString &bssid); +#ifndef QT_NO_SESSIONMANAGER void saveState(); +#endif public slots: virtual void parse_argv(); |