From 85b55cf023c96f4dbd61ec415a15214f99e281b3 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Sat, 6 Sep 2008 18:54:09 +0200 Subject: [PATCH] cleanups (WiP) --- src/common/main.cpp | 20 ++++---------------- src/qtui/mainwin.cpp | 4 ++-- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/common/main.cpp b/src/common/main.cpp index aa1c75ad..b5e205b8 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -142,22 +142,10 @@ int main(int argc, char **argv) { signal(SIGBUS, handle_crash); signal(SIGSEGV, handle_crash); #endif // #if defined(HAVE_EXECINFO) and not defined(Q_OS_MAC) - + Global::registerMetaTypes(); Global::setupVersion(); -/* -#if defined BUILD_CORE - Global::runMode = Global::CoreOnly; - QCoreApplication app(argc, argv); -#elif defined BUILD_QTUI - Global::runMode = Global::ClientOnly; - QApplication app(argc, argv); -#else - Global::runMode = Global::Monolithic; - QApplication app(argc, argv); -#endif -*/ #if defined BUILD_CORE Global::runMode = Global::CoreOnly; QCoreApplication app(argc, argv); @@ -230,7 +218,7 @@ int main(int argc, char **argv) { QCoreApplication::setApplicationName("Quassel IRC"); QCoreApplication::setOrganizationName("Quassel Project"); - + #ifndef BUILD_QTUI Core::instance(); // create and init the core #endif @@ -252,10 +240,10 @@ int main(int argc, char **argv) { } #endif -#ifndef BUILD_CORE +#ifndef BUILD_CORE app.resumeSessionIfPossible(); #endif - + int exitCode = app.exec(); #ifndef BUILD_QTUI diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 91e8adb7..caecd84a 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -111,7 +111,7 @@ MainWin::MainWin(QWidget *parent) connect(desktopNotifications, SIGNAL(NotificationClosed(uint, uint)), this, SLOT(desktopNotificationClosed(uint, uint))); connect(desktopNotifications, SIGNAL(ActionInvoked(uint, const QString&)), this, SLOT(desktopNotificationInvoked(uint, const QString&))); #endif - QtUiApplication* app = dynamic_cast qApp; + QtUiApplication* app = qobject_cast qApp; connect(app, SIGNAL(saveStateToSession(const QString&)), this, SLOT(saveStateToSession(const QString&))); connect(app, SIGNAL(saveStateToSessionSettings(SessionSettings&)), this, SLOT(saveStateToSessionSettings(SessionSettings&))); } @@ -770,7 +770,7 @@ void MainWin::on_actionDebugNetworkModel_triggered(bool) { void MainWin::saveStateToSession(const QString &sessionId) { return; SessionSettings s(sessionId); - + s.setValue("MainWinSize", size()); s.setValue("MainWinPos", pos()); s.setValue("MainWinState", saveState()); -- 2.20.1