diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2018-01-18 15:30:55 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-01-19 09:39:07 +0200 |
commit | 88658bd9e36710d8dffdf4eea890fec4fa670bde (patch) | |
tree | 6078d01e547192e9e3926cd34a760833481e2e43 /core/qt-init.cpp | |
parent | af89698d6424f5996c88bde6407dee4df2dc7bc5 (diff) | |
download | subsurface-88658bd9e36710d8dffdf4eea890fec4fa670bde.tar.gz |
Use different preference file for mobile
This is a change mainly for developers working on both mobile and
desktop application. As the current setup is that all preferences
are stored in one file (Subsurface.conf), for both mobile and desktop,
the unwary developer might get confused that the things tested on
mobile-on-desktop are not working on mobile-on-device. As we share
a lot of code between the desktop and the mobile code, also
our fairly extensive set of preferences play a significant role
in the inner workings of our applications.
So, this commit introduces an own preferences file for mobile
(on desktop) resulting in the preferences between the plain
desktop apllication now invisible to the mobile-on-desktop
application and vise versa. Making the mobile-on-desktop a
much more realistic test plaform for mobile development.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'core/qt-init.cpp')
-rw-r--r-- | core/qt-init.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/qt-init.cpp b/core/qt-init.cpp index aae24bda4..f35c6a670 100644 --- a/core/qt-init.cpp +++ b/core/qt-init.cpp @@ -27,10 +27,22 @@ void init_qt_late() // enable user specific settings (based on command line argument) if (settings_suffix) { if (verbose) +#if defined(SUBSURFACE_MOBILE) && ((defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) || (defined(Q_OS_DARWIN) && !defined(Q_OS_IOS))) + qDebug() << "using custom config for" << QString("Subsurface-Mobile-%1").arg(settings_suffix); +#else qDebug() << "using custom config for" << QString("Subsurface-%1").arg(settings_suffix); +#endif +#if defined(SUBSURFACE_MOBILE) && ((defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) || (defined(Q_OS_DARWIN) && !defined(Q_OS_IOS))) + QCoreApplication::setApplicationName(QString("Subsurface-Mobile-%1").arg(settings_suffix)); +#else QCoreApplication::setApplicationName(QString("Subsurface-%1").arg(settings_suffix)); +#endif } else { +#if defined(SUBSURFACE_MOBILE) && ((defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) || (defined(Q_OS_DARWIN) && !defined(Q_OS_IOS))) + QCoreApplication::setApplicationName("Subsurface-Mobile"); +#else QCoreApplication::setApplicationName("Subsurface"); +#endif } // find plugins installed in the application directory (without this SVGs don't work on Windows) SettingsObjectWrapper::instance()->load(); |