36 for (
const QDir &basePath : std::as_const( mPaths ) )
37 if ( basePath.exists( relativePath ) )
38 return basePath.absoluteFilePath( relativePath );
47 for (
const QDir &basePath : std::as_const( mPaths ) )
48 if ( fullPath.startsWith( basePath.absolutePath() ) )
49 return basePath.relativeFilePath( fullPath );
60 for (
const QDir &dir : mPaths )
61 paths << dir.absolutePath();
70 for (
const QString &path :
paths )
73 if ( !mPaths.contains( dir ) )
86 if ( mPaths.contains( dir ) )
91 if ( position >= 0 && position < mPaths.count() )
92 mPaths.insert( position, dir );
104 mPaths.removeAll( QDir( path ) );
109void QgsLocalizedDataPathRegistry::readFromSettings()
114void QgsLocalizedDataPathRegistry::writeToSettings()
const
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.
void setPaths(const QStringList &paths)
Sets the complete list of localized path.
void unregisterPath(const QString &path)
Unregisters a localized path.
QgsLocalizedDataPathRegistry()
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.
static const QgsSettingsEntryStringList * settingsLocalizedDataPaths
Settings entry localized data paths.
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...
QStringList paths() const
Returns a list of registered localized paths.
A convenience class that simplifies locking and unlocking QReadWriteLocks.
void unlock()
Unlocks the lock.
void changeMode(Mode mode)
Change the mode of the lock to mode.
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
A string list settings entry.
static QgsSettingsTreeNode * sTreeQgis