1010#include < QStandardPaths>
1111#include < QPalette>
1212
13- QString Settings::userConfigurationFile ;
13+ QString Settings::userPreferencesFile ;
1414QSettings* Settings::settings;
1515std::unordered_map<std::string, QVariant> Settings::m_hCache;
1616int Settings::m_defaultFontSize;
@@ -20,9 +20,9 @@ static bool ends_with(const std::string& str, const std::string& with)
2020 return str.rfind (with) == str.size () - with.size ();
2121}
2222
23- void Settings::setUserConfigurationFile (const QString userConfigurationFileArg )
23+ void Settings::setUserPreferencesFile (const QString userPreferencesFileArg )
2424{
25- userConfigurationFile = userConfigurationFileArg ;
25+ userPreferencesFile = userPreferencesFileArg ;
2626}
2727
2828void Settings::setSettingsObject ()
@@ -32,47 +32,47 @@ void Settings::setSettingsObject()
3232 return ;
3333
3434 /*
35- Variable that stores whether or not the configuration file requested by the user is a normal configuration file
35+ Variable that stores whether or not the preferences file requested by the user is a normal preferences file
3636 If the file does not exist and is newly created, the if statement below is not executed, so the default value is set to true
3737 */
38- bool isNormalUserConfigurationFile = true ;
38+ bool isNormalUserPreferencesFile = true ;
3939
40- // Code that verifies that the configuration file requested by the user is a normal configuration file
41- if (userConfigurationFile != nullptr )
40+ // Code that verifies that the preferences file requested by the user is a normal preferences file
41+ if (userPreferencesFile != nullptr )
4242 {
4343 QFile *file = new QFile;
44- file->setFileName (userConfigurationFile );
44+ file->setFileName (userPreferencesFile );
4545
4646 if (file->open (QIODevice::ReadOnly))
4747 {
4848 if (file->exists () &&
4949 QString::compare (QString::fromStdString (" [%General]\n " ), file->readLine (), Qt::CaseInsensitive) != 0 )
50- isNormalUserConfigurationFile = false ;
50+ isNormalUserPreferencesFile = false ;
5151 }
5252
5353 file->close ();
5454 }
5555
56- if (userConfigurationFile == nullptr )
56+ if (userPreferencesFile == nullptr )
5757 {
5858 settings = new QSettings (QCoreApplication::organizationName (), QCoreApplication::organizationName ());
5959 } else {
60- if (isNormalUserConfigurationFile )
60+ if (isNormalUserPreferencesFile )
6161 {
62- settings = new QSettings (userConfigurationFile , QSettings::IniFormat);
62+ settings = new QSettings (userPreferencesFile , QSettings::IniFormat);
6363
64- // Code to verify that the user does not have access to the requested configuration file
64+ // Code to verify that the user does not have access to the requested preferences file
6565 if (settings->status () == QSettings::AccessError) {
66- qWarning () << qPrintable (" The given configuration file can NOT access. Please check the permission for the file." );
67- qWarning () << qPrintable (" So, the -c /--config option is ignored." );
66+ qWarning () << qPrintable (" The given preferences file can NOT access. Please check the permission for the file." );
67+ qWarning () << qPrintable (" So, the -p /--preferences option is ignored." );
6868
6969 // Since you do not have permission to the file, delete the existing assignment and assign the standard
7070 delete settings;
7171 settings = new QSettings (QCoreApplication::organizationName (), QCoreApplication::organizationName ());
7272 }
7373 } else {
74- qWarning () << qPrintable (" The given configuration file is not a normal configuration file. Please check again." );
75- qWarning () << qPrintable (" So, the -c /--config option is ignored." );
74+ qWarning () << qPrintable (" The given preferences file is not a normal preferences file. Please check again." );
75+ qWarning () << qPrintable (" So, the -p /--preferences option is ignored." );
7676 settings = new QSettings (QCoreApplication::organizationName (), QCoreApplication::organizationName ());
7777 }
7878 }
0 commit comments