summaryrefslogtreecommitdiffstats
path: root/core/qt-init.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-29 06:17:02 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-29 12:14:59 -0700
commit3f6366026798ebd31cd08af0619049aacfd96e2b (patch)
tree62a093f4cb82ca08e1bc4a7c8677f2cb1e64aebe /core/qt-init.cpp
parentf536da0ee32a39806efdbcbf9ed2edcaaa230f26 (diff)
downloadsubsurface-3f6366026798ebd31cd08af0619049aacfd96e2b.tar.gz
Allow switching the user from the command line
This is a feature that many people have asked for. This implementation is somewhat simplistic because we simply use a different name for the program settings - but interestingly enough this appears to be enough to capture a lot of the core functionality that people are looking for in multi-user support. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/qt-init.cpp')
-rw-r--r--core/qt-init.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/qt-init.cpp b/core/qt-init.cpp
index b52dfd970..5dc25f9fc 100644
--- a/core/qt-init.cpp
+++ b/core/qt-init.cpp
@@ -4,6 +4,8 @@
#include <QTextCodec>
#include "helpers.h"
+char *settings_suffix = NULL;
+
void init_qt_late()
{
QApplication *application = qApp;
@@ -19,7 +21,14 @@ void init_qt_late()
QCoreApplication::setOrganizationName("Subsurface");
QCoreApplication::setOrganizationDomain("subsurface.hohndel.org");
- QCoreApplication::setApplicationName("Subsurface");
+ // enable user specific settings (based on command line argument)
+ if (settings_suffix) {
+ if (verbose)
+ qDebug() << "using custom config for" << QString("Subsurface-%1").arg(settings_suffix);
+ QCoreApplication::setApplicationName(QString("Subsurface-%1").arg(settings_suffix));
+ } else {
+ QCoreApplication::setApplicationName("Subsurface");
+ }
// find plugins installed in the application directory (without this SVGs don't work on Windows)
QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath());
QLocale loc;