| 410 | } |
| 411 | |
| 412 | QDirSet getAdditionalDirectoriesFromConfig(const std::shared_ptr<QSettings>& config) { |
| 413 | // getConfig might've returned a null pointer, therefore we have to check this before proceeding |
| 414 | if (config == nullptr) |
| 415 | return {}; |
| 416 | |
| 417 | constexpr auto configKey = "appimagelauncherd/additional_directories_to_watch"; |
| 418 | |
| 419 | QDirSet additionalDirs{}; |
| 420 | |
| 421 | const auto configValue = config->value(configKey, "").toString(); |
| 422 | |
| 423 | for (auto dirPath : configValue.split(":")) { |
| 424 | // make sure to have full path |
| 425 | dirPath = expandTilde(dirPath); |
| 426 | |
| 427 | const QDir dir(dirPath); |
| 428 | |
| 429 | if (!dir.exists()) { |
| 430 | std::cerr << "Warning: could not find directory " << dirPath.toStdString() |
| 431 | << ", skipping" << std::endl; |
| 432 | continue; |
| 433 | } |
| 434 | |
| 435 | additionalDirs.insert(dir); |
| 436 | } |
| 437 | |
| 438 | return additionalDirs; |
| 439 | } |
| 440 | |
| 441 | QDirSet daemonDirectoriesToWatch(const std::shared_ptr<QSettings>& config) { |
| 442 | auto watchedDirectories = QDirSet(); |
no test coverage detected