diff options
author | Be <be@mixxx.org> | 2018-03-28 00:08:33 -0500 |
---|---|---|
committer | Be <be@mixxx.org> | 2018-03-28 00:10:58 -0500 |
commit | 52c9a68427f05b4845e994cb83ed96d1a5005f30 (patch) | |
tree | 429af27773c793f1da4c1967e8f6c3e28df732c0 /src/controllers/controllerpresetinfo.cpp | |
parent | 8140587a3806872196c8a6666d52afe71bacb11c (diff) |
sort controller mappings in user folder first then system folder
This was how it was done in 2.0. It is not self-explanatory and
kinda clunky, but it's better than the current situation where
they are all sorted alphabetically and users get confused why
they see two identically named mappings next to each other.
This behavior was broken by commit effbb06 because it removed the
QMap of mappings indexed by a QString for the file path.
Diffstat (limited to 'src/controllers/controllerpresetinfo.cpp')
-rw-r--r-- | src/controllers/controllerpresetinfo.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/controllers/controllerpresetinfo.cpp b/src/controllers/controllerpresetinfo.cpp index 03e5667edf..3e8c1d581f 100644 --- a/src/controllers/controllerpresetinfo.cpp +++ b/src/controllers/controllerpresetinfo.cpp @@ -29,7 +29,9 @@ PresetInfo::PresetInfo(const QString& preset_path) // info.forums Link to mixxx forum discussion for the preset // info.wiki Link to mixxx wiki for the preset // info.devices.product List of device matches, specific to device type - m_path = QFileInfo(preset_path).absoluteFilePath(); + QFileInfo fileInfo(preset_path); + m_path = fileInfo.absoluteFilePath(); + m_dirPath = fileInfo.dir().absolutePath(); m_name = ""; m_author = ""; m_description = ""; @@ -50,7 +52,11 @@ PresetInfo::PresetInfo(const QString& preset_path) m_valid = true; QDomElement dom_name = info.firstChildElement("name"); - if (!dom_name.isNull()) m_name = dom_name.text(); + if (!dom_name.isNull()) { + m_name = dom_name.text(); + } else { + m_name = fileInfo.baseName(); + } QDomElement dom_author = info.firstChildElement("author"); if (!dom_author.isNull()) m_author = dom_author.text(); |