Skip to content

Commit

Permalink
Added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitij98 committed May 29, 2018
1 parent b87b2bb commit bbae2ba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/effects/effectmanifest.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ class EffectManifest final {
return QString("Unknown");
}
}

// Use this when showing the string in the GUI
QString translatedBackendName() {
switch (m_backendType) {
case EffectBackendType::BuiltIn:
Expand Down
3 changes: 2 additions & 1 deletion src/effects/effectsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ EffectsManager::~EffectsManager() {

bool alphabetizeEffectManifests(EffectManifestPointer pManifest1,
EffectManifestPointer pManifest2) {
int dNameComp = QString::localeAwareCompare(pManifest1->displayName(), pManifest2->displayName());
// Sort built-in effects first before external plugins
int bNameComp = static_cast<int>(pManifest1->backendType()) - static_cast<int>(pManifest2->backendType());
int dNameComp = QString::localeAwareCompare(pManifest1->displayName(), pManifest2->displayName());
return (bNameComp ? (bNameComp < 0) : (dNameComp < 0));
}

Expand Down
2 changes: 0 additions & 2 deletions src/effects/effectsmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <QScopedPointer>
#include <QPair>

#include <algorithm>

#include "preferences/usersettings.h"
#include "control/controlpotmeter.h"
#include "control/controlpushbutton.h"
Expand Down
4 changes: 4 additions & 0 deletions src/preferences/dialog/dlgprefeffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ void DlgPrefEffects::slotApply() {
for (EffectProfilePtr profile : m_availableEffectsModel.profiles()) {
EffectManifestPointer pManifest = profile->pManifest;
m_pEffectsManager->setEffectVisibility(pManifest, profile->bIsVisible);

// Effects from different backends can have same Effect IDs.
// Add backend name to group to uniquely identify those effects.
// Use untranslated value to keep the group language independent.
m_pConfig->set(ConfigKey("[Visible " + pManifest->backendName() + " Effects]", pManifest->id()),
ConfigValue(profile->bIsVisible));
}
Expand Down

0 comments on commit bbae2ba

Please sign in to comment.