MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / loadFromPath

Method loadFromPath

src/data/PresetManager.cpp:22–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22bool 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
46bool PresetManager::load(const QString &name)

Callers 1

loadExternalFileMethod · 0.80

Calls 3

getDspConfPathMethod · 0.80
rescanMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected