forked from qt-creator/qt-creator
ProjectExplorer: Make KitAspect data members private
Change-Id: Ib80f092e19a00bb0159eef13a8e4e4237a4aaed4 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -393,7 +393,7 @@ private:
|
||||
|
||||
void refresh() override
|
||||
{
|
||||
CMakeTool *const tool = CMakeKitAspect::cmakeTool(m_kit);
|
||||
CMakeTool *const tool = CMakeKitAspect::cmakeTool(kit());
|
||||
if (tool != m_currentTool)
|
||||
m_currentTool = tool;
|
||||
|
||||
|
@@ -49,8 +49,8 @@ private:
|
||||
{
|
||||
const auto id = [this] {
|
||||
if (m_type == ToolType::Meson)
|
||||
return MesonToolKitAspect::mesonToolId(m_kit);
|
||||
return NinjaToolKitAspect::ninjaToolId(m_kit);
|
||||
return MesonToolKitAspect::mesonToolId(kit());
|
||||
return NinjaToolKitAspect::ninjaToolId(kit());
|
||||
}();
|
||||
m_toolsComboBox->setCurrentIndex(indexOf(id));
|
||||
}
|
||||
@@ -107,9 +107,9 @@ void MesonToolKitAspectImpl::setCurrentToolIndex(int index)
|
||||
return;
|
||||
const Id id = Id::fromSetting(m_toolsComboBox->itemData(index));
|
||||
if (m_type == ToolType::Meson)
|
||||
MesonToolKitAspect::setMesonTool(m_kit, id);
|
||||
MesonToolKitAspect::setMesonTool(kit(), id);
|
||||
else
|
||||
NinjaToolKitAspect::setNinjaTool(m_kit, id);
|
||||
NinjaToolKitAspect::setNinjaTool(kit(), id);
|
||||
}
|
||||
|
||||
int MesonToolKitAspectImpl::indexOf(const Id &id)
|
||||
|
@@ -71,13 +71,13 @@ private:
|
||||
void refresh() override
|
||||
{
|
||||
if (!m_ignoreChanges.isLocked())
|
||||
m_chooser->setFilePath(SysRootKitAspect::sysRoot(m_kit));
|
||||
m_chooser->setFilePath(SysRootKitAspect::sysRoot(kit()));
|
||||
}
|
||||
|
||||
void pathWasChanged()
|
||||
{
|
||||
const GuardLocker locker(m_ignoreChanges);
|
||||
SysRootKitAspect::setSysRoot(m_kit, m_chooser->filePath());
|
||||
SysRootKitAspect::setSysRoot(kit(), m_chooser->filePath());
|
||||
}
|
||||
|
||||
PathChooser *m_chooser;
|
||||
@@ -220,7 +220,7 @@ private:
|
||||
|
||||
void refresh() override
|
||||
{
|
||||
Id devType = DeviceTypeKitAspect::deviceTypeId(m_kit);
|
||||
Id devType = DeviceTypeKitAspect::deviceTypeId(kit());
|
||||
if (!devType.isValid())
|
||||
m_comboBox->setCurrentIndex(-1);
|
||||
for (int i = 0; i < m_comboBox->count(); ++i) {
|
||||
@@ -234,7 +234,7 @@ private:
|
||||
void currentTypeChanged(int idx)
|
||||
{
|
||||
Id type = idx < 0 ? Id() : Id::fromSetting(m_comboBox->itemData(idx));
|
||||
DeviceTypeKitAspect::setDeviceTypeId(m_kit, type);
|
||||
DeviceTypeKitAspect::setDeviceTypeId(kit(), type);
|
||||
}
|
||||
|
||||
QComboBox *m_comboBox;
|
||||
@@ -368,12 +368,12 @@ private:
|
||||
|
||||
void makeReadOnly() override { m_comboBox->setEnabled(false); }
|
||||
|
||||
Id settingsPageItemToPreselect() const override { return DeviceKitAspect::deviceId(m_kit); }
|
||||
Id settingsPageItemToPreselect() const override { return DeviceKitAspect::deviceId(kit()); }
|
||||
|
||||
void refresh() override
|
||||
{
|
||||
m_model->setTypeFilter(DeviceTypeKitAspect::deviceTypeId(m_kit));
|
||||
m_comboBox->setCurrentIndex(m_model->indexOf(DeviceKitAspect::device(m_kit)));
|
||||
m_model->setTypeFilter(DeviceTypeKitAspect::deviceTypeId(kit()));
|
||||
m_comboBox->setCurrentIndex(m_model->indexOf(DeviceKitAspect::device(kit())));
|
||||
}
|
||||
|
||||
void modelAboutToReset()
|
||||
@@ -392,7 +392,7 @@ private:
|
||||
{
|
||||
if (m_ignoreChanges.isLocked())
|
||||
return;
|
||||
DeviceKitAspect::setDeviceId(m_kit, m_model->deviceId(m_comboBox->currentIndex()));
|
||||
DeviceKitAspect::setDeviceId(kit(), m_model->deviceId(m_comboBox->currentIndex()));
|
||||
}
|
||||
|
||||
Guard m_ignoreChanges;
|
||||
@@ -660,7 +660,7 @@ private:
|
||||
}
|
||||
|
||||
m_model->setFilter(blackList);
|
||||
m_comboBox->setCurrentIndex(m_model->indexOf(BuildDeviceKitAspect::device(m_kit)));
|
||||
m_comboBox->setCurrentIndex(m_model->indexOf(BuildDeviceKitAspect::device(kit())));
|
||||
}
|
||||
|
||||
void modelAboutToReset()
|
||||
@@ -679,7 +679,7 @@ private:
|
||||
{
|
||||
if (m_ignoreChanges.isLocked())
|
||||
return;
|
||||
BuildDeviceKitAspect::setDeviceId(m_kit, m_model->deviceId(m_comboBox->currentIndex()));
|
||||
BuildDeviceKitAspect::setDeviceId(kit(), m_model->deviceId(m_comboBox->currentIndex()));
|
||||
}
|
||||
|
||||
Guard m_ignoreChanges;
|
||||
@@ -922,7 +922,7 @@ private:
|
||||
|
||||
void editEnvironmentChanges()
|
||||
{
|
||||
MacroExpander *expander = m_kit->macroExpander();
|
||||
MacroExpander *expander = kit()->macroExpander();
|
||||
EnvironmentDialog::Polisher polisher = [expander](QWidget *w) {
|
||||
VariableChooser::addSupportForChildWidgets(w, expander);
|
||||
};
|
||||
@@ -941,12 +941,12 @@ private:
|
||||
else if (enforcesMSVCEnglish(*changes))
|
||||
m_vslangCheckbox->setChecked(true);
|
||||
}
|
||||
EnvironmentKitAspect::setEnvironmentChanges(m_kit, *changes);
|
||||
EnvironmentKitAspect::setEnvironmentChanges(kit(), *changes);
|
||||
}
|
||||
|
||||
EnvironmentItems envWithoutMSVCEnglishEnforcement() const
|
||||
{
|
||||
EnvironmentItems changes = EnvironmentKitAspect::environmentChanges(m_kit);
|
||||
EnvironmentItems changes = EnvironmentKitAspect::environmentChanges(kit());
|
||||
|
||||
if (HostOsInfo::isWindowsHost())
|
||||
changes.removeAll(forceMSVCEnglishItem());
|
||||
@@ -961,15 +961,15 @@ private:
|
||||
m_vslangCheckbox->setToolTip(Tr::tr("Either switches MSVC to English or keeps the language and "
|
||||
"just forces UTF-8 output (may vary depending on the used MSVC "
|
||||
"compiler)."));
|
||||
if (enforcesMSVCEnglish(EnvironmentKitAspect::environmentChanges(m_kit)))
|
||||
if (enforcesMSVCEnglish(EnvironmentKitAspect::environmentChanges(kit())))
|
||||
m_vslangCheckbox->setChecked(true);
|
||||
connect(m_vslangCheckbox, &QCheckBox::clicked, this, [this](bool checked) {
|
||||
EnvironmentItems changes = EnvironmentKitAspect::environmentChanges(m_kit);
|
||||
EnvironmentItems changes = EnvironmentKitAspect::environmentChanges(kit());
|
||||
if (!checked && changes.indexOf(forceMSVCEnglishItem()) >= 0)
|
||||
changes.removeAll(forceMSVCEnglishItem());
|
||||
if (checked && changes.indexOf(forceMSVCEnglishItem()) < 0)
|
||||
changes.append(forceMSVCEnglishItem());
|
||||
EnvironmentKitAspect::setEnvironmentChanges(m_kit, changes);
|
||||
EnvironmentKitAspect::setEnvironmentChanges(kit(), changes);
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -162,6 +162,7 @@ protected:
|
||||
};
|
||||
void setListAspectSpec(ListAspectSpec &&listAspectSpec);
|
||||
|
||||
private:
|
||||
Kit *m_kit;
|
||||
const KitAspectFactory *m_factory;
|
||||
QAction *m_mutableAction = nullptr;
|
||||
|
@@ -163,7 +163,7 @@ private:
|
||||
|
||||
Id currentBundleId;
|
||||
for (const Id lang : lc) {
|
||||
if (Toolchain * const currentTc = ToolchainKitAspect::toolchain(m_kit, lang)) {
|
||||
if (Toolchain * const currentTc = ToolchainKitAspect::toolchain(kit(), lang)) {
|
||||
currentBundleId = currentTc->bundleId();
|
||||
break;
|
||||
}
|
||||
@@ -196,9 +196,9 @@ private:
|
||||
return tc->language() == lang;
|
||||
});
|
||||
if (tc)
|
||||
ToolchainKitAspect::setToolchain(m_kit, tc);
|
||||
ToolchainKitAspect::setToolchain(kit(), tc);
|
||||
else
|
||||
ToolchainKitAspect::clearToolchain(m_kit, lang);
|
||||
ToolchainKitAspect::clearToolchain(kit(), lang);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,7 @@ public:
|
||||
if (m_ignoreChanges.isLocked())
|
||||
return;
|
||||
|
||||
PythonKitAspect::setPython(m_kit, m_comboBox->currentData().toString());
|
||||
PythonKitAspect::setPython(this->kit(), m_comboBox->currentData().toString());
|
||||
});
|
||||
connect(PythonSettings::instance(),
|
||||
&PythonSettings::interpretersChanged,
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
for (const Interpreter &interpreter : PythonSettings::interpreters())
|
||||
m_comboBox->addItem(interpreter.name, interpreter.id);
|
||||
|
||||
updateComboBox(PythonKitAspect::python(m_kit));
|
||||
updateComboBox(PythonKitAspect::python(kit()));
|
||||
emit changed(); // we need to emit changed here to update changes in the macro expander
|
||||
}
|
||||
|
||||
|
@@ -50,13 +50,13 @@ private:
|
||||
void refresh() override
|
||||
{
|
||||
if (!m_ignoreChanges.isLocked())
|
||||
m_lineEdit->setText(QDir::toNativeSeparators(QmakeKitAspect::mkspec(m_kit)));
|
||||
m_lineEdit->setText(QDir::toNativeSeparators(QmakeKitAspect::mkspec(kit())));
|
||||
}
|
||||
|
||||
void mkspecWasChanged(const QString &text)
|
||||
{
|
||||
const GuardLocker locker(m_ignoreChanges);
|
||||
QmakeKitAspect::setMkspec(m_kit, text, QmakeKitAspect::MkspecSource::User);
|
||||
QmakeKitAspect::setMkspec(kit(), text, QmakeKitAspect::MkspecSource::User);
|
||||
}
|
||||
|
||||
QLineEdit *m_lineEdit = nullptr;
|
||||
|
Reference in New Issue
Block a user