| 20 | } |
| 21 | |
| 22 | bool PresetManager::loadFromPath(const QString &filename) |
| 23 | { |
| 24 | const QString &src = filename; |
| 25 | const QString dest = AppConfig::instance().getDspConfPath(); |
| 26 | |
| 27 | if (!QFile::exists(src)) |
| 28 | { |
| 29 | // Preset does not exist anymore, rescan presets |
| 30 | this->_presetModel->rescan(); |
| 31 | return false; |
| 32 | } |
| 33 | |
| 34 | if (QFile::exists(dest)) |
| 35 | { |
| 36 | QFile::remove(dest); |
| 37 | } |
| 38 | |
| 39 | QFile::copy(src, dest); |
| 40 | DspConfig::instance().load(); |
| 41 | Log::debug("Loaded " + filename); |
| 42 | return true; |
| 43 | } |
| 44 | |
| 45 | |
| 46 | bool PresetManager::load(const QString &name) |
no test coverage detected