MCPcopy Create free account
hub / github.com/TheAssassin/AppImageLauncher / getAdditionalDirectoriesFromConfig

Function getAdditionalDirectoriesFromConfig

src/shared/shared.cpp:412–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412QDirSet 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
441QDirSet daemonDirectoriesToWatch(const std::shared_ptr<QSettings>& config) {
442 auto watchedDirectories = QDirSet();

Callers 1

daemonDirectoriesToWatchFunction · 0.85

Calls 1

expandTildeFunction · 0.85

Tested by

no test coverage detected