aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2015-08-05 10:00:33 +0200
committerDavid Faure <faure@kde.org>2015-08-05 10:00:33 +0200
commit27e145e797a265de93cc1238d6e6ee5d3f3c1998 (patch)
tree76e8c37ea9e290ef571aa4d153c1563c5f359d12 /src
parente537a69c5f8c86a5c291764fd89b7a0ffe233606 (diff)
downloadkconfig-27e145e797a265de93cc1238d6e6ee5d3f3c1998.tar.gz
kconfig-27e145e797a265de93cc1238d6e6ee5d3f3c1998.tar.bz2
test_kconf_update: use QStandardPaths test mode
to avoid touching the user's real files
Diffstat (limited to 'src')
-rw-r--r--src/kconf_update/kconf_update.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/kconf_update/kconf_update.cpp b/src/kconf_update/kconf_update.cpp
index 7659e7b2..bd346234 100644
--- a/src/kconf_update/kconf_update.cpp
+++ b/src/kconf_update/kconf_update.cpp
@@ -117,6 +117,10 @@ KonfUpdate::KonfUpdate(QCommandLineParser *parser)
m_debug = parser->isSet("debug");
+ if (parser->isSet("testmode")) {
+ QStandardPaths::setTestModeEnabled(true);
+ }
+
m_bUseConfigInfo = false;
if (parser->isSet("check")) {
m_bUseConfigInfo = true;
@@ -948,6 +952,7 @@ int main(int argc, char **argv)
parser.setApplicationDescription(QCoreApplication::translate("main", "KDE Tool for updating user configuration files"));
parser.addHelpOption();
parser.addOption(QCommandLineOption(QStringList() << "debug", QCoreApplication::translate("main", "Keep output results from scripts")));
+ parser.addOption(QCommandLineOption(QStringList() << "testmode", QCoreApplication::translate("main", "For unit tests only: use test directories to stay away from the user's real files")));
parser.addOption(QCommandLineOption(QStringList() << "check", QCoreApplication::translate("main", "Check whether config file itself requires updating"), "update-file"));
//parser.addOption(QCommandLineOption(QStringList() << "+[file]", QCoreApplication::translate("main", "File to read update instructions from")));