1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

ProfileManager: Make appropriate functions static

This commit is contained in:
David Rosca 2015-09-28 20:44:15 +02:00
parent 24de161ad1
commit 5ba8f4dbb6
3 changed files with 7 additions and 10 deletions

View File

@ -32,7 +32,7 @@ ProfileManager::ProfileManager()
{
}
void ProfileManager::initConfigDir() const
void ProfileManager::initConfigDir()
{
QDir dir(DataPaths::path(DataPaths::Config));

View File

@ -28,14 +28,14 @@ public:
explicit ProfileManager();
// Make sure the config dir exists and have correct structure
void initConfigDir() const;
void initConfigDir();
// Set current profile name (from profiles.ini) and ensure dir exists with correct structure
void initCurrentProfile(const QString &profileName);
// Return 0 on success, -1 profile already exists, -2 cannot create directory
int createProfile(const QString &profileName);
static int createProfile(const QString &profileName);
// Return false on error (profile does not exists)
bool removeProfile(const QString &profileName);
static bool removeProfile(const QString &profileName);
// Name of current profile
static QString currentProfile();

View File

@ -810,8 +810,7 @@ void Preferences::createProfile()
return;
}
ProfileManager profileManager;
int res = profileManager.createProfile(name);
int res = ProfileManager::createProfile(name);
if (res == -1) {
QMessageBox::warning(this, tr("Error!"), tr("This profile already exists!"));
@ -836,8 +835,7 @@ void Preferences::deleteProfile()
return;
}
ProfileManager profileManager;
profileManager.removeProfile(name);
ProfileManager::removeProfile(name);
ui->startProfile->removeItem(ui->startProfile->currentIndex());
}
@ -1086,8 +1084,7 @@ void Preferences::saveSettings()
settings.setValue("ProxyExceptions", ui->proxyExceptions->text().split(QLatin1Char(','), QString::SkipEmptyParts));
settings.endGroup();
ProfileManager profileManager;
profileManager.setStartingProfile(ui->startProfile->currentText());
ProfileManager::setStartingProfile(ui->startProfile->currentText());
m_pluginsList->save();
m_themesManager->save();