Skip to content

Commit 749e2a5

Browse files
committed
fix runtime warning
1 parent 24c95af commit 749e2a5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/core/qgsapplication.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,10 @@ const QString QgsApplication::prefixPath()
331331
{
332332
if ( ABISYM( mRunningFromBuildDir ) )
333333
{
334-
qWarning( "!!! prefix path was requested, but it is not valid - we do not run from installed path !!!" );
334+
static bool once = true;
335+
if ( once )
336+
qWarning( "!!! prefix path was requested, but it is not valid - we do not run from installed path !!!" );
337+
once = false;
335338
}
336339

337340
return ABISYM( mPrefixPath );

src/core/qgsmaplayer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ bool QgsMapLayer::loadNamedStyleFromDb( const QString &db, const QString &theURI
922922

923923
QgsDebugMsg( QString( "Trying to load style for \"%1\" from \"%2\"" ).arg( theURI ).arg( db ) );
924924

925-
if ( !QFile( db ).exists() )
925+
if ( db.isEmpty() || !QFile( db ).exists() )
926926
return false;
927927

928928
myResult = sqlite3_open_v2( db.toUtf8().data(), &myDatabase, SQLITE_OPEN_READONLY, NULL );

0 commit comments

Comments
 (0)