QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
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 
42 {
43  public:
45 
47  QString globalPath( const QString &localizedPath ) const;
48 
50  QString localizedPath( const QString &globalPath ) const;
51 
53  QStringList paths() const;
54 
56  void setPaths( const QStringList &paths ) SIP_SKIP;
57 
63  void registerPath( const QString &path, int position = -1 );
64 
66  void unregisterPath( const QString &path );
67 
68  private:
69 #ifdef SIP_RUN
71  {}
72 #endif
73 
74  void readFromSettings();
75  void writeToSettings();
76 
77  QList<QDir> mPaths;
78  mutable QReadWriteLock mLock;
79 };
80 
81 #endif // QGSLOCALIZEDDATAPATHREGISTRY_H
A registry class to hold localized data paths which can be used for basemaps, logos,...
#define SIP_SKIP
Definition: qgis_sip.h:126