Falkon Develop
Cross-platform Qt-based web browser
datapaths.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 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 DATAPATHS_H
19#define DATAPATHS_H
20
21#include <QStringList>
22
23#include "qzcommon.h"
24
25class QTemporaryDir;
26
28{
29public:
30 enum Path {
31 AppData = 0,
40 LastPath
41 };
42
43 explicit DataPaths();
45
46 // Set absolute path of current profile
47 static void setCurrentProfilePath(const QString &profilePath);
48 // Set Config path to $AppData/data
49 static void setPortableVersion();
50
51 // Returns main path (Themes -> /usr/share/themes)
52 static QString path(Path type);
53 // Returns all paths (Themes -> /usr/share/themes, ~/.config/falkon/themes)
54 static QStringList allPaths(Path type);
55 // Returns full path of existing file
56 static QString locate(Path type, const QString &file);
57 // Convenience function for getting CurrentProfile
58 static QString currentProfilePath();
59
60private:
61 void init();
62 void initCurrentProfile(const QString &profilePath);
63 void initAssetsIn(const QString &path);
64
65 QStringList m_paths[LastPath];
66 QScopedPointer<QTemporaryDir> m_tmpdir;
67};
68
69#endif // DATAPATHS_H
@ Sessions
Definition: datapaths.h:39
@ CurrentProfile
Definition: datapaths.h:36
@ Profiles
Definition: datapaths.h:35
#define FALKON_EXPORT
Definition: qzcommon.h:28