QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 <QDir>
22 #include <QList>
23 #include <QReadWriteLock>
24 
25 #include "qgis_core.h"
26 #include "qgis_sip.h"
27 #include "qgssettingsentryimpl.h"
28 
43 {
44  public:
46 
48  QString globalPath( const QString &localizedPath ) const;
49 
51  QString localizedPath( const QString &globalPath ) const;
52 
54  QStringList paths() const;
55 
57  void setPaths( const QStringList &paths ) SIP_SKIP;
58 
64  void registerPath( const QString &path, int position = -1 );
65 
67  void unregisterPath( const QString &path );
68 
69 #ifndef SIP_RUN
70  static const inline QgsSettingsEntryStringList settingsLocalizedDataPaths = QgsSettingsEntryStringList( QStringLiteral( "localized_data_paths" ), QgsSettings::Prefix::QGIS, QStringList() );
72 #endif
73 
74  private:
75 #ifdef SIP_RUN
77  {}
78 #endif
79 
80  void readFromSettings();
81  void writeToSettings() const;
82 
83  QList<QDir> mPaths;
84  mutable QReadWriteLock mLock;
85 };
86 
87 #endif // QGSLOCALIZEDDATAPATHREGISTRY_H
QgsSettings::Prefix::QGIS
static const char * QGIS
Definition: qgssettings.h:101
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
qgis_sip.h
qgssettingsentryimpl.h
QgsLocalizedDataPathRegistry
A registry class to hold localized data paths which can be used for basemaps, logos,...
Definition: qgslocalizeddatapathregistry.h:42
QgsSettingsEntryStringList
A string list settings entry.
Definition: qgssettingsentryimpl.h:182