void-packages/srcpkgs/cppcheck/patches/set_datadir.patch

22 lines
780 B
Diff

--- gui/main.cpp.orig
+++ gui/main.cpp
@@ -57,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());