Only call loadAllProfiles() in the constructor

wilder
Ahmad Samir 4 years ago committed by Kurt Hindenburg
parent 1b7aa3afd0
commit 03badf5bd9
  1. 2
      src/profile/ProfileManager.cpp
  2. 14
      src/profile/ProfileManager.h

@ -237,7 +237,6 @@ void ProfileManager::sortProfiles()
QList<Profile::Ptr> ProfileManager::allProfiles()
{
loadAllProfiles();
sortProfiles();
return loadedProfiles();
}
@ -350,7 +349,6 @@ void ProfileManager::changeProfile(Profile::Ptr profile, QHash<Profile::Property
// dialog
if (!origPath.isEmpty() && profile->path() != origPath) {
// this is needed to include the old profile too
loadAllProfiles();
const QList<Profile::Ptr> availableProfiles = ProfileManager::instance()->allProfiles();
for (const Profile::Ptr &oldProfile : availableProfiles) {
if (oldProfile->path() == origPath) {

@ -67,13 +67,6 @@ public:
*/
QList<Profile::Ptr> loadedProfiles() const;
/**
* Loads all available profiles. This involves reading each
* profile configuration file from disk and parsing it.
* Therefore it should only be done when necessary.
*/
void loadAllProfiles(const QString &defaultProfileFileName = {});
/**
* Loads a profile from the specified path and registers
* it with the ProfileManager.
@ -197,6 +190,13 @@ private Q_SLOTS:
private:
Q_DISABLE_COPY(ProfileManager)
/**
* Loads all available profiles. This involves reading each
* profile configuration file from disk and parsing it.
* Therefore it should only be done when necessary.
*/
void loadAllProfiles(const QString &defaultProfileFileName = {});
// loads the mappings between shortcut key sequences and
// profile paths
void loadShortcuts();

Loading…
Cancel
Save