forked from qt-creator/qt-creator
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:
committed by
Orgad Shaneh
parent
dbb5ab932c
commit
dcf692d3ff
@@ -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_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_ID "qtcreator") # The IDE id (no spaces, lowercase!)
|
||||
set(IDE_CASED_ID "QtCreator") # The cased IDE id (no spaces!)
|
||||
|
@@ -49,7 +49,6 @@ const char IDE_REVISION_URL[] = "${IDE_REVISION_URL}";
|
||||
|
||||
// changes the path where the settings are saved to
|
||||
const char IDE_SETTINGSVARIANT_STR[] = "${IDE_SETTINGSVARIANT}";
|
||||
const char IDE_COPY_SETTINGS_FROM_VARIANT_STR[] = "${IDE_COPY_SETTINGSVARIANT}";
|
||||
|
||||
} // Constants
|
||||
} // Core
|
||||
|
@@ -65,12 +65,6 @@ const char IDE_SETTINGSVARIANT_STR[] = STRINGIFY(IDE_SETTINGSVARIANT);
|
||||
const char IDE_SETTINGSVARIANT_STR[] = \"QtProject\";
|
||||
#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_DISPLAY_DEF
|
||||
#undef IDE_VERSION
|
||||
|
@@ -290,49 +290,6 @@ static Utils::QtcSettings *createUserSettings()
|
||||
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()
|
||||
{
|
||||
|
||||
@@ -595,7 +552,7 @@ int main(int argc, char **argv)
|
||||
|
||||
/*Initialize global settings and resetup install settings with QApplication::applicationDirPath */
|
||||
setupInstallSettings(options.installSettingsPath);
|
||||
Utils::QtcSettings *settings = userSettings();
|
||||
Utils::QtcSettings *settings = createUserSettings();
|
||||
Utils::QtcSettings *globalSettings
|
||||
= new Utils::QtcSettings(QSettings::IniFormat,
|
||||
QSettings::SystemScope,
|
||||
|
Reference in New Issue
Block a user