forked from qt-creator/qt-creator
ProjectExplorer: Do not depend on app_version.h in settingsaccessor
Change-Id: I673a1946ecfc9ef7e60eeae549eff7e08741d756 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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);
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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));
|
||||
|
Reference in New Issue
Block a user