File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 14
14
***************************************************************************/
15
15
16
16
#include " qgspathresolver.h"
17
+ #include " qgsbasemappathregistry.h"
17
18
18
19
#include " qgis.h"
19
20
#include " qgsapplication.h"
20
21
#include < QFileInfo>
21
22
#include < QUrl>
22
23
#include < QUuid>
23
24
25
+
24
26
typedef std::vector< std::pair< QString, std::function< QString( const QString & ) > > > CustomResolvers;
25
27
Q_GLOBAL_STATIC ( CustomResolvers, sCustomResolvers )
26
28
@@ -48,6 +50,12 @@ QString QgsPathResolver::readPath( const QString &f ) const
48
50
return QgsApplication::pkgDataPath () + QStringLiteral ( " /resources" ) + src.mid ( 8 );
49
51
}
50
52
53
+ if ( src.startsWith ( QLatin1String ( " basemap:" ) ) )
54
+ {
55
+ // strip away "inbuilt:" prefix, replace with actual inbuilt data folder path
56
+ return QgsApplication::basemapPathRegistry ()->fullPath ( src.mid ( 8 ) ) ;
57
+ }
58
+
51
59
if ( mBaseFileName .isNull () )
52
60
{
53
61
return src;
@@ -183,6 +191,10 @@ QString QgsPathResolver::writePath( const QString &src ) const
183
191
return src;
184
192
}
185
193
194
+ QString basemapPath = QgsApplication::basemapPathRegistry ()->relativePath ( src );
195
+ if ( !basemapPath.isEmpty () )
196
+ return QStringLiteral ( " basemap:" ) + basemapPath;
197
+
186
198
if ( src.startsWith ( QgsApplication::pkgDataPath () + QStringLiteral ( " /resources" ) ) )
187
199
{
188
200
// replace inbuilt data folder path with "inbuilt:" prefix
You can’t perform that action at this time.
0 commit comments