summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-10-21 22:48:25 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-10-21 22:48:25 -0400
commitb954e6dbcceaba3b50aca624e1bddc6db4830829 (patch)
tree31fa8e2579585c9626d56bc9beb55326cbd40ff2 /src/main.cpp
parent04e7ba8bf082e2b170595eef488834accd9d946e (diff)
Imported Upstream version 2.2
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp37
1 files changed, 12 insertions, 25 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ee669d6..bf8aff7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -39,8 +39,7 @@
using namespace util::filesystem;
-bool showDebugMessages = false;
-BibleTime* bibletime_ptr = 0;
+bool showDebugMessages;
void myMessageOutput( QtMsgType type, const char *msg ) {
//we use this messagehandler to switch debugging off in final releases
@@ -168,46 +167,34 @@ int main(int argc, char* argv[]) {
// This is the QT4 version, will only work if main App is QApplication
// A binary option (on / off)
- if (app.QCoreApplication::arguments().contains("--debug"))
- {
- showDebugMessages = true;
- app.setProperty("--debug", true);
- }
- else
- {
- app.setProperty("--debug", false);
- }
+ showDebugMessages = QCoreApplication::arguments().contains("--debug");
+ app.setProperty("--debug", showDebugMessages);
//Migrate configuration data, if neccessary
util::MigrationUtil::checkMigration();
// setSignalHandler(signalHandler);
- bibletime_ptr = new BibleTime();
+ BibleTime bibleTime;
// a new BibleTime version was installed (maybe a completely new installation)
- if (CBTConfig::get(CBTConfig::bibletimeVersion) != BT_VERSION) {
-
+ if (CBTConfig::get(CBTConfig::bibletimeVersion) != BT_VERSION)
+ {
CBTConfig::set(CBTConfig::bibletimeVersion, BT_VERSION);
- //TODO: unabled temporarily
- //bibletime_ptr->slotSettingsOptions();
- bibletime_ptr->slotSettingsOptions();
+ bibleTime.saveConfigSettings();
}
// restore the workspace and process command line options
//app.setMainWidget(bibletime_ptr); //no longer used in qt4 (QApplication)
- bibletime_ptr->show();
- bibletime_ptr->processCommandline(); //must be done after the bibletime window is visible
+ bibleTime.show();
+ bibleTime.processCommandline(); //must be done after the bibletime window is visible
#ifndef NO_DBUS
- new BibleTimeDBusAdaptor(bibletime_ptr);
+ new BibleTimeDBusAdaptor(&bibleTime);
// connect to D-Bus and register as an object:
- QDBusConnection::sessionBus().registerObject("/BibleTime", bibletime_ptr);
+ QDBusConnection::sessionBus().registerObject("/BibleTime", &bibleTime);
#endif
- const int ret = app.exec();
-
- delete bibletime_ptr;
- return ret;
+ return app.exec();
}