CMake build: Purge copying settings from Nokia directory

It is not used, and not supported in the other build systems.

Change-Id: I38049e145595490058e255b94cdb8dd13c3f6fb2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Orgad Shaneh
2021-07-05 15:48:37 +03:00
committed by Orgad Shaneh
parent dbb5ab932c
commit dcf692d3ff
4 changed files with 1 additions and 52 deletions

View File

@@ -4,7 +4,6 @@ set(IDE_VERSION_DISPLAY "5.0.0-beta1") # The IDE display version.
set(IDE_COPYRIGHT_YEAR "2021") # The IDE current copyright year. set(IDE_COPYRIGHT_YEAR "2021") # The IDE current copyright year.
set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation.
set(IDE_COPY_SETTINGSVARIANT "Nokia") # The IDE settings to initially import.
set(IDE_DISPLAY_NAME "Qt Creator") # The IDE display name. set(IDE_DISPLAY_NAME "Qt Creator") # The IDE display name.
set(IDE_ID "qtcreator") # The IDE id (no spaces, lowercase!) set(IDE_ID "qtcreator") # The IDE id (no spaces, lowercase!)
set(IDE_CASED_ID "QtCreator") # The cased IDE id (no spaces!) set(IDE_CASED_ID "QtCreator") # The cased IDE id (no spaces!)

View File

@@ -49,7 +49,6 @@ const char IDE_REVISION_URL[] = "${IDE_REVISION_URL}";
// changes the path where the settings are saved to // changes the path where the settings are saved to
const char IDE_SETTINGSVARIANT_STR[] = "${IDE_SETTINGSVARIANT}"; const char IDE_SETTINGSVARIANT_STR[] = "${IDE_SETTINGSVARIANT}";
const char IDE_COPY_SETTINGS_FROM_VARIANT_STR[] = "${IDE_COPY_SETTINGSVARIANT}";
} // Constants } // Constants
} // Core } // Core

View File

@@ -65,12 +65,6 @@ const char IDE_SETTINGSVARIANT_STR[] = STRINGIFY(IDE_SETTINGSVARIANT);
const char IDE_SETTINGSVARIANT_STR[] = \"QtProject\"; const char IDE_SETTINGSVARIANT_STR[] = \"QtProject\";
#endif #endif
#ifdef IDE_COPY_SETTINGS_FROM_VARIANT
const char IDE_COPY_SETTINGS_FROM_VARIANT_STR[] = STRINGIFY(IDE_COPY_SETTINGS_FROM_VARIANT);
#else
const char IDE_COPY_SETTINGS_FROM_VARIANT_STR[] = \"\";
#endif
#undef IDE_VERSION_COMPAT_DEF #undef IDE_VERSION_COMPAT_DEF
#undef IDE_VERSION_DISPLAY_DEF #undef IDE_VERSION_DISPLAY_DEF
#undef IDE_VERSION #undef IDE_VERSION

View File

@@ -290,49 +290,6 @@ static Utils::QtcSettings *createUserSettings()
QLatin1String(Core::Constants::IDE_CASED_ID)); QLatin1String(Core::Constants::IDE_CASED_ID));
} }
static inline Utils::QtcSettings *userSettings()
{
Utils::QtcSettings *settings = createUserSettings();
const QString fromVariant = QLatin1String(Core::Constants::IDE_COPY_SETTINGS_FROM_VARIANT_STR);
if (fromVariant.isEmpty())
return settings;
// Copy old settings to new ones:
QFileInfo pathFi = QFileInfo(settings->fileName());
if (pathFi.exists()) // already copied.
return settings;
QDir destDir = pathFi.absolutePath();
if (!destDir.exists())
destDir.mkpath(pathFi.absolutePath());
QDir srcDir = destDir;
srcDir.cdUp();
if (!srcDir.cd(fromVariant))
return settings;
if (srcDir == destDir) // Nothing to copy and no settings yet
return settings;
const QStringList entries = srcDir.entryList();
for (const QString &file : entries) {
const QString lowerFile = file.toLower();
if (lowerFile.startsWith(QLatin1String("profiles.xml"))
|| lowerFile.startsWith(QLatin1String("toolchains.xml"))
|| lowerFile.startsWith(QLatin1String("qtversion.xml"))
|| lowerFile.startsWith(QLatin1String("devices.xml"))
|| lowerFile.startsWith(QLatin1String("debuggers.xml"))
|| lowerFile.startsWith(QLatin1String(Core::Constants::IDE_ID) + "."))
QFile::copy(srcDir.absoluteFilePath(file), destDir.absoluteFilePath(file));
if (file == QLatin1String(Core::Constants::IDE_ID))
copyRecursively(srcDir.absoluteFilePath(file), destDir.absoluteFilePath(file));
}
// Make sure to use the copied settings:
delete settings;
return createUserSettings();
}
static void setHighDpiEnvironmentVariable() static void setHighDpiEnvironmentVariable()
{ {
@@ -595,7 +552,7 @@ int main(int argc, char **argv)
/*Initialize global settings and resetup install settings with QApplication::applicationDirPath */ /*Initialize global settings and resetup install settings with QApplication::applicationDirPath */
setupInstallSettings(options.installSettingsPath); setupInstallSettings(options.installSettingsPath);
Utils::QtcSettings *settings = userSettings(); Utils::QtcSettings *settings = createUserSettings();
Utils::QtcSettings *globalSettings Utils::QtcSettings *globalSettings
= new Utils::QtcSettings(QSettings::IniFormat, = new Utils::QtcSettings(QSettings::IniFormat,
QSettings::SystemScope, QSettings::SystemScope,