Commit 03badf5b authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

Only call loadAllProfiles() in the constructor

parent 1b7aa3af
......@@ -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();
......
Supports Markdown
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