Skip to content
Permalink
Browse files

Merge pull request #8621 from signedav/backport-fix-ts-file

.qgs-translation fix: do not create QgsProject before QgsApplication
  • Loading branch information
m-kuhn committed Dec 7, 2018
2 parents 7f5afe6 + a4adbe9 commit a4e22eec106a75e53b571a37c4cf8867ddd172c7
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/app/main.cpp
@@ -432,6 +432,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)
@@ -868,11 +871,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" );
}
}

@@ -972,6 +975,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" ) )
{

0 comments on commit a4e22ee

Please sign in to comment.
You can’t perform that action at this time.