Commit 03bcf1ad authored by Carlos Alves's avatar Carlos Alves
Browse files

Correct the 'New Tab' button profile list

The first time ProfileManager::instance()->allProfiles() is called, it will open the profile file and load all profiles.
The problem was, addShortcutAction was already connected to profileAdded signal and triggering while loading the profile file.

Solution is move the "load profile" up, before the connections are made.
parent d10576cc
...@@ -50,16 +50,16 @@ ProfileList::ProfileList(bool addShortcuts , QObject* parent) ...@@ -50,16 +50,16 @@ ProfileList::ProfileList(bool addShortcuts , QObject* parent)
connect(_group, &QActionGroup::triggered, this, &ProfileList::triggered); connect(_group, &QActionGroup::triggered, this, &ProfileList::triggered);
for (const auto& profile : ProfileManager::instance()->allProfiles()) {
addShortcutAction(profile);
}
// TODO - Handle re-sorts when user changes profile names // TODO - Handle re-sorts when user changes profile names
ProfileManager* manager = ProfileManager::instance(); ProfileManager* manager = ProfileManager::instance();
connect(manager, &ProfileManager::shortcutChanged, this, &ProfileList::shortcutChanged); connect(manager, &ProfileManager::shortcutChanged, this, &ProfileList::shortcutChanged);
connect(manager, &ProfileManager::profileChanged, this, &ProfileList::profileChanged); connect(manager, &ProfileManager::profileChanged, this, &ProfileList::profileChanged);
connect(manager, &ProfileManager::profileRemoved, this, &ProfileList::removeShortcutAction); connect(manager, &ProfileManager::profileRemoved, this, &ProfileList::removeShortcutAction);
connect(manager, &ProfileManager::profileAdded, this, &ProfileList::addShortcutAction); connect(manager, &ProfileManager::profileAdded, this, &ProfileList::addShortcutAction);
for (const auto& profile : ProfileManager::instance()->allProfiles()) {
addShortcutAction(profile);
}
} }
void ProfileList::updateEmptyAction() void ProfileList::updateEmptyAction()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment