diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-08-20 09:48:13 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-08-20 09:48:13 (GMT) |
commit | bed742cc44107892be4a246037a6216058a4cc56 (patch) | |
tree | dc78216b425d348838df2e34113531f135c7f831 /Swift | |
parent | aeb359c0c915631e97625f20e8aa648d95459131 (diff) | |
download | swift-contrib-bed742cc44107892be4a246037a6216058a4cc56.zip swift-contrib-bed742cc44107892be4a246037a6216058a4cc56.tar.bz2 |
Don't crash when .app is 'open'ed on a Mac.
Resolves: #534
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/QtUI/QtSwift.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp index 3a56637..ef02096 100644 --- a/Swift/QtUI/QtSwift.cpp +++ b/Swift/QtUI/QtSwift.cpp @@ -66,7 +66,13 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) { QCoreApplication::setOrganizationDomain(SWIFT_ORGANIZATION_DOMAIN); QCoreApplication::setApplicationVersion(buildVersion); - int numberOfAccounts = options["multi-account"].as<int>(); + int numberOfAccounts = 1; + try { + numberOfAccounts = options["multi-account"].as<int>(); + } catch (...) { + /* This seems to fail on a Mac when the .app is launched directly (the usual path).*/ + numberOfAccounts = 1; + } tabs_ = options.count("no-tabs") && !(splitter_ > 0) ? NULL : new QtChatTabs(); settings_ = new QtSettingsProvider(); |