summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Mons <edwin.mons@isode.com>2016-02-05 15:37:04 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-02-15 11:42:11 (GMT)
commit3f6006ce6e97dacf2100fdb8aacb827316353869 (patch)
treef5c02513cf919edc1e0513816ac57a9d10d6059f
parentc3ca881c2f08930c0fd280bc2f41af89986770a8 (diff)
downloadswift-3f6006ce6e97dacf2100fdb8aacb827316353869.zip
swift-3f6006ce6e97dacf2100fdb8aacb827316353869.tar.bz2
Move QApplication instantiation in QtUI/main.cpp down
If there is no X11 display set, bits in libqxcb as used by the plaform integration bits called by QApplication will trigger an abort. Moving this down to just before where the app object is needed allows --help or --version even if there's no DISPLAY, and also improves runtime of these GUI-less operations quite a bit. Test-Information: Test platform Debian 8 x64 with Qt5 Starting swift-im with DISPLAY set works as expected Asking for --version or --help without DISPLAY now works Actually starting the UI still aborts. Change-Id: Id8eeee90598fe2a8e3b26ba042835a0ea928932f
-rw-r--r--Swift/QtUI/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Swift/QtUI/main.cpp b/Swift/QtUI/main.cpp
index e4efce9..2b8716c 100644
--- a/Swift/QtUI/main.cpp
+++ b/Swift/QtUI/main.cpp
@@ -28,8 +28,6 @@
#include "QtSwiftUtil.h"
int main(int argc, char* argv[]) {
- QApplication app(argc, argv);
-
Swift::PlatformApplicationPathProvider applicationPathProvider(SWIFT_APPLICATION_NAME);
Swift::CrashReporter crashReporter(applicationPathProvider.getDataDir() / "crashes");
@@ -84,6 +82,9 @@ int main(int argc, char* argv[]) {
qtTranslator.load(QString(SWIFT_APPLICATION_NAME).toLower() + "_" + QLocale::system().name(), P2QSTRING(Swift::pathToString(someTranslationPath)));
#endif
}
+
+ QApplication app(argc, argv);
+
app.installTranslator(&qtTranslator);
QtTranslator swiftTranslator;
Swift::Translator::setInstance(&swiftTranslator);