aboutsummaryrefslogtreecommitdiffstats
path: root/community/cppcheck/set_datadir.patch
blob: 23bec8bdaecab376484e2c777b1df698b1e20a5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- cppcheck-1.73-origin/gui/main.cpp
+++ cppcheck-1.73/gui/main.cpp
@@ -62,12 +57,18 @@
     QSettings* settings = new QSettings("Cppcheck", "Cppcheck-GUI", &app);
 
     // Set data dir..
+    if ((settings->value("DATADIR", QString()).toString()).isEmpty())
+        settings->setValue("DATADIR", "/usr/share/cppcheck");
+
     foreach (const QString arg, app.arguments()) {
         if (arg.startsWith("--data-dir=")) {
             settings->setValue("DATADIR", arg.mid(11));
             return 0;
         }
     }
+
+    if ((settings->value(SETTINGS_LANGUAGE, QString()).toString()).isEmpty())
+        settings->setValue(SETTINGS_LANGUAGE, "en");
 
     TranslationHandler* th = new TranslationHandler(&app);
     th->SetLanguage(settings->value(SETTINGS_LANGUAGE, th->SuggestLanguage()).toString());