mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
f536da0ee3
commit
3f63660267
3 changed files with 20 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue