| 460 | } |
| 461 | |
| 462 | QString 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 | |
| 498 | QString GetFirmwareDir() |
| 499 | { |
no outgoing calls
no test coverage detected