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
25
class
QTemporaryDir;
26
27
class
FALKON_EXPORT
DataPaths
28
{
29
public
:
30
enum
Path
{
31
AppData = 0,
32
Themes
,
33
Plugins
,
34
Config
,
35
Profiles
,
36
CurrentProfile
,
37
Temp
,
38
Cache
,
39
Sessions
,
40
LastPath
41
};
42
43
explicit
DataPaths
();
44
~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
60
private
:
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
DataPaths
Definition:
datapaths.h:28
DataPaths::Path
Path
Definition:
datapaths.h:30
DataPaths::Sessions
@ Sessions
Definition:
datapaths.h:39
DataPaths::Temp
@ Temp
Definition:
datapaths.h:37
DataPaths::Config
@ Config
Definition:
datapaths.h:34
DataPaths::Plugins
@ Plugins
Definition:
datapaths.h:33
DataPaths::CurrentProfile
@ CurrentProfile
Definition:
datapaths.h:36
DataPaths::Profiles
@ Profiles
Definition:
datapaths.h:35
DataPaths::Themes
@ Themes
Definition:
datapaths.h:32
DataPaths::Cache
@ Cache
Definition:
datapaths.h:38
DataPaths::~DataPaths
~DataPaths()
qzcommon.h
FALKON_EXPORT
#define FALKON_EXPORT
Definition:
qzcommon.h:28
src
lib
app
datapaths.h
Generated by
1.9.3