QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
33 for (
const QDir &basePath : qgis::as_const( mPaths ) )
34 if ( basePath.exists( relativePath ) )
35 return basePath.absoluteFilePath( relativePath );
44 for (
const QDir &basePath : qgis::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 ) );
106 void QgsLocalizedDataPathRegistry::readFromSettings()
108 setPaths(
QgsSettings().value( QStringLiteral(
"/qgis/localized_data_paths" ) ).toStringList() );
111 void QgsLocalizedDataPathRegistry::writeToSettings()
void changeMode(Mode mode)
Change the mode of the lock to mode.
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...
void unregisterPath(const QString &path)
Unregisters a localized path.
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 unlock()
Unlocks the lock.
QgsLocalizedDataPathRegistry()
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
QStringList paths() const
Returns a list of registered localized paths.
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.