Falkon Develop
Cross-platform Qt-based web browser
profilemanager.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#ifndef PROFILEMANAGER_H
19#define PROFILEMANAGER_H
20
21#include <QString>
22
23#include "qzcommon.h"
24
26{
27public:
28 explicit ProfileManager();
29
30 // Make sure the config dir exists and have correct structure
31 void initConfigDir();
32 // Set current profile name (from profiles.ini) and ensure dir exists with correct structure
33 void initCurrentProfile(const QString &profileName);
34
35 // Return 0 on success, -1 profile already exists, -2 cannot create directory
36 static int createProfile(const QString &profileName);
37 // Return false on error (profile does not exists)
38 static bool removeProfile(const QString &profileName);
39
40 // Name of current profile
41 static QString currentProfile();
42
43 // Name of starting profile
44 static QString startingProfile();
45 static void setStartingProfile(const QString &profileName);
46
47 // Names of available profiles
48 static QStringList availableProfiles();
49
50private:
51 void updateCurrentProfile();
52 void updateProfile(const QString &current, const QString &profile);
53 void copyDataToProfile();
54 void migrateFromQupZilla();
55 void updateDatabase();
56
57 void connectDatabase();
58
59 QString profileVersion;
60};
61
62#endif // PROFILEMANAGER_H
void initCurrentProfile(const QString &profileName)
static QString startingProfile()
static QString currentProfile()
static int createProfile(const QString &profileName)
static QStringList availableProfiles()
static bool removeProfile(const QString &profileName)
static void setStartingProfile(const QString &profileName)