forked from qt-creator/qt-creator
Do not compile PROJECT_USER_FILE_EXTENSION into plugins
Set it in the app info in the main application and read it from there. Moves more branding information out of the plugins. Change-Id: I2f2e9fc96900793be15ac1907df70dda31c1b9c1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -26,6 +26,7 @@ Module {
|
||||
property string ide_id: 'qtcreator'
|
||||
property string ide_cased_id: 'QtCreator'
|
||||
property string ide_bundle_identifier: 'org.qt-project.qtcreator'
|
||||
property string ide_user_file_extension: '.user'
|
||||
|
||||
property string libDirName: "lib"
|
||||
property string ide_app_path: qbs.targetOS.contains("macos") ? "" : "bin"
|
||||
|
@@ -28,5 +28,8 @@ const char IDE_REVISION_URL[] = "${IDE_REVISION_URL}";
|
||||
// changes the path where the settings are saved to
|
||||
const char IDE_SETTINGSVARIANT_STR[] = "${IDE_SETTINGSVARIANT}";
|
||||
|
||||
// added extension for project user settings
|
||||
const char IDE_PROJECT_USER_FILE_EXTENSION[] = "${PROJECT_USER_FILE_EXTENSION}";
|
||||
|
||||
} // Constants
|
||||
} // Core
|
||||
|
@@ -57,6 +57,8 @@ Product {
|
||||
product.moduleProperty("qtc", "ide_id"));
|
||||
content = content.replace("$${IDE_CASED_ID}",
|
||||
product.moduleProperty("qtc", "ide_cased_id"));
|
||||
content = content.replace("$${PROJECT_USER_FILE_EXTENSION}",
|
||||
product.moduleProperty("qtc", "ide_user_file_extension"));
|
||||
file = new TextFile(output.filePath, TextFile.WriteOnly);
|
||||
file.truncate();
|
||||
file.write(content);
|
||||
|
@@ -662,6 +662,7 @@ int main(int argc, char **argv)
|
||||
info.id = Constants::IDE_ID;
|
||||
info.revision = Constants::IDE_REVISION_STR;
|
||||
info.revisionUrl = Constants::IDE_REVISION_URL;
|
||||
info.userFileExtension = Constants::IDE_PROJECT_USER_FILE_EXTENSION;
|
||||
Utils::Internal::setAppInfo(info);
|
||||
|
||||
QTranslator translator;
|
||||
|
@@ -18,6 +18,7 @@ public:
|
||||
QString id;
|
||||
QString revision;
|
||||
QString revisionUrl;
|
||||
QString userFileExtension;
|
||||
};
|
||||
|
||||
QTCREATOR_UTILS_EXPORT AppInfo appInfo();
|
||||
|
@@ -182,11 +182,6 @@ add_qtc_plugin(ProjectExplorer
|
||||
xcodebuildparser.cpp xcodebuildparser.h
|
||||
)
|
||||
|
||||
extend_qtc_plugin(ProjectExplorer
|
||||
CONDITION PROJECT_USER_FILE_EXTENSION
|
||||
DEFINES "PROJECT_USER_FILE_EXTENSION=${PROJECT_USER_FILE_EXTENSION}"
|
||||
)
|
||||
|
||||
if (TARGET clangd)
|
||||
set(CLANG_BINDIR "$<TARGET_FILE_DIR:clangd>")
|
||||
endif()
|
||||
|
@@ -14,6 +14,8 @@
|
||||
#include "kitmanager.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <utils/appinfo.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/persistentsettings.h>
|
||||
@@ -29,22 +31,18 @@ using namespace ProjectExplorer::Internal;
|
||||
|
||||
using StringVariantPair = std::pair<const QString, QVariant>;
|
||||
|
||||
static QString userFileExtension()
|
||||
{
|
||||
const QString ext = Utils::appInfo().userFileExtension;
|
||||
return ext.isEmpty() ? QLatin1String(".user") : ext;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
const char OBSOLETE_VERSION_KEY[] = "ProjectExplorer.Project.Updater.FileVersion";
|
||||
const char SHARED_SETTINGS[] = "SharedSettings";
|
||||
const char USER_STICKY_KEYS_KEY[] = "UserStickyKeys";
|
||||
|
||||
#ifdef PROJECT_USER_FILE_EXTENSION
|
||||
#define STRINGIFY_INTERNAL(x) #x
|
||||
#define STRINGIFY(x) STRINGIFY_INTERNAL(x)
|
||||
|
||||
const char FILE_EXTENSION_STR[] = STRINGIFY(PROJECT_USER_FILE_EXTENSION);
|
||||
#else
|
||||
const char FILE_EXTENSION_STR[] = ".user";
|
||||
|
||||
#endif
|
||||
|
||||
// Version 14 Move builddir into BuildConfiguration
|
||||
class UserFileVersion14Upgrader : public VersionUpgrader
|
||||
{
|
||||
@@ -385,15 +383,15 @@ QVariant UserFileAccessor::retrieveSharedSettings() const
|
||||
FilePath UserFileAccessor::projectUserFile() const
|
||||
{
|
||||
static const QString qtcExt = qtcEnvironmentVariable("QTC_EXTENSION");
|
||||
return m_project->projectFilePath()
|
||||
.stringAppended(generateSuffix(qtcExt.isEmpty() ? FILE_EXTENSION_STR : qtcExt));
|
||||
return m_project->projectFilePath().stringAppended(
|
||||
generateSuffix(qtcExt.isEmpty() ? userFileExtension() : qtcExt));
|
||||
}
|
||||
|
||||
FilePath UserFileAccessor::externalUserFile() const
|
||||
{
|
||||
static const QString qtcExt = qtcEnvironmentVariable("QTC_EXTENSION");
|
||||
return externalUserFilePath(m_project->projectFilePath(),
|
||||
generateSuffix(qtcExt.isEmpty() ? FILE_EXTENSION_STR : qtcExt));
|
||||
generateSuffix(qtcExt.isEmpty() ? userFileExtension() : qtcExt));
|
||||
}
|
||||
|
||||
FilePath UserFileAccessor::sharedFile() const
|
||||
|
Reference in New Issue
Block a user