summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2017-11-15 16:15:20 +0100
committerTobias Hunger <tobias.hunger@qt.io>2017-11-20 10:08:40 +0000
commit94e818dc822a68e546a6c96ebf08c39b7aa3eb3d (patch)
treeeddb1a6b4f78042899d121ee18777190b2ba0001
parentcf5d92622109aeb70f958e70b527f4c948d9ff1d (diff)
downloadqt-creator-94e818dc822a68e546a6c96ebf08c39b7aa3eb3d.tar.gz
ProjectExplorer: Do not depend on app_version.h in settingsaccessor
Change-Id: I673a1946ecfc9ef7e60eeae549eff7e08741d756 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r--src/plugins/projectexplorer/settingsaccessor.cpp14
-rw-r--r--src/plugins/projectexplorer/settingsaccessor.h1
-rw-r--r--src/plugins/projectexplorer/userfileaccessor.cpp5
3 files changed, 11 insertions, 9 deletions
diff --git a/src/plugins/projectexplorer/settingsaccessor.cpp b/src/plugins/projectexplorer/settingsaccessor.cpp
index 9adf9fcc17..6af26979ab 100644
--- a/src/plugins/projectexplorer/settingsaccessor.cpp
+++ b/src/plugins/projectexplorer/settingsaccessor.cpp
@@ -25,8 +25,6 @@
#include "settingsaccessor.h"
-#include <app/app_version.h>
-
#include <utils/persistentsettings.h>
#include <utils/qtcassert.h>
@@ -117,6 +115,7 @@ public:
std::unique_ptr<PersistentSettingsWriter> m_writer;
QByteArray m_settingsId;
QString m_displayName;
+ QString m_applicationDisplayName;
QString m_userSuffix;
QString m_sharedSuffix;
@@ -448,7 +447,7 @@ SettingsAccessor::IssueInfo SettingsAccessor::findIssues(const QVariantMap &data
"version of %2 was used are ignored, and "
"changes made now will <b>not</b> be propagated to "
"the newer version.</p>").arg(path.toUserOutput())
- .arg(Core::Constants::IDE_DISPLAY_NAME);
+ .arg(d->m_applicationDisplayName);
result.buttons.insert(QMessageBox::Ok, Continue);
}
@@ -464,7 +463,7 @@ SettingsAccessor::IssueInfo SettingsAccessor::findIssues(const QVariantMap &data
"<p>Did you work with this project on another machine or "
"using a different settings path before?</p>"
"<p>Do you still want to load the settings file \"%2\"?</p>")
- .arg(Core::Constants::IDE_DISPLAY_NAME)
+ .arg(d->m_applicationDisplayName)
.arg(path.toUserOutput());
result.defaultButton = QMessageBox::No;
result.escapeButton = QMessageBox::No;
@@ -596,6 +595,11 @@ void SettingsAccessor::setDisplayName(const QString &dn)
d->m_displayName = dn;
}
+void SettingsAccessor::setApplicationDisplayName(const QString &dn)
+{
+ d->m_applicationDisplayName = dn;
+}
+
/* Will always return the default name first (if applicable) */
FileNameList SettingsAccessor::settingsFiles(const QString &suffix) const
{
@@ -721,7 +725,7 @@ QVariantMap SettingsAccessor::readSharedSettings(QWidget *parent) const
"The version of your .shared file is not "
"supported by %1. "
"Do you want to try loading it anyway?")
- .arg(Core::Constants::IDE_DISPLAY_NAME),
+ .arg(d->m_applicationDisplayName),
QMessageBox::Yes | QMessageBox::No,
parent);
msgBox.setDefaultButton(QMessageBox::No);
diff --git a/src/plugins/projectexplorer/settingsaccessor.h b/src/plugins/projectexplorer/settingsaccessor.h
index 65652c27a0..d01826081c 100644
--- a/src/plugins/projectexplorer/settingsaccessor.h
+++ b/src/plugins/projectexplorer/settingsaccessor.h
@@ -112,6 +112,7 @@ public:
protected:
void setSettingsId(const QByteArray &id);
void setDisplayName(const QString &dn);
+ void setApplicationDisplayName(const QString &dn);
QVariantMap readFile(const Utils::FileName &path) const;
QVariantMap upgradeSettings(const QVariantMap &data) const;
diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp
index 69d6342337..2ec9f875de 100644
--- a/src/plugins/projectexplorer/userfileaccessor.cpp
+++ b/src/plugins/projectexplorer/userfileaccessor.cpp
@@ -42,10 +42,6 @@
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
-#include <QApplication>
-#include <QDir>
-#include <QRegExp>
-
using namespace Utils;
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
@@ -357,6 +353,7 @@ UserFileAccessor::UserFileAccessor(Project *project) :
{
setSettingsId(ProjectExplorerPlugin::projectExplorerSettings().environmentId.toByteArray());
setDisplayName(project->displayName());
+ setApplicationDisplayName(Core::Constants::IDE_DISPLAY_NAME);
// Register Upgraders:
addVersionUpgrader(std::make_unique<UserFileVersion1Upgrader>(this));