Skip to content

Commit

Permalink
Store QGISCUSTOMIZATION3.ini next to QGIS3.ini in the profile directo…
Browse files Browse the repository at this point in the history
…ry. Fixes #17794. (#5999)
  • Loading branch information
borysiasty authored and NathanW2 committed Jan 8, 2018
1 parent 617459d commit 8dfb17d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -995,17 +995,19 @@ int main( int argc, char *argv[] )
// TODO: use QgsSettings
QSettings *customizationsettings = nullptr;

// Using the customizationfile option always overrides the option and config path options.
if ( !customizationfile.isEmpty() )
{
customizationsettings = new QSettings( customizationfile, QSettings::IniFormat );
// Using the customizationfile option always overrides the option and config path options.
QgsCustomization::instance()->setEnabled( true );
}
else
{
customizationsettings = new QSettings( QStringLiteral( "QGIS" ), QStringLiteral( "QGISCUSTOMIZATION2" ) );
// Use the default file location
customizationfile = profileFolder + QDir::separator() + QStringLiteral( "QGIS" ) + QDir::separator() + QStringLiteral( "QGISCUSTOMIZATION3.ini" ) ;
}

customizationsettings = new QSettings( customizationfile, QSettings::IniFormat );

// Load and set possible default customization, must be done after QgsApplication init and QgsSettings ( QCoreApplication ) init
QgsCustomization::instance()->setSettings( customizationsettings );
QgsCustomization::instance()->loadDefault();
Expand Down

0 comments on commit 8dfb17d

Please sign in to comment.