MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / GetAppDataDir

Function GetAppDataDir

DSView/pv/config/appconfig.cpp:462–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462QString GetAppDataDir()
463{
464//applicationDirPath not end with '/'
465#ifdef Q_OS_LINUX
466 QDir dir(QCoreApplication::applicationDirPath());
467 if (dir.cd("..") && dir.cd("share") && dir.cd("DSView"))
468 {
469 return dir.absolutePath();
470 }
471 QDir dir1("/usr/local/share/DSView");
472 if (dir1.exists()){
473 return dir1.absolutePath();
474 }
475
476 dsv_err("Data directory is not exists: ../share/DSView");
477 assert(false);
478#else
479
480#ifdef Q_OS_DARWIN
481 QDir dir1(QCoreApplication::applicationDirPath());
482 //"./res" is not exists
483 if (dir1.cd("res") == false){
484 QDir dir(QCoreApplication::applicationDirPath());
485 // ../share/DSView
486 if (dir.cd("..") && dir.cd("share") && dir.cd("DSView"))
487 {
488 return dir.absolutePath();
489 }
490 }
491#endif
492
493 // The bin location
494 return QCoreApplication::applicationDirPath();
495#endif
496}
497
498QString GetFirmwareDir()
499{

Callers 9

InitMethod · 0.85
openDocMethod · 0.85
show_docMethod · 0.85
load_pageMethod · 0.85
AboutMethod · 0.85
GetFirmwareDirFunction · 0.85
GetDecodeScriptDirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected