Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8601 from signedav/fix-ts-file
[Bugfix] .qgs-translation fix: do not create QgsProject before QgsApplication
  • Loading branch information
m-kuhn committed Dec 6, 2018
2 parents ba88a10 + 2a86b6e commit def29e8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/app/main.cpp
Expand Up @@ -430,6 +430,9 @@ APP_EXPORT
#endif
int main( int argc, char *argv[] )
{
//log messages written before creating QgsApplication
QStringList preApplicationLogMessages;

#ifdef Q_OS_MACX
// Increase file resource limits (i.e., number of allowed open files)
// (from code provided by Larry Biehl, Purdue University, USA, from 'MultiSpec' project)
Expand Down Expand Up @@ -866,11 +869,11 @@ int main( int argc, char *argv[] )
{
if ( !QgsSettings::setGlobalSettingsPath( globalsettingsfile ) )
{
QgsMessageLog::logMessage( QObject::tr( "Invalid globalsettingsfile path: %1" ).arg( globalsettingsfile ), QStringLiteral( "QGIS" ) );
preApplicationLogMessages << QObject::tr( "Invalid globalsettingsfile path: %1" ).arg( globalsettingsfile ), QStringLiteral( "QGIS" );
}
else
{
QgsMessageLog::logMessage( QObject::tr( "Successfully loaded globalsettingsfile path: %1" ).arg( globalsettingsfile ), QStringLiteral( "QGIS" ) );
preApplicationLogMessages << QObject::tr( "Successfully loaded globalsettingsfile path: %1" ).arg( globalsettingsfile ), QStringLiteral( "QGIS" );
}
}

Expand Down Expand Up @@ -970,6 +973,10 @@ int main( int argc, char *argv[] )

QgsApplication myApp( argc, argv, myUseGuiFlag );

//write the log messages written before creating QgsApplication
for ( const QString &preApplicationLogMessage : qgis::as_const( preApplicationLogMessages ) )
QgsMessageLog::logMessage( preApplicationLogMessage );

// Settings migration is only supported on the default profile for now.
if ( profileName == QLatin1String( "default" ) )
{
Expand Down

0 comments on commit def29e8

Please sign in to comment.