Skip to content

Commit

Permalink
rename full/relative to global/localized
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 19, 2020
1 parent 7460747 commit b67f6bf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Expand Up @@ -34,14 +34,14 @@ The resolving of the file paths happens in QgsPathResolver.

~QgsLocalizedDataPathRegistry();

QString fullPath( const QString &relativePath ) const;
QString globalPath( const QString &localizedPath ) const;
%Docstring
Returns the full path if the file has been found in one of the paths, an empty string otherwise
Returns the global path if the file has been found in one of the paths, an empty string otherwise
%End

QString relativePath( const QString &fullPath ) const;
QString localizedPath( const QString &globalPath ) const;
%Docstring
Returns the relative path if the file has been found in one of the path, an empty string otherwise
Returns the localized path if the file has been found in one of the path, an empty string otherwise
%End

QStringList paths() const;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgslocalizeddatapathregistry.cpp
Expand Up @@ -26,7 +26,7 @@ QgsLocalizedDataPathRegistry::QgsLocalizedDataPathRegistry()
readFromSettings();
}

QString QgsLocalizedDataPathRegistry::fullPath( const QString &relativePath ) const
QString QgsLocalizedDataPathRegistry::globalPath( const QString &relativePath ) const
{
QgsReadWriteLocker locker( mLock, QgsReadWriteLocker::Read );

Expand All @@ -37,7 +37,7 @@ QString QgsLocalizedDataPathRegistry::fullPath( const QString &relativePath ) co
return QString();
}

QString QgsLocalizedDataPathRegistry::relativePath( const QString &fullPath ) const
QString QgsLocalizedDataPathRegistry::localizedPath( const QString &fullPath ) const
{
QgsReadWriteLocker locker( mLock, QgsReadWriteLocker::Read );

Expand Down
8 changes: 4 additions & 4 deletions src/core/qgslocalizeddatapathregistry.h
Expand Up @@ -45,11 +45,11 @@ class CORE_EXPORT QgsLocalizedDataPathRegistry

~QgsLocalizedDataPathRegistry() = default;

//! Returns the full path if the file has been found in one of the paths, an empty string otherwise
QString fullPath( const QString &relativePath ) const;
//! Returns the global path if the file has been found in one of the paths, an empty string otherwise
QString globalPath( const QString &localizedPath ) const;

//! Returns the relative path if the file has been found in one of the path, an empty string otherwise
QString relativePath( const QString &fullPath ) const;
//! Returns the localized path if the file has been found in one of the path, an empty string otherwise
QString localizedPath( const QString &globalPath ) const;

//! Returns a list of registered localized paths
QStringList paths() const;
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgspathresolver.cpp
Expand Up @@ -53,7 +53,7 @@ QString QgsPathResolver::readPath( const QString &f ) const
if ( src.startsWith( QLatin1String( "localized:" ) ) )
{
// strip away "localized:" prefix, replace with actual inbuilt data folder path
return QgsApplication::localizedDataPathRegistry()->fullPath( src.mid( 10 ) ) ;
return QgsApplication::localizedDataPathRegistry()->globalPath( src.mid( 10 ) ) ;
}

if ( mBaseFileName.isNull() )
Expand Down Expand Up @@ -191,9 +191,9 @@ QString QgsPathResolver::writePath( const QString &src ) const
return src;
}

QString basemapPath = QgsApplication::localizedDataPathRegistry()->relativePath( src );
if ( !basemapPath.isEmpty() )
return QStringLiteral( "localized:" ) + basemapPath;
QString localizedPath = QgsApplication::localizedDataPathRegistry()->localizedPath( src );
if ( !localizedPath.isEmpty() )
return QStringLiteral( "localized:" ) + localizedPath;

if ( src.startsWith( QgsApplication::pkgDataPath() + QStringLiteral( "/resources" ) ) )
{
Expand Down

0 comments on commit b67f6bf

Please sign in to comment.