35 for (
const QDir &basePath : std::as_const( mPaths ) )
36 if ( basePath.exists( relativePath ) )
37 return basePath.absoluteFilePath( relativePath );
46 for (
const QDir &basePath : std::as_const( mPaths ) )
47 if ( fullPath.startsWith( basePath.absolutePath() ) )
48 return basePath.relativeFilePath( fullPath );
59 for (
const QDir &dir : mPaths )
60 paths << dir.absolutePath();
69 for (
const QString &path :
paths )
72 if ( !mPaths.contains( dir ) )
85 if ( mPaths.contains( dir ) )
90 if ( position >= 0 && position < mPaths.count() )
91 mPaths.insert( position, dir );
103 mPaths.removeAll( QDir( path ) );
108void QgsLocalizedDataPathRegistry::readFromSettings()
113void 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.
The QgsReadWriteLocker class is a convenience class that simplifies locking and unlocking QReadWriteL...
void unlock()
Unlocks the lock.
void changeMode(Mode mode)
Change the mode of the lock to mode.
bool setValue(const T &value, const QString &dynamicKeyPart=QString()) const
Set settings value.
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
A string list settings entry.
static QgsSettingsTreeNode * sTreeQgis