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.
wilder
Carlos Alves 5 years ago
parent d10576ccf3
commit 03bcf1ad9b
  1. 8
      src/profile/ProfileList.cpp

@ -50,16 +50,16 @@ ProfileList::ProfileList(bool addShortcuts , QObject* parent)
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
ProfileManager* manager = ProfileManager::instance();
connect(manager, &ProfileManager::shortcutChanged, this, &ProfileList::shortcutChanged);
connect(manager, &ProfileManager::profileChanged, this, &ProfileList::profileChanged);
connect(manager, &ProfileManager::profileRemoved, this, &ProfileList::removeShortcutAction);
connect(manager, &ProfileManager::profileAdded, this, &ProfileList::addShortcutAction);
for (const auto& profile : ProfileManager::instance()->allProfiles()) {
addShortcutAction(profile);
}
}
void ProfileList::updateEmptyAction()

Loading…
Cancel
Save