Don't access static functions/fields via instance

Courtesy of readability-static-accessed-through-instance

Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Alessandro Portale
2020-11-18 22:42:51 +01:00
parent 0c0347ce61
commit b2a766a79a
52 changed files with 126 additions and 119 deletions

View File

@@ -381,7 +381,7 @@ namespace ADS
void DockAreaTitleBar::onCloseButtonClicked() void DockAreaTitleBar::onCloseButtonClicked()
{ {
qCInfo(adsLog) << Q_FUNC_INFO; qCInfo(adsLog) << Q_FUNC_INFO;
if (d->testConfigFlag(DockManager::DockAreaCloseButtonClosesTab)) if (DockAreaTitleBarPrivate::testConfigFlag(DockManager::DockAreaCloseButtonClosesTab))
d->m_tabBar->closeTab(d->m_tabBar->currentIndex()); d->m_tabBar->closeTab(d->m_tabBar->currentIndex());
else else
d->m_dockArea->closeArea(); d->m_dockArea->closeArea();
@@ -432,7 +432,7 @@ namespace ADS
if (index < 0) if (index < 0)
return; return;
if (d->testConfigFlag(DockManager::DockAreaCloseButtonClosesTab)) { if (DockAreaTitleBarPrivate::testConfigFlag(DockManager::DockAreaCloseButtonClosesTab)) {
DockWidget *dockWidget = d->m_tabBar->tab(index)->dockWidget(); DockWidget *dockWidget = d->m_tabBar->tab(index)->dockWidget();
d->m_closeButton->setEnabled( d->m_closeButton->setEnabled(
dockWidget->features().testFlag(DockWidget::DockWidgetClosable)); dockWidget->features().testFlag(DockWidget::DockWidgetClosable));

View File

@@ -2029,7 +2029,7 @@ void Preprocessor::handleIfDefDirective(bool checkUndefined, PPToken *tk)
value = false; // take the branch value = false; // take the branch
} }
} }
} else if (m_env->isBuiltinMacro(macroName)) { } else if (Environment::isBuiltinMacro(macroName)) {
value = true; value = true;
} }

View File

@@ -111,7 +111,7 @@ bool ClassMembersEdit::Cursor::skip(const QString &s)
{ {
skipWhitespaces(); skipWhitespaces();
if (m_isValid && m_pos + s.length() <= m_text.length() if (m_isValid && m_pos + s.length() <= m_text.length()
&& s.compare(m_text.mid(m_pos, s.length()), s, Qt::CaseInsensitive) == 0) { && s.compare(m_text.mid(m_pos, s.length()), Qt::CaseInsensitive) == 0) {
m_pos += s.length(); m_pos += s.length();
return true; return true;
} }
@@ -127,7 +127,7 @@ QString ClassMembersEdit::Cursor::readUntil(const QString &delimiter)
return s; return s;
} }
if (m_pos + delimiter.length() <= m_text.length() if (m_pos + delimiter.length() <= m_text.length()
&& s.compare(m_text.mid(m_pos, delimiter.length()), delimiter, Qt::CaseInsensitive) == 0) { && delimiter.compare(m_text.mid(m_pos, delimiter.length()), Qt::CaseInsensitive) == 0) {
m_pos += delimiter.length(); m_pos += delimiter.length();
return s; return s;
} }
@@ -156,7 +156,7 @@ void ClassMembersEdit::Cursor::skipUntilOrNewline(const QString &delimiter)
if (m_text.at(m_pos) == '\n') if (m_text.at(m_pos) == '\n')
return; return;
if (m_pos + delimiter.length() <= m_text.length() if (m_pos + delimiter.length() <= m_text.length()
&& QString::compare(m_text.mid(m_pos, delimiter.length()), delimiter, Qt::CaseInsensitive) == 0) { && delimiter.compare(m_text.mid(m_pos, delimiter.length()), Qt::CaseInsensitive) == 0) {
m_pos += delimiter.length(); m_pos += delimiter.length();
return; return;
} }
@@ -201,7 +201,7 @@ bool ClassMembersEdit::Cursor::skipFromRight(const QString &s)
{ {
skipWhitespacesFromRight(); skipWhitespacesFromRight();
if (m_isValid && m_pos - s.length() >= 0 if (m_isValid && m_pos - s.length() >= 0
&& s.compare(m_text.mid(m_pos - s.length() + 1, s.length()), s, Qt::CaseInsensitive) == 0) { && s.compare(m_text.mid(m_pos - s.length() + 1, s.length()), Qt::CaseInsensitive) == 0) {
m_pos -= s.length(); m_pos -= s.length();
return true; return true;
} }

View File

@@ -650,7 +650,7 @@ static inline AbstractSymbolGroupNodePtrVector
static inline AbstractSymbolGroupNodePtrVector static inline AbstractSymbolGroupNodePtrVector
stdHashChildList(const SymbolGroupValue &set, unsigned count) stdHashChildList(const SymbolGroupValue &set, unsigned count)
{ {
SymbolGroupValue list = set.findMember(set, "_List"); const SymbolGroupValue list = SymbolGroupValue::findMember(set, "_List");
return stdListChildList(list.node(), count, list.context()); return stdListChildList(list.node(), count, list.context());
} }

View File

@@ -697,7 +697,7 @@ static bool diffWithWhitespaceExpandedInEqualities(const QList<Diff> &leftInput,
} }
Differ differ; Differ differ;
const QList<Diff> &diffList = differ.cleanupSemantics( const QList<Diff> &diffList = Differ::cleanupSemantics(
differ.diff(leftText, rightText)); differ.diff(leftText, rightText));
QList<Diff> leftDiffList; QList<Diff> leftDiffList;
@@ -882,7 +882,7 @@ void Differ::diffBetweenEqualities(const QList<Diff> &leftInput,
&& previousRightDiff.command == Diff::Insert) { && previousRightDiff.command == Diff::Insert) {
Differ differ; Differ differ;
differ.setDiffMode(Differ::CharMode); differ.setDiffMode(Differ::CharMode);
const QList<Diff> commonOutput = differ.cleanupSemantics( const QList<Diff> commonOutput = cleanupSemantics(
differ.diff(previousLeftDiff.text, previousRightDiff.text)); differ.diff(previousLeftDiff.text, previousRightDiff.text));
QList<Diff> outputLeftDiffList; QList<Diff> outputLeftDiffList;

View File

@@ -1042,10 +1042,10 @@ void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
m_instance->m_config = devConfigs; m_instance->m_config = devConfigs;
m_instance->save(); m_instance->save();
m_instance->updateAndroidDevice(); updateAndroidDevice();
m_instance->registerNewToolChains(); registerNewToolChains();
m_instance->updateAutomaticKitList(); updateAutomaticKitList();
m_instance->removeOldToolChains(); removeOldToolChains();
emit m_instance->updated(); emit m_instance->updated();
} }

View File

@@ -154,7 +154,7 @@ AutotestPluginPrivate::AutotestPluginPrivate()
}); });
ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory); ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory);
m_frameworkManager.activateFrameworksFromSettings(&m_settings); TestFrameworkManager::activateFrameworksFromSettings(&m_settings);
m_testTreeModel.synchronizeTestFrameworks(); m_testTreeModel.synchronizeTestFrameworks();
auto sessionManager = ProjectExplorer::SessionManager::instance(); auto sessionManager = ProjectExplorer::SessionManager::instance();

View File

@@ -364,7 +364,7 @@ bool BoostCodeParser::isBoostBindCall(const QByteArray &function)
for (const LookupItem &item : lookupItems) { for (const LookupItem &item : lookupItems) {
if (Symbol *symbol = item.declaration()) { if (Symbol *symbol = item.declaration()) {
const QString fullQualified = overview.prettyName( const QString fullQualified = overview.prettyName(
m_lookupContext.fullyQualifiedName(symbol->enclosingNamespace())); LookupContext::fullyQualifiedName(symbol->enclosingNamespace()));
if (fullQualified == "boost") if (fullQualified == "boost")
return true; return true;
} }
@@ -382,7 +382,7 @@ bool BoostCodeParser::aliasedOrRealNamespace(const QByteArray &symbolName,
for (const LookupItem &it : lookup) { for (const LookupItem &it : lookup) {
if (auto classOrNamespaceSymbol = it.declaration()) { if (auto classOrNamespaceSymbol = it.declaration()) {
const QString fullQualified = overview.prettyName( const QString fullQualified = overview.prettyName(
m_lookupContext.fullyQualifiedName(classOrNamespaceSymbol)); LookupContext::fullyQualifiedName(classOrNamespaceSymbol));
if (fullQualified == origNamespace) { if (fullQualified == origNamespace) {
*aliasedOrReal = true; *aliasedOrReal = true;
if (simplifiedName) if (simplifiedName)

View File

@@ -48,8 +48,8 @@ bool GTestVisitor::visit(CPlusPlus::FunctionDefinitionAST *ast)
if (!id || !ast->symbol || ast->symbol->argumentCount() != 2) if (!id || !ast->symbol || ast->symbol->argumentCount() != 2)
return false; return false;
CPlusPlus::LookupContext lc; QString prettyName =
QString prettyName = m_overview.prettyName(lc.fullyQualifiedName(ast->symbol)); m_overview.prettyName(CPlusPlus::LookupContext::fullyQualifiedName(ast->symbol));
// get surrounding namespace(s) and strip them out // get surrounding namespace(s) and strip them out
const QString namespaces = enclosingNamespaces(ast->symbol); const QString namespaces = enclosingNamespaces(ast->symbol);

View File

@@ -57,7 +57,8 @@ bool TestVisitor::visit(Class *symbol)
Symbol *member = symbol->memberAt(i); Symbol *member = symbol->memberAt(i);
Type *type = member->type().type(); Type *type = member->type().type();
const QString className = o.prettyName(lc.fullyQualifiedName(member->enclosingClass())); const QString className = o.prettyName(CPlusPlus::LookupContext::fullyQualifiedName(
member->enclosingClass()));
if (className != m_className) if (className != m_className)
continue; continue;
@@ -91,7 +92,7 @@ bool TestVisitor::visit(Class *symbol)
} }
for (int counter = 0, end = symbol->baseClassCount(); counter < end; ++counter) { for (int counter = 0, end = symbol->baseClassCount(); counter < end; ++counter) {
if (BaseClass *base = symbol->baseClassAt(counter)) { if (BaseClass *base = symbol->baseClassAt(counter)) {
const QString &baseClassName = o.prettyName(lc.fullyQualifiedName(base)); const QString &baseClassName = o.prettyName(CPlusPlus::LookupContext::fullyQualifiedName(base));
if (baseClassName != "QObject") if (baseClassName != "QObject")
m_baseClasses.insert(baseClassName); m_baseClasses.insert(baseClassName);
} }
@@ -179,7 +180,8 @@ bool TestDataFunctionVisitor::visit(FunctionDefinitionAST *ast)
return false; return false;
LookupContext lc; LookupContext lc;
const QString prettyName = m_overview.prettyName(lc.fullyQualifiedName(ast->symbol)); const QString prettyName =
m_overview.prettyName(CPlusPlus::LookupContext::fullyQualifiedName(ast->symbol));
// do not handle functions that aren't real test data functions // do not handle functions that aren't real test data functions
if (!prettyName.endsWith("_data")) if (!prettyName.endsWith("_data"))
return false; return false;

View File

@@ -149,7 +149,7 @@ QList<Document::Ptr> QuickTestParser::scanDirectoryForQuickTestQmlFiles(const QS
QFutureInterface<void> future; QFutureInterface<void> future;
PathsAndLanguages paths; PathsAndLanguages paths;
paths.maybeInsert(Utils::FilePath::fromString(srcDir), Dialect::Qml); paths.maybeInsert(Utils::FilePath::fromString(srcDir), Dialect::Qml);
ModelManagerInterface::importScan(future, qmlJsMM->workingCopy(), paths, qmlJsMM, ModelManagerInterface::importScan(future, ModelManagerInterface::workingCopy(), paths, qmlJsMM,
false /*emitDocumentChanges*/, false /*onlyTheLib*/, true /*forceRescan*/ ); false /*emitDocumentChanges*/, false /*onlyTheLib*/, true /*forceRescan*/ );
const Snapshot snapshot = QmlJSTools::Internal::ModelManager::instance()->snapshot(); const Snapshot snapshot = QmlJSTools::Internal::ModelManager::instance()->snapshot();
@@ -284,7 +284,8 @@ void QuickTestParser::handleDirectoryChanged(const QString &directory)
paths.maybeInsert(Utils::FilePath::fromString(directory), Dialect::Qml); paths.maybeInsert(Utils::FilePath::fromString(directory), Dialect::Qml);
QFutureInterface<void> future; QFutureInterface<void> future;
ModelManagerInterface *qmlJsMM = ModelManagerInterface::instance(); ModelManagerInterface *qmlJsMM = ModelManagerInterface::instance();
ModelManagerInterface::importScan(future, qmlJsMM->workingCopy(), paths, qmlJsMM, ModelManagerInterface::importScan(future, ModelManagerInterface::workingCopy(), paths,
qmlJsMM,
true /*emitDocumentChanges*/, true /*emitDocumentChanges*/,
false /*onlyTheLib*/, false /*onlyTheLib*/,
true /*forceRescan*/ ); true /*forceRescan*/ );

View File

@@ -751,8 +751,8 @@ void TestRunner::buildProject(Project *project)
buildManager, &BuildManager::cancel); buildManager, &BuildManager::cancel);
connect(buildManager, &BuildManager::buildQueueFinished, connect(buildManager, &BuildManager::buildQueueFinished,
this, &TestRunner::buildFinished); this, &TestRunner::buildFinished);
buildManager->buildProjectWithDependencies(project); BuildManager::buildProjectWithDependencies(project);
if (!buildManager->isBuilding()) if (!BuildManager::isBuilding())
buildFinished(false); buildFinished(false);
} }

View File

@@ -476,7 +476,7 @@ void CMakeBuildSettingsWidget::updateSelection()
for (const QModelIndex &index : selectedIndexes) { for (const QModelIndex &index : selectedIndexes) {
if (index.isValid() && index.flags().testFlag(Qt::ItemIsSelectable)) { if (index.isValid() && index.flags().testFlag(Qt::ItemIsSelectable)) {
ConfigModel::DataItem di = m_configModel->dataItemFromIndex(index); const ConfigModel::DataItem di = ConfigModel::dataItemFromIndex(index);
if (di.isUnset) if (di.isUnset)
setableCount++; setableCount++;
else else
@@ -498,7 +498,7 @@ void CMakeBuildSettingsWidget::setVariableUnsetFlag(bool unsetFlag)
bool unsetFlagToggled = false; bool unsetFlagToggled = false;
for (const QModelIndex &index : selectedIndexes) { for (const QModelIndex &index : selectedIndexes) {
if (index.isValid()) { if (index.isValid()) {
ConfigModel::DataItem di = m_configModel->dataItemFromIndex(index); const ConfigModel::DataItem di = ConfigModel::dataItemFromIndex(index);
if (di.isUnset != unsetFlag) { if (di.isUnset != unsetFlag) {
m_configModel->toggleUnsetFlag(mapToSource(m_configView, index)); m_configModel->toggleUnsetFlag(mapToSource(m_configView, index));
unsetFlagToggled = true; unsetFlagToggled = true;

View File

@@ -1068,8 +1068,8 @@ QList<ProjectExplorer::ExtraCompiler *> CMakeBuildSystem::findExtraCompilers()
// Find all files generated by any of the extra compilers, in a rather crude way. // Find all files generated by any of the extra compilers, in a rather crude way.
Project *p = project(); Project *p = project();
const FilePaths fileList = p->files([&fileExtensions, p](const Node *n) { const FilePaths fileList = p->files([&fileExtensions](const Node *n) {
if (!p->SourceFiles(n)) if (!Project::SourceFiles(n))
return false; return false;
const QString fp = n->filePath().toString(); const QString fp = n->filePath().toString();
const int pos = fp.lastIndexOf('.'); const int pos = fp.lastIndexOf('.');

View File

@@ -726,14 +726,14 @@ bool EditorManagerPrivate::skipOpeningBigTextFile(const QString &filePath)
if (!d->m_warnBeforeOpeningBigFilesEnabled) if (!d->m_warnBeforeOpeningBigFilesEnabled)
return false; return false;
const QFileInfo fileInfo(filePath); if (!QFileInfo::exists(filePath))
if (!fileInfo.exists(filePath))
return false; return false;
Utils::MimeType mimeType = Utils::mimeTypeForFile(filePath); Utils::MimeType mimeType = Utils::mimeTypeForFile(filePath);
if (!mimeType.inherits("text/plain")) if (!mimeType.inherits("text/plain"))
return false; return false;
const QFileInfo fileInfo(filePath);
const double fileSizeInMB = fileInfo.size() / 1000.0 / 1000.0; const double fileSizeInMB = fileInfo.size() / 1000.0 / 1000.0;
if (fileSizeInMB > d->m_bigFileSizeLimitInMB) { if (fileSizeInMB > d->m_bigFileSizeLimitInMB) {
const QString title = EditorManager::tr("Continue Opening Huge Text File?"); const QString title = EditorManager::tr("Continue Opening Huge Text File?");
@@ -754,7 +754,7 @@ bool EditorManagerPrivate::skipOpeningBigTextFile(const QString &filePath)
messageBox.setCheckBoxVisible(true); messageBox.setCheckBoxVisible(true);
messageBox.setCheckBoxText(CheckableMessageBox::msgDoNotAskAgain()); messageBox.setCheckBoxText(CheckableMessageBox::msgDoNotAskAgain());
messageBox.exec(); messageBox.exec();
d->setWarnBeforeOpeningBigFilesEnabled(!messageBox.isChecked()); setWarnBeforeOpeningBigFilesEnabled(!messageBox.isChecked());
return messageBox.clickedStandardButton() != QDialogButtonBox::Yes; return messageBox.clickedStandardButton() != QDialogButtonBox::Yes;
} }

View File

@@ -172,7 +172,7 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
m_replaceLabel->setBuddy(m_replaceTextEdit); m_replaceLabel->setBuddy(m_replaceTextEdit);
m_replaceTextEdit->setMinimumWidth(120); m_replaceTextEdit->setMinimumWidth(120);
m_replaceTextEdit->setEnabled(false); m_replaceTextEdit->setEnabled(false);
m_replaceTextEdit->setTabOrder(m_replaceTextEdit, m_searchResultTreeView); setTabOrder(m_replaceTextEdit, m_searchResultTreeView);
m_preserveCaseCheck = new QCheckBox(m_topReplaceWidget); m_preserveCaseCheck = new QCheckBox(m_topReplaceWidget);
m_preserveCaseCheck->setText(tr("Preser&ve case")); m_preserveCaseCheck->setText(tr("Preser&ve case"));
m_preserveCaseCheck->setEnabled(false); m_preserveCaseCheck->setEnabled(false);

View File

@@ -620,7 +620,8 @@ void SearchResultWindow::readSettings()
{ {
QSettings *s = ICore::settings(); QSettings *s = ICore::settings();
s->beginGroup(QLatin1String(SETTINGSKEYSECTIONNAME)); s->beginGroup(QLatin1String(SETTINGSKEYSECTIONNAME));
d->m_expandCollapseAction->setChecked(s->value(QLatin1String(SETTINGSKEYEXPANDRESULTS), d->m_initiallyExpand).toBool()); d->m_expandCollapseAction->setChecked(s->value(QLatin1String(SETTINGSKEYEXPANDRESULTS),
SearchResultWindowPrivate::m_initiallyExpand).toBool());
s->endGroup(); s->endGroup();
} }

View File

@@ -579,7 +579,7 @@ LocatorWidget::LocatorWidget(Locator *locator) :
m_fileLineEdit->setButtonMenu(Utils::FancyLineEdit::Left, m_filterMenu); m_fileLineEdit->setButtonMenu(Utils::FancyLineEdit::Left, m_filterMenu);
connect(m_refreshAction, &QAction::triggered, locator, [locator]() { connect(m_refreshAction, &QAction::triggered, locator, [locator]() {
locator->refresh(locator->filters()); locator->refresh(Locator::filters());
}); });
connect(m_configureAction, &QAction::triggered, this, &LocatorWidget::showConfigureDialog); connect(m_configureAction, &QAction::triggered, this, &LocatorWidget::showConfigureDialog);
connect(m_fileLineEdit, &QLineEdit::textChanged, connect(m_fileLineEdit, &QLineEdit::textChanged,

View File

@@ -308,7 +308,7 @@ void MainWindow::extensionsInitialized()
m_windowSupport = new WindowSupport(this, Context("Core.MainWindow")); m_windowSupport = new WindowSupport(this, Context("Core.MainWindow"));
m_windowSupport->setCloseActionEnabled(false); m_windowSupport->setCloseActionEnabled(false);
OutputPaneManager::create(); OutputPaneManager::create();
m_vcsManager->extensionsInitialized(); VcsManager::extensionsInitialized();
m_leftNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories()); m_leftNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories());
m_rightNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories()); m_rightNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories());

View File

@@ -206,9 +206,9 @@ NavigationWidget::NavigationWidget(QAction *toggleSideBarAction, Side side) :
setOrientation(Qt::Vertical); setOrientation(Qt::Vertical);
if (side == Side::Left) if (side == Side::Left)
d->s_instanceLeft = this; NavigationWidgetPrivate::s_instanceLeft = this;
else else
d->s_instanceRight = this; NavigationWidgetPrivate::s_instanceRight = this;
} }
NavigationWidget::~NavigationWidget() NavigationWidget::~NavigationWidget()

View File

@@ -75,7 +75,7 @@ OutputPanePlaceHolder::OutputPanePlaceHolder(Id mode, QSplitter *parent)
OutputPanePlaceHolder::~OutputPanePlaceHolder() OutputPanePlaceHolder::~OutputPanePlaceHolder()
{ {
if (d->m_current == this) { if (OutputPanePlaceHolderPrivate::m_current == this) {
if (Internal::OutputPaneManager *om = Internal::OutputPaneManager::instance()) { if (Internal::OutputPaneManager *om = Internal::OutputPaneManager::instance()) {
om->setParent(nullptr); om->setParent(nullptr);
om->hide(); om->hide();
@@ -87,8 +87,8 @@ OutputPanePlaceHolder::~OutputPanePlaceHolder()
void OutputPanePlaceHolder::currentModeChanged(Id mode) void OutputPanePlaceHolder::currentModeChanged(Id mode)
{ {
if (d->m_current == this) { if (OutputPanePlaceHolderPrivate::m_current == this) {
d->m_current = nullptr; OutputPanePlaceHolderPrivate::m_current = nullptr;
if (d->m_initialized) if (d->m_initialized)
Internal::OutputPaneManager::setOutputPaneHeightSetting(d->m_nonMaximizedSize); Internal::OutputPaneManager::setOutputPaneHeightSetting(d->m_nonMaximizedSize);
Internal::OutputPaneManager *om = Internal::OutputPaneManager::instance(); Internal::OutputPaneManager *om = Internal::OutputPaneManager::instance();
@@ -97,9 +97,9 @@ void OutputPanePlaceHolder::currentModeChanged(Id mode)
om->updateStatusButtons(false); om->updateStatusButtons(false);
} }
if (d->m_mode == mode) { if (d->m_mode == mode) {
if (d->m_current && d->m_current->d->m_initialized) if (OutputPanePlaceHolderPrivate::m_current && OutputPanePlaceHolderPrivate::m_current->d->m_initialized)
Internal::OutputPaneManager::setOutputPaneHeightSetting(d->m_current->d->m_nonMaximizedSize); Internal::OutputPaneManager::setOutputPaneHeightSetting(OutputPanePlaceHolderPrivate::m_current->d->m_nonMaximizedSize);
d->m_current = this; Core::OutputPanePlaceHolderPrivate::m_current = this;
Internal::OutputPaneManager *om = Internal::OutputPaneManager::instance(); Internal::OutputPaneManager *om = Internal::OutputPaneManager::instance();
layout()->addWidget(om); layout()->addWidget(om);
om->show(); om->show();
@@ -119,7 +119,7 @@ void OutputPanePlaceHolder::setMaximized(bool maximize)
return; return;
d->m_isMaximized = maximize; d->m_isMaximized = maximize;
if (d->m_current == this) if (OutputPanePlaceHolderPrivate::m_current == this)
Internal::OutputPaneManager::updateMaximizeButton(d->m_isMaximized); Internal::OutputPaneManager::updateMaximizeButton(d->m_isMaximized);
QList<int> sizes = d->m_splitter->sizes(); QList<int> sizes = d->m_splitter->sizes();

View File

@@ -175,7 +175,7 @@ void BuiltinEditorDocumentParser::updateImpl(const QFutureInterface<void> &futur
// Update the snapshot // Update the snapshot
if (invalidateSnapshot) { if (invalidateSnapshot) {
const QString configurationFileName = modelManager->configurationFileName(); const QString configurationFileName = CppModelManager::configurationFileName();
if (invalidateConfig) if (invalidateConfig)
state.snapshot.remove(configurationFileName); state.snapshot.remove(configurationFileName);
if (!state.snapshot.contains(configurationFileName)) if (!state.snapshot.contains(configurationFileName))

View File

@@ -804,7 +804,7 @@ const Name *minimalName(Symbol *symbol, Scope *targetScope, const LookupContext
ClassOrNamespace *target = context.lookupType(targetScope); ClassOrNamespace *target = context.lookupType(targetScope);
if (!target) if (!target)
target = context.globalNamespace(); target = context.globalNamespace();
return context.minimalName(symbol, target, context.bindings()->control().data()); return LookupContext::minimalName(symbol, target, context.bindings()->control().data());
} }
} // Anonymous } // Anonymous

View File

@@ -333,7 +333,7 @@ void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol,
CPlusPlus::Overview overview; CPlusPlus::Overview overview;
SearchResult *search = SearchResultWindow::instance()->startNewSearch(tr("C++ Usages:"), SearchResult *search = SearchResultWindow::instance()->startNewSearch(tr("C++ Usages:"),
QString(), QString(),
overview.prettyName(context.fullyQualifiedName(symbol)), overview.prettyName(CPlusPlus::LookupContext::fullyQualifiedName(symbol)),
replace ? SearchResultWindow::SearchAndReplace replace ? SearchResultWindow::SearchAndReplace
: SearchResultWindow::SearchOnly, : SearchResultWindow::SearchOnly,
SearchResultWindow::PreserveCaseDisabled, SearchResultWindow::PreserveCaseDisabled,
@@ -352,7 +352,8 @@ void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol,
if (symbol->isClass() || symbol->isForwardClassDeclaration()) { if (symbol->isClass() || symbol->isForwardClassDeclaration()) {
CPlusPlus::Overview overview; CPlusPlus::Overview overview;
parameters.prettySymbolName = overview.prettyName(context.path(symbol).constLast()); parameters.prettySymbolName =
overview.prettyName(CPlusPlus::LookupContext::path(symbol).constLast());
} }
search->setUserData(QVariant::fromValue(parameters)); search->setUserData(QVariant::fromValue(parameters));

View File

@@ -131,7 +131,7 @@ Utils::FilePath CppToolsPlugin::licenseTemplatePath()
QString CppToolsPlugin::licenseTemplate() QString CppToolsPlugin::licenseTemplate()
{ {
return m_instance->d->m_fileSettings.licenseTemplate(); return CppFileSettings::licenseTemplate();
} }
bool CppToolsPlugin::usePragmaOnce() bool CppToolsPlugin::usePragmaOnce()

View File

@@ -486,7 +486,7 @@ public:
auto editorAndFindWidget = new QWidget; auto editorAndFindWidget = new QWidget;
editorAndFindWidget->setLayout(editorHolderLayout); editorAndFindWidget->setLayout(editorHolderLayout);
editorHolderLayout->addWidget(mainWindow->centralWidgetStack()); editorHolderLayout->addWidget(DebuggerMainWindow::centralWidgetStack());
editorHolderLayout->addWidget(new FindToolBarPlaceHolder(editorAndFindWidget)); editorHolderLayout->addWidget(new FindToolBarPlaceHolder(editorAndFindWidget));
auto documentAndRightPane = new MiniSplitter; auto documentAndRightPane = new MiniSplitter;
@@ -517,7 +517,7 @@ public:
// Navigation and right-side window. // Navigation and right-side window.
auto splitter = new MiniSplitter; auto splitter = new MiniSplitter;
splitter->setFocusProxy(mainWindow->centralWidgetStack()); splitter->setFocusProxy(DebuggerMainWindow::centralWidgetStack());
splitter->addWidget(new NavigationWidgetPlaceHolder(MODE_DEBUG, Side::Left)); splitter->addWidget(new NavigationWidgetPlaceHolder(MODE_DEBUG, Side::Left));
splitter->addWidget(mainWindowSplitter); splitter->addWidget(mainWindowSplitter);
splitter->setStretchFactor(0, 0); splitter->setStretchFactor(0, 0);
@@ -833,7 +833,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
engineManagerView->setWindowTitle(tr("Running Debuggers")); engineManagerView->setWindowTitle(tr("Running Debuggers"));
engineManagerView->setSettings(ICore::settings(), "Debugger.SnapshotView"); engineManagerView->setSettings(ICore::settings(), "Debugger.SnapshotView");
engineManagerView->setIconSize(QSize(10, 10)); engineManagerView->setIconSize(QSize(10, 10));
engineManagerView->setModel(m_engineManager.model()); engineManagerView->setModel(EngineManager::model());
engineManagerView->setSelectionMode(QAbstractItemView::SingleSelection); engineManagerView->setSelectionMode(QAbstractItemView::SingleSelection);
engineManagerView->enableColumnHiding(); engineManagerView->enableColumnHiding();

View File

@@ -2136,7 +2136,7 @@ void QmlEnginePrivate::handleFrame(const QVariantMap &response)
// Send watchers list // Send watchers list
if (stackHandler->isContentsValid() && stackHandler->currentFrame().isUsable()) { if (stackHandler->isContentsValid() && stackHandler->currentFrame().isUsable()) {
const QStringList watchers = watchHandler->watchedExpressions(); const QStringList watchers = WatchHandler::watchedExpressions();
for (const QString &exp : watchers) { for (const QString &exp : watchers) {
const QString iname = watchHandler->watcherName(exp); const QString iname = watchHandler->watcherName(exp);
evaluate(exp, -1, [this, iname, exp](const QVariantMap &response) { evaluate(exp, -1, [this, iname, exp](const QVariantMap &response) {

View File

@@ -1672,7 +1672,7 @@ bool WatchModel::contextMenuEvent(const ItemViewEvent &ev)
[this, item] { removeWatchItem(item); }); [this, item] { removeWatchItem(item); });
addAction(menu, tr("Remove All Expression Evaluators"), addAction(menu, tr("Remove All Expression Evaluators"),
canRemoveWatches && !m_handler->watchedExpressions().isEmpty(), canRemoveWatches && !WatchHandler::watchedExpressions().isEmpty(),
[this] { clearWatches(); }); [this] { clearWatches(); });
addAction(menu, tr("Select Widget to Add into Expression Evaluator"), addAction(menu, tr("Select Widget to Add into Expression Evaluator"),

View File

@@ -88,7 +88,7 @@ public:
FileData fileData; FileData fileData;
if (!reloadInfo.binaryFiles) { if (!reloadInfo.binaryFiles) {
const QList<Diff> diffList = differ.cleanupSemantics( const QList<Diff> diffList = Differ::cleanupSemantics(
differ.diff(reloadInfo.leftText, reloadInfo.rightText)); differ.diff(reloadInfo.leftText, reloadInfo.rightText));
QList<Diff> leftDiffList; QList<Diff> leftDiffList;

View File

@@ -154,7 +154,7 @@ void HelpManager::unregisterDocumentation(const QStringList &fileNames)
const auto getNamespaces = [](const QStringList &fileNames) { const auto getNamespaces = [](const QStringList &fileNames) {
QMutexLocker locker(&d->m_helpengineMutex); QMutexLocker locker(&d->m_helpengineMutex);
return Utils::transform(fileNames, [](const QString &filePath) { return Utils::transform(fileNames, [](const QString &filePath) {
return d->m_helpEngine->namespaceName(filePath); return QHelpEngineCore::namespaceName(filePath);
}); });
}; };
unregisterNamespaces(getNamespaces(fileNames)); unregisterNamespaces(getNamespaces(fileNames));
@@ -179,7 +179,7 @@ void HelpManager::registerDocumentationNow(QFutureInterface<bool> &futureInterfa
if (futureInterface.isCanceled()) if (futureInterface.isCanceled())
break; break;
futureInterface.setProgressValue(futureInterface.progressValue() + 1); futureInterface.setProgressValue(futureInterface.progressValue() + 1);
const QString &nameSpace = helpEngine.namespaceName(file); const QString &nameSpace = QHelpEngineCore::namespaceName(file);
if (nameSpace.isEmpty()) if (nameSpace.isEmpty())
continue; continue;
if (!nameSpaces.contains(nameSpace)) { if (!nameSpaces.contains(nameSpace)) {
@@ -294,7 +294,7 @@ QStringList HelpManager::registeredNamespaces()
QString HelpManager::namespaceFromFile(const QString &file) QString HelpManager::namespaceFromFile(const QString &file)
{ {
QTC_ASSERT(!d->m_needsSetup, return {}); QTC_ASSERT(!d->m_needsSetup, return {});
return d->m_helpEngine->namespaceName(file); return QHelpEngineCore::namespaceName(file);
} }
QString HelpManager::fileFromNamespace(const QString &nameSpace) QString HelpManager::fileFromNamespace(const QString &nameSpace)

View File

@@ -128,7 +128,7 @@ MacroManagerPrivate::MacroManagerPrivate(MacroManager *qq):
void MacroManagerPrivate::initialize() void MacroManagerPrivate::initialize()
{ {
macros.clear(); macros.clear();
QDir dir(q->macrosDirectory()); const QDir dir(MacroManager::macrosDirectory());
QStringList filter; QStringList filter;
filter << QLatin1String("*.") + QLatin1String(Constants::M_EXTENSION); filter << QLatin1String("*.") + QLatin1String(Constants::M_EXTENSION);
QStringList files = dir.entryList(filter, QDir::Files); QStringList files = dir.entryList(filter, QDir::Files);
@@ -231,8 +231,8 @@ void MacroManagerPrivate::showSaveDialog()
return; return;
// Save in the resource path // Save in the resource path
QString fileName = q->macrosDirectory() + QLatin1Char('/') + dialog.name() const QString fileName = MacroManager::macrosDirectory() + QLatin1Char('/') + dialog.name()
+ QLatin1Char('.') + QLatin1String(Constants::M_EXTENSION); + QLatin1Char('.') + QLatin1String(Constants::M_EXTENSION);
currentMacro->setDescription(dialog.description()); currentMacro->setDescription(dialog.description());
currentMacro->save(fileName, Core::ICore::dialogParent()); currentMacro->save(fileName, Core::ICore::dialogParent());
addMacro(currentMacro); addMacro(currentMacro);

View File

@@ -222,7 +222,7 @@ void ModelEditor::init()
d->leftToolBox = new QToolBox(d->leftGroup); d->leftToolBox = new QToolBox(d->leftGroup);
// Windows style does not truncate the tab label to a very small width (GTK+ does) // Windows style does not truncate the tab label to a very small width (GTK+ does)
static QStyle *windowsStyle = QStyleFactory().create("Windows"); static QStyle *windowsStyle = QStyleFactory::create("Windows");
if (windowsStyle) if (windowsStyle)
d->leftToolBox->setStyle(windowsStyle); d->leftToolBox->setStyle(windowsStyle);
// TODO improve this (and the diagram colors) for use with dark theme // TODO improve this (and the diagram colors) for use with dark theme

View File

@@ -1258,8 +1258,8 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const QString &workin
if (flags & StdErrToWindow) { if (flags & StdErrToWindow) {
process.setStdErrBufferedSignalsEnabled(true); process.setStdErrBufferedSignalsEnabled(true);
connect(&process, &SynchronousProcess::stdErrBuffered, connect(&process, &SynchronousProcess::stdErrBuffered,
outputWindow, [outputWindow](const QString &lines) { outputWindow, [](const QString &lines) {
outputWindow->append(lines); VcsOutputWindow::append(lines);
}); });
} }
@@ -1271,8 +1271,8 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const QString &workin
outputWindow, &VcsOutputWindow::appendSilently); outputWindow, &VcsOutputWindow::appendSilently);
} else { } else {
connect(&process, &SynchronousProcess::stdOutBuffered, connect(&process, &SynchronousProcess::stdOutBuffered,
outputWindow, [outputWindow](const QString &lines) { outputWindow, [](const QString &lines) {
outputWindow->append(lines); VcsOutputWindow::append(lines);
}); });
} }
} }

View File

@@ -281,7 +281,7 @@ QWidget *SettingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
QComboBox *editor = new QComboBox(parent); QComboBox *editor = new QComboBox(parent);
for (int i = PerfConfigEventsModel::SubTypeEventTypeHardware; for (int i = PerfConfigEventsModel::SubTypeEventTypeHardware;
i < PerfConfigEventsModel::SubTypeEventTypeSoftware; ++i) { i < PerfConfigEventsModel::SubTypeEventTypeSoftware; ++i) {
editor->addItem(model->subTypeString(PerfConfigEventsModel::EventTypeHardware, editor->addItem(PerfConfigEventsModel::subTypeString(PerfConfigEventsModel::EventTypeHardware,
PerfConfigEventsModel::SubType(i)), i); PerfConfigEventsModel::SubType(i)), i);
} }
return editor; return editor;
@@ -290,7 +290,7 @@ QWidget *SettingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
QComboBox *editor = new QComboBox(parent); QComboBox *editor = new QComboBox(parent);
for (int i = PerfConfigEventsModel::SubTypeEventTypeSoftware; for (int i = PerfConfigEventsModel::SubTypeEventTypeSoftware;
i < PerfConfigEventsModel::SubTypeEventTypeCache; ++i) { i < PerfConfigEventsModel::SubTypeEventTypeCache; ++i) {
editor->addItem(model->subTypeString(PerfConfigEventsModel::EventTypeSoftware, editor->addItem(PerfConfigEventsModel::subTypeString(PerfConfigEventsModel::EventTypeSoftware,
PerfConfigEventsModel::SubType(i)), i); PerfConfigEventsModel::SubType(i)), i);
} }
return editor; return editor;
@@ -299,7 +299,7 @@ QWidget *SettingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
QComboBox *editor = new QComboBox(parent); QComboBox *editor = new QComboBox(parent);
for (int i = PerfConfigEventsModel::SubTypeEventTypeCache; for (int i = PerfConfigEventsModel::SubTypeEventTypeCache;
i < PerfConfigEventsModel::SubTypeInvalid; ++i) { i < PerfConfigEventsModel::SubTypeInvalid; ++i) {
editor->addItem(model->subTypeString(PerfConfigEventsModel::EventTypeCache, editor->addItem(PerfConfigEventsModel::subTypeString(PerfConfigEventsModel::EventTypeCache,
PerfConfigEventsModel::SubType(i)), i); PerfConfigEventsModel::SubType(i)), i);
} }
return editor; return editor;

View File

@@ -476,7 +476,7 @@ void BuildManager::updateTaskCount()
void BuildManager::finish() void BuildManager::finish()
{ {
const QString elapsedTime = Utils::formatElapsedTime(d->m_elapsed.elapsed()); const QString elapsedTime = Utils::formatElapsedTime(d->m_elapsed.elapsed());
m_instance->addToOutputWindow(elapsedTime, BuildStep::OutputFormat::NormalMessage); addToOutputWindow(elapsedTime, BuildStep::OutputFormat::NormalMessage);
d->m_outputWindow->flush(); d->m_outputWindow->flush();
QApplication::alert(ICore::dialogParent(), 3000); QApplication::alert(ICore::dialogParent(), 3000);
@@ -484,7 +484,7 @@ void BuildManager::finish()
void BuildManager::emitCancelMessage() void BuildManager::emitCancelMessage()
{ {
m_instance->addToOutputWindow(tr("Canceled build/deployment."), BuildStep::OutputFormat::ErrorMessage); addToOutputWindow(tr("Canceled build/deployment."), BuildStep::OutputFormat::ErrorMessage);
} }
void BuildManager::clearBuildQueue() void BuildManager::clearBuildQueue()

View File

@@ -295,7 +295,7 @@ void BuildSettingsWidget::cloneConfiguration()
if (name.isEmpty()) if (name.isEmpty())
return; return;
BuildConfiguration *bc = factory->clone(m_target, m_buildConfiguration); BuildConfiguration *bc = BuildConfigurationFactory::clone(m_target, m_buildConfiguration);
if (!bc) if (!bc)
return; return;

View File

@@ -681,7 +681,7 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
m_summaryLabel->setContentsMargins(3, 3, 3, 3); m_summaryLabel->setContentsMargins(3, 3, 3, 3);
m_summaryLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop); m_summaryLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
QPalette pal = m_summaryLabel->palette(); QPalette pal = m_summaryLabel->palette();
pal.setColor(QPalette::Window, Utils::StyleHelper().baseColor()); pal.setColor(QPalette::Window, StyleHelper::baseColor());
m_summaryLabel->setPalette(pal); m_summaryLabel->setPalette(pal);
m_summaryLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); m_summaryLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
m_summaryLabel->setTextInteractionFlags(m_summaryLabel->textInteractionFlags() | Qt::LinksAccessibleByMouse); m_summaryLabel->setTextInteractionFlags(m_summaryLabel->textInteractionFlags() | Qt::LinksAccessibleByMouse);
@@ -1554,7 +1554,7 @@ void MiniProjectTargetSelector::updateSummary()
void MiniProjectTargetSelector::paintEvent(QPaintEvent *) void MiniProjectTargetSelector::paintEvent(QPaintEvent *)
{ {
QPainter painter(this); QPainter painter(this);
painter.fillRect(rect(), Utils::StyleHelper().baseColor()); painter.fillRect(rect(), StyleHelper::baseColor());
painter.setPen(creatorTheme()->color(Theme::MiniProjectTargetSelectorBorderColor)); painter.setPen(creatorTheme()->color(Theme::MiniProjectTargetSelectorBorderColor));
// draw border on top and right // draw border on top and right
QRectF borderRect = QRectF(rect()).adjusted(0.5, 0.5, -0.5, -0.5); QRectF borderRect = QRectF(rect()).adjusted(0.5, 0.5, -0.5, -0.5);

View File

@@ -1678,11 +1678,11 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
BuildManager::cleanProjects(SessionManager::projectOrder(), ConfigSelection::All); BuildManager::cleanProjects(SessionManager::projectOrder(), ConfigSelection::All);
}); });
connect(dd->m_runAction, &QAction::triggered, connect(dd->m_runAction, &QAction::triggered,
dd, []() { m_instance->runStartupProject(Constants::NORMAL_RUN_MODE); }); dd, []() { runStartupProject(Constants::NORMAL_RUN_MODE); });
connect(dd->m_runActionContextMenu, &QAction::triggered, connect(dd->m_runActionContextMenu, &QAction::triggered,
dd, &ProjectExplorerPluginPrivate::runProjectContextMenu); dd, &ProjectExplorerPluginPrivate::runProjectContextMenu);
connect(dd->m_runWithoutDeployAction, &QAction::triggered, connect(dd->m_runWithoutDeployAction, &QAction::triggered,
dd, []() { m_instance->runStartupProject(Constants::NORMAL_RUN_MODE, true); }); dd, []() { runStartupProject(Constants::NORMAL_RUN_MODE, true); });
connect(dd->m_cancelBuildAction, &QAction::triggered, connect(dd->m_cancelBuildAction, &QAction::triggered,
BuildManager::instance(), &BuildManager::cancel); BuildManager::instance(), &BuildManager::cancel);
connect(dd->m_unloadAction, &QAction::triggered, connect(dd->m_unloadAction, &QAction::triggered,
@@ -2716,7 +2716,8 @@ void ProjectExplorerPluginPrivate::runProjectContextMenu()
const Node *node = ProjectTree::currentNode(); const Node *node = ProjectTree::currentNode();
const ProjectNode *projectNode = node ? node->asProjectNode() : nullptr; const ProjectNode *projectNode = node ? node->asProjectNode() : nullptr;
if (projectNode == ProjectTree::currentProject()->rootProjectNode() || !projectNode) { if (projectNode == ProjectTree::currentProject()->rootProjectNode() || !projectNode) {
m_instance->runProject(ProjectTree::currentProject(), Constants::NORMAL_RUN_MODE); ProjectExplorerPlugin::runProject(ProjectTree::currentProject(),
Constants::NORMAL_RUN_MODE);
} else { } else {
auto act = qobject_cast<QAction *>(sender()); auto act = qobject_cast<QAction *>(sender());
if (!act) if (!act)
@@ -2724,7 +2725,7 @@ void ProjectExplorerPluginPrivate::runProjectContextMenu()
auto *rc = act->data().value<RunConfiguration *>(); auto *rc = act->data().value<RunConfiguration *>();
if (!rc) if (!rc)
return; return;
m_instance->runRunConfiguration(rc, Constants::NORMAL_RUN_MODE); ProjectExplorerPlugin::runRunConfiguration(rc, Constants::NORMAL_RUN_MODE);
} }
} }

View File

@@ -809,8 +809,8 @@ QSize TaskDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd
} else { } else {
s.setHeight(fontHeight + 3); s.setHeight(fontHeight + 3);
} }
if (s.height() < positions.minimumHeight()) if (s.height() < Positions::minimumHeight())
s.setHeight(positions.minimumHeight()); s.setHeight(Positions::minimumHeight());
if (!selected) { if (!selected) {
m_cachedHeight = s.height(); m_cachedHeight = s.height();
@@ -877,7 +877,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
// Paint TaskIconArea: // Paint TaskIconArea:
QIcon icon = index.data(TaskModel::Icon).value<QIcon>(); QIcon icon = index.data(TaskModel::Icon).value<QIcon>();
painter->drawPixmap(positions.left(), positions.top(), painter->drawPixmap(positions.left(), positions.top(),
icon.pixmap(positions.taskIconWidth(), positions.taskIconHeight())); icon.pixmap(Positions::taskIconWidth(), Positions::taskIconHeight()));
// Paint TextArea: // Paint TextArea:
if (!selected) { if (!selected) {

View File

@@ -150,7 +150,7 @@ QString QbsProfileManager::ensureProfileForKit(const ProjectExplorer::Kit *k)
{ {
if (!k) if (!k)
return QString(); return QString();
m_instance->updateProfileIfNecessary(k); updateProfileIfNecessary(k);
return profileNameForKit(k); return profileNameForKit(k);
} }

View File

@@ -191,7 +191,7 @@ static void setId(const QModelIndex &index, const QString &newId)
if (modelNode.id() == newId) if (modelNode.id() == newId)
return; return;
if (!modelNode.isValidId(newId)) { if (!ModelNode::isValidId(newId)) {
Core::AsynchronousMessageBox::warning(NavigatorTreeView::tr("Invalid Id"), Core::AsynchronousMessageBox::warning(NavigatorTreeView::tr("Invalid Id"),
NavigatorTreeView::tr("%1 is an invalid id.").arg(newId)); NavigatorTreeView::tr("%1 is an invalid id.").arg(newId));
} else if (modelNode.view()->hasId(newId)) { } else if (modelNode.view()->hasId(newId)) {

View File

@@ -265,11 +265,11 @@ void DesignModeWidget::setup()
const QIcon tabsCloseIcon = Utils::StyleHelper::getIconFromIconFont(fontName, {closeIconNormal, closeIconFocused}); const QIcon tabsCloseIcon = Utils::StyleHelper::getIconFromIconFont(fontName, {closeIconNormal, closeIconFocused});
m_dockManager->iconProvider().registerCustomIcon(ADS::TabCloseIcon, tabsCloseIcon); ADS::DockManager::iconProvider().registerCustomIcon(ADS::TabCloseIcon, tabsCloseIcon);
m_dockManager->iconProvider().registerCustomIcon(ADS::DockAreaMenuIcon, menuIcon); ADS::DockManager::iconProvider().registerCustomIcon(ADS::DockAreaMenuIcon, menuIcon);
m_dockManager->iconProvider().registerCustomIcon(ADS::DockAreaUndockIcon, undockIcon); ADS::DockManager::iconProvider().registerCustomIcon(ADS::DockAreaUndockIcon, undockIcon);
m_dockManager->iconProvider().registerCustomIcon(ADS::DockAreaCloseIcon, closeIcon); ADS::DockManager::iconProvider().registerCustomIcon(ADS::DockAreaCloseIcon, closeIcon);
m_dockManager->iconProvider().registerCustomIcon(ADS::FloatingWidgetCloseIcon, closeIcon); ADS::DockManager::iconProvider().registerCustomIcon(ADS::FloatingWidgetCloseIcon, closeIcon);
// Setup Actions and Menus // Setup Actions and Menus
Core::ActionContainer *mview = Core::ActionManager::actionContainer(Core::Constants::M_VIEW); Core::ActionContainer *mview = Core::ActionManager::actionContainer(Core::Constants::M_VIEW);

View File

@@ -919,7 +919,7 @@ void FindReferences::findUsages(const QString &fileName, quint32 offset)
{ {
ModelManagerInterface *modelManager = ModelManagerInterface::instance(); ModelManagerInterface *modelManager = ModelManagerInterface::instance();
QFuture<Usage> result = Utils::runAsync(&find_helper, modelManager->workingCopy(), QFuture<Usage> result = Utils::runAsync(&find_helper, ModelManagerInterface::workingCopy(),
modelManager->snapshot(), fileName, offset, QString()); modelManager->snapshot(), fileName, offset, QString());
m_watcher.setFuture(result); m_watcher.setFuture(result);
} }
@@ -934,7 +934,7 @@ void FindReferences::renameUsages(const QString &fileName, quint32 offset,
if (newName.isNull()) if (newName.isNull())
newName = QLatin1String(""); newName = QLatin1String("");
QFuture<Usage> result = Utils::runAsync(&find_helper, modelManager->workingCopy(), QFuture<Usage> result = Utils::runAsync(&find_helper, ModelManagerInterface::workingCopy(),
modelManager->snapshot(), fileName, offset, newName); modelManager->snapshot(), fileName, offset, newName);
m_watcher.setFuture(result); m_watcher.setFuture(result);
} }

View File

@@ -658,7 +658,7 @@ QModelIndex QmlOutlineModel::enterFieldMemberExpression(AST::FieldMemberExpressi
objectData.insert(AnnotationRole, QString()); // clear possible former annotation objectData.insert(AnnotationRole, QString()); // clear possible former annotation
QmlOutlineItem *item = enterNode(objectData, expression, nullptr, QmlOutlineItem *item = enterNode(objectData, expression, nullptr,
m_icons->functionDeclarationIcon()); Icons::functionDeclarationIcon());
return item->index(); return item->index();
} }

View File

@@ -633,7 +633,8 @@ FilePath BaseQtVersion::mkspecsPath() const
{ {
const FilePath result = hostDataPath(); const FilePath result = hostDataPath();
if (result.isEmpty()) if (result.isEmpty())
return FilePath::fromUserInput(d->qmakeProperty(d->m_versionInfo, "QMAKE_MKSPECS")); return FilePath::fromUserInput(BaseQtVersionPrivate::qmakeProperty(
d->m_versionInfo, "QMAKE_MKSPECS"));
return result.pathAppended("mkspecs"); return result.pathAppended("mkspecs");
} }
@@ -952,7 +953,7 @@ FilePath BaseQtVersion::sourcePath() const
{ {
if (d->m_data.sourcePath.isEmpty()) { if (d->m_data.sourcePath.isEmpty()) {
d->updateVersionInfo(); d->updateVersionInfo();
d->m_data.sourcePath = d->sourcePath(d->m_versionInfo); d->m_data.sourcePath = BaseQtVersionPrivate::sourcePath(d->m_versionInfo);
} }
return d->m_data.sourcePath; return d->m_data.sourcePath;
} }

View File

@@ -158,7 +158,7 @@ bool AutoCompleter::isNextBlockIndented(const QTextBlock &currentBlock) const
if (block.next().isValid()) { // not the last block if (block.next().isValid()) { // not the last block
block = block.next(); block = block.next();
//skip all empty blocks //skip all empty blocks
while (block.isValid() && m_tabSettings.onlySpace(block.text())) while (block.isValid() && TabSettings::onlySpace(block.text()))
block = block.next(); block = block.next();
if (block.isValid() if (block.isValid()
&& m_tabSettings.indentationColumn(block.text()) > indentation) && m_tabSettings.indentationColumn(block.text()) > indentation)

View File

@@ -106,7 +106,7 @@ bool RefactoringChanges::createFile(const QString &fileName, const QString &cont
m_data->fileChanged(fileName); m_data->fileChanged(fileName);
if (openEditor) if (openEditor)
this->openEditor(fileName, /*bool activate =*/ false, -1, -1); RefactoringChanges::openEditor(fileName, /*bool activate =*/ false, -1, -1);
return true; return true;
} }

View File

@@ -145,7 +145,7 @@ QTextCursor TextDocumentPrivate::indentOrUnindent(const QTextCursor &textCursor,
const QString text = block.text(); const QString text = block.text();
int indentPosition = tabSettings.lineIndentPosition(text); int indentPosition = tabSettings.lineIndentPosition(text);
if (!doIndent && !indentPosition) if (!doIndent && !indentPosition)
indentPosition = tabSettings.firstNonSpace(text); indentPosition = TabSettings::firstNonSpace(text);
int targetColumn = tabSettings.indentedColumn( int targetColumn = tabSettings.indentedColumn(
tabSettings.columnAt(text, indentPosition), doIndent); tabSettings.columnAt(text, indentPosition), doIndent);
cursor.setPosition(block.position() + indentPosition); cursor.setPosition(block.position() + indentPosition);
@@ -184,7 +184,7 @@ QTextCursor TextDocumentPrivate::indentOrUnindent(const QTextCursor &textCursor,
, tabSettings(_tabSettings) , tabSettings(_tabSettings)
{ {
indentPosition = tabSettings.positionAtColumn(text, column, nullptr, true); indentPosition = tabSettings.positionAtColumn(text, column, nullptr, true);
spaces = tabSettings.spacesLeftFromPosition(text, indentPosition); spaces = TabSettings::spacesLeftFromPosition(text, indentPosition);
} }
void indent(const int targetColumn) const void indent(const int targetColumn) const
@@ -927,12 +927,12 @@ void TextDocument::cleanWhitespace(QTextCursor &cursor, bool inEntireDocument,
QString blockText = block.text(); QString blockText = block.text();
if (d->m_storageSettings.removeTrailingWhitespace(fileName)) if (d->m_storageSettings.removeTrailingWhitespace(fileName))
currentTabSettings.removeTrailingWhitespace(cursor, block); TabSettings::removeTrailingWhitespace(cursor, block);
const int indent = indentations[block.blockNumber()]; const int indent = indentations[block.blockNumber()];
if (cleanIndentation && !currentTabSettings.isIndentationClean(block, indent)) { if (cleanIndentation && !currentTabSettings.isIndentationClean(block, indent)) {
cursor.setPosition(block.position()); cursor.setPosition(block.position());
int firstNonSpace = currentTabSettings.firstNonSpace(blockText); const int firstNonSpace = TabSettings::firstNonSpace(blockText);
if (firstNonSpace == blockText.length()) { if (firstNonSpace == blockText.length()) {
cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
cursor.removeSelectedText(); cursor.removeSelectedText();

View File

@@ -3425,16 +3425,16 @@ void TextEditorWidgetPrivate::setupDocumentSignals()
q, &TextEditorWidget::setExtraEncodingSettings); q, &TextEditorWidget::setExtraEncodingSettings);
// Apply current settings // Apply current settings
m_document->setFontSettings(settings->fontSettings()); m_document->setFontSettings(TextEditorSettings::fontSettings());
m_document->setTabSettings(settings->codeStyle()->tabSettings()); // also set through code style ??? m_document->setTabSettings(TextEditorSettings::codeStyle()->tabSettings()); // also set through code style ???
q->setTypingSettings(settings->typingSettings()); q->setTypingSettings(TextEditorSettings::typingSettings());
q->setStorageSettings(settings->storageSettings()); q->setStorageSettings(TextEditorSettings::storageSettings());
q->setBehaviorSettings(settings->behaviorSettings()); q->setBehaviorSettings(TextEditorSettings::behaviorSettings());
q->setMarginSettings(settings->marginSettings()); q->setMarginSettings(TextEditorSettings::marginSettings());
q->setDisplaySettings(settings->displaySettings()); q->setDisplaySettings(TextEditorSettings::displaySettings());
q->setCompletionSettings(settings->completionSettings()); q->setCompletionSettings(TextEditorSettings::completionSettings());
q->setExtraEncodingSettings(settings->extraEncodingSettings()); q->setExtraEncodingSettings(TextEditorSettings::extraEncodingSettings());
q->setCodeStyle(settings->codeStyle(m_tabSettingsId)); q->setCodeStyle(TextEditorSettings::codeStyle(m_tabSettingsId));
} }
bool TextEditorWidgetPrivate::snippetCheckCursor(const QTextCursor &cursor) bool TextEditorWidgetPrivate::snippetCheckCursor(const QTextCursor &cursor)
@@ -6119,7 +6119,7 @@ void TextEditorWidgetPrivate::handleBackspaceKey()
QTextBlock currentBlock = cursor.block(); QTextBlock currentBlock = cursor.block();
int positionInBlock = pos - currentBlock.position(); int positionInBlock = pos - currentBlock.position();
const QString blockText = currentBlock.text(); const QString blockText = currentBlock.text();
if (cursor.atBlockStart() || tabSettings.firstNonSpace(blockText) < positionInBlock) { if (cursor.atBlockStart() || TabSettings::firstNonSpace(blockText) < positionInBlock) {
if (cursorWithinSnippet) if (cursorWithinSnippet)
cursor.beginEditBlock(); cursor.beginEditBlock();
cursor.deletePreviousChar(); cursor.deletePreviousChar();
@@ -6140,7 +6140,7 @@ void TextEditorWidgetPrivate::handleBackspaceKey()
continue; continue;
previousIndent = previousIndent =
tabSettings.columnAt(previousNonEmptyBlockText, tabSettings.columnAt(previousNonEmptyBlockText,
tabSettings.firstNonSpace(previousNonEmptyBlockText)); TabSettings::firstNonSpace(previousNonEmptyBlockText));
if (previousIndent < indent) { if (previousIndent < indent) {
cursor.beginEditBlock(); cursor.beginEditBlock();
cursor.setPosition(currentBlock.position(), QTextCursor::KeepAnchor); cursor.setPosition(currentBlock.position(), QTextCursor::KeepAnchor);

View File

@@ -172,12 +172,12 @@ void TextEditorPluginPrivate::extensionsInitialized()
connect(&settings, &TextEditorSettings::fontSettingsChanged, connect(&settings, &TextEditorSettings::fontSettingsChanged,
this, &TextEditorPluginPrivate::updateSearchResultsFont); this, &TextEditorPluginPrivate::updateSearchResultsFont);
updateSearchResultsFont(settings.fontSettings()); updateSearchResultsFont(TextEditorSettings::fontSettings());
connect(settings.codeStyle(), &ICodeStylePreferences::currentTabSettingsChanged, connect(TextEditorSettings::codeStyle(), &ICodeStylePreferences::currentTabSettingsChanged,
this, &TextEditorPluginPrivate::updateSearchResultsTabWidth); this, &TextEditorPluginPrivate::updateSearchResultsTabWidth);
updateSearchResultsTabWidth(settings.codeStyle()->currentTabSettings()); updateSearchResultsTabWidth(TextEditorSettings::codeStyle()->currentTabSettings());
connect(ExternalToolManager::instance(), &ExternalToolManager::replaceSelectionRequested, connect(ExternalToolManager::instance(), &ExternalToolManager::replaceSelectionRequested,
this, &TextEditorPluginPrivate::updateCurrentSelection); this, &TextEditorPluginPrivate::updateCurrentSelection);

View File

@@ -123,7 +123,7 @@ void TextIndenter::reindent(const QTextCursor &cursor,
// skip empty blocks // skip empty blocks
while (block.isValid() && block != end) { while (block.isValid() && block != end) {
QString bt = block.text(); QString bt = block.text();
if (tabSettings.firstNonSpace(bt) < bt.size()) if (TabSettings::firstNonSpace(bt) < bt.size())
break; break;
indentBlock(block, QChar::Null, tabSettings); indentBlock(block, QChar::Null, tabSettings);
block = block.next(); block = block.next();

View File

@@ -75,7 +75,7 @@ void FunctionCycle::setFunctions(const QVector<const Function *> &functions)
foreach (const Function *func, functions) { foreach (const Function *func, functions) {
// just add up self cost // just add up self cost
d->accumulateCost(d->m_selfCost, func->selfCosts()); Private::accumulateCost(d->m_selfCost, func->selfCosts());
// add outgoing calls to functions that are not part of the cycle // add outgoing calls to functions that are not part of the cycle
foreach (const FunctionCall *call, func->outgoingCalls()) { foreach (const FunctionCall *call, func->outgoingCalls()) {
if (!functions.contains(call->callee())) if (!functions.contains(call->callee()))
@@ -86,7 +86,7 @@ void FunctionCycle::setFunctions(const QVector<const Function *> &functions)
if (!functions.contains(call->caller())) { if (!functions.contains(call->caller())) {
d->accumulateCall(call, Function::Private::Incoming); d->accumulateCall(call, Function::Private::Incoming);
d->m_called += call->calls(); d->m_called += call->calls();
d->accumulateCost(d->m_inclusiveCost, call->costs()); Private::accumulateCost(d->m_inclusiveCost, call->costs());
} }
} }
} }