33 for (
const QDir &basePath : std::as_const( mPaths ) )
34 if ( basePath.exists( relativePath ) )
35 return basePath.absoluteFilePath( relativePath );
44 for (
const QDir &basePath : std::as_const( mPaths ) )
45 if ( fullPath.startsWith( basePath.absolutePath() ) )
46 return basePath.relativeFilePath( fullPath );
57 for (
const QDir &dir : mPaths )
58 paths << dir.absolutePath();
67 for (
const QString &path :
paths )
70 if ( !mPaths.contains( dir ) )
83 if ( mPaths.contains( dir ) )
88 if ( position >= 0 && position < mPaths.count() )
89 mPaths.insert( position, dir );
101 mPaths.removeAll( QDir( path ) );
106void QgsLocalizedDataPathRegistry::readFromSettings()
111void 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.
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.
static const QgsSettingsEntryStringList settingsLocalizedDataPaths
Settings entry localized data 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.