aboutsummaryrefslogtreecommitdiff
path: root/src/app/qmmpstarter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/qmmpstarter.cpp')
-rw-r--r--src/app/qmmpstarter.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/app/qmmpstarter.cpp b/src/app/qmmpstarter.cpp
index cf537b8de..e78796783 100644
--- a/src/app/qmmpstarter.cpp
+++ b/src/app/qmmpstarter.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006-2018 by Ilya Kotov *
+ * Copyright (C) 2006-2019 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -68,6 +68,7 @@ QMMPStarter::QMMPStarter() : QObject()
#ifdef Q_OS_WIN
m_named_mutex = nullptr;
#endif
+ createInitialConfig();
m_option_manager = new BuiltinCommandLineOption(this);
QStringList tmp = qApp->arguments().mid(1);
@@ -284,6 +285,18 @@ void QMMPStarter::startPlayer()
}
}
+void QMMPStarter::createInitialConfig()
+{
+ QString defaultConfig = Qmmp::dataPath() + "/qmmprc.default";
+
+ if(!QFile::exists(Qmmp::configFile()) && QFile::exists(defaultConfig))
+ {
+ qDebug("QMMPStarter: creating initial config");
+ QDir("/").mkpath(Qmmp::configDir());
+ QFile::copy(defaultConfig, Qmmp::configFile());
+ }
+}
+
void QMMPStarter::savePosition()
{
QSettings settings(Qmmp::configFile(), QSettings::IniFormat);