QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgslocalizeddatapathregistry.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslocalizeddatapathregistry.h
3
--------------------------------------
4
Date : May 2020
5
Copyright : (C) 2020 by Denis Rouzaud
6
Email : denis.rouzaud
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
17
#ifndef QGSLOCALIZEDDATAPATHREGISTRY_H
18
#define QGSLOCALIZEDDATAPATHREGISTRY_H
19
20
21
#include "qgis_core.h"
22
#include "
qgis_sip.h
"
23
24
#include <QDir>
25
#include <QList>
26
#include <QReadWriteLock>
27
28
class
QgsSettingsEntryStringList
;
29
44
class
CORE_EXPORT
QgsLocalizedDataPathRegistry
45
{
46
public
:
47
QgsLocalizedDataPathRegistry
();
48
50
QString
globalPath
(
const
QString &
localizedPath
)
const
;
51
53
QString
localizedPath
(
const
QString &
globalPath
)
const
;
54
56
QStringList
paths
()
const
;
57
59
void
setPaths
(
const
QStringList &
paths
)
SIP_SKIP
;
60
66
void
registerPath
(
const
QString &path,
int
position = -1 );
67
69
void
unregisterPath
(
const
QString &path );
70
71
#ifndef SIP_RUN
73
static
const
QgsSettingsEntryStringList
*
settingsLocalizedDataPaths
;
74
#endif
75
76
private
:
77
#ifdef SIP_RUN
78
QgsLocalizedDataPathRegistry
(
const
QgsLocalizedDataPathRegistry
&other ) {}
79
#endif
80
81
void
readFromSettings();
82
void
writeToSettings()
const
;
83
84
QList<QDir> mPaths;
85
mutable
QReadWriteLock mLock;
86
};
87
88
#endif
// QGSLOCALIZEDDATAPATHREGISTRY_H
QgsLocalizedDataPathRegistry::globalPath
QString globalPath(const QString &localizedPath) const
Returns the global path if the file has been found in one of the paths, an empty string otherwise.
Definition
qgslocalizeddatapathregistry.cpp:35
QgsLocalizedDataPathRegistry::setPaths
void setPaths(const QStringList &paths)
Sets the complete list of localized path.
Definition
qgslocalizeddatapathregistry.cpp:67
QgsLocalizedDataPathRegistry::unregisterPath
void unregisterPath(const QString &path)
Unregisters a localized path.
Definition
qgslocalizeddatapathregistry.cpp:102
QgsLocalizedDataPathRegistry::QgsLocalizedDataPathRegistry
QgsLocalizedDataPathRegistry()
Definition
qgslocalizeddatapathregistry.cpp:30
QgsLocalizedDataPathRegistry::localizedPath
QString localizedPath(const QString &globalPath) const
Returns the localized path if the file has been found in one of the path, an empty string otherwise.
Definition
qgslocalizeddatapathregistry.cpp:46
QgsLocalizedDataPathRegistry::settingsLocalizedDataPaths
static const QgsSettingsEntryStringList * settingsLocalizedDataPaths
Settings entry localized data paths.
Definition
qgslocalizeddatapathregistry.h:73
QgsLocalizedDataPathRegistry::registerPath
void registerPath(const QString &path, int position=-1)
Registers a localized path If position is given, the path is inserted at the given position in the li...
Definition
qgslocalizeddatapathregistry.cpp:83
QgsLocalizedDataPathRegistry::paths
QStringList paths() const
Returns a list of registered localized paths.
Definition
qgslocalizeddatapathregistry.cpp:57
QgsSettingsEntryStringList
A string list settings entry.
Definition
qgssettingsentryimpl.h:229
qgis_sip.h
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:138
Generated on
for QGIS API Documentation by
1.17.0