File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 4949static const QString OnlineHelpURL (" http://cppcheck.net/manual.html" );
5050static const QString compile_commands_json (" compile_commands.json" );
5151
52+ static QString getDataDir (const QSettings *settings) {
53+ const QString dataDir = settings->value (" DATADIR" , QString ()).toString ();
54+ const QString appPath = QFileInfo (QCoreApplication::applicationFilePath ()).canonicalPath ();
55+ return dataDir.isEmpty () ? appPath : dataDir;
56+ }
57+
5258MainWindow::MainWindow (TranslationHandler* th, QSettings* settings) :
5359 mSettings(settings),
5460 mApplications(new ApplicationList(this )),
@@ -64,7 +70,7 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
6470{
6571 mUI .setupUi (this );
6672 mThread = new ThreadHandler (this );
67- mThread ->setDataDir (mSettings -> value ( " DATADIR " , QString ()). toString ( ));
73+ mThread ->setDataDir (getDataDir (settings ));
6874 mUI .mResults ->initialize (mSettings , mApplications , mThread );
6975
7076 // Filter timer to delay filtering results slightly while typing
You can’t perform that action at this time.
0 commit comments