forked from qt-creator/qt-creator
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:
@@ -381,7 +381,7 @@ namespace ADS
|
||||
void DockAreaTitleBar::onCloseButtonClicked()
|
||||
{
|
||||
qCInfo(adsLog) << Q_FUNC_INFO;
|
||||
if (d->testConfigFlag(DockManager::DockAreaCloseButtonClosesTab))
|
||||
if (DockAreaTitleBarPrivate::testConfigFlag(DockManager::DockAreaCloseButtonClosesTab))
|
||||
d->m_tabBar->closeTab(d->m_tabBar->currentIndex());
|
||||
else
|
||||
d->m_dockArea->closeArea();
|
||||
@@ -432,7 +432,7 @@ namespace ADS
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
if (d->testConfigFlag(DockManager::DockAreaCloseButtonClosesTab)) {
|
||||
if (DockAreaTitleBarPrivate::testConfigFlag(DockManager::DockAreaCloseButtonClosesTab)) {
|
||||
DockWidget *dockWidget = d->m_tabBar->tab(index)->dockWidget();
|
||||
d->m_closeButton->setEnabled(
|
||||
dockWidget->features().testFlag(DockWidget::DockWidgetClosable));
|
||||
|
||||
@@ -2029,7 +2029,7 @@ void Preprocessor::handleIfDefDirective(bool checkUndefined, PPToken *tk)
|
||||
value = false; // take the branch
|
||||
}
|
||||
}
|
||||
} else if (m_env->isBuiltinMacro(macroName)) {
|
||||
} else if (Environment::isBuiltinMacro(macroName)) {
|
||||
value = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ bool ClassMembersEdit::Cursor::skip(const QString &s)
|
||||
{
|
||||
skipWhitespaces();
|
||||
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();
|
||||
return true;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ QString ClassMembersEdit::Cursor::readUntil(const QString &delimiter)
|
||||
return s;
|
||||
}
|
||||
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();
|
||||
return s;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ void ClassMembersEdit::Cursor::skipUntilOrNewline(const QString &delimiter)
|
||||
if (m_text.at(m_pos) == '\n')
|
||||
return;
|
||||
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();
|
||||
return;
|
||||
}
|
||||
@@ -201,7 +201,7 @@ bool ClassMembersEdit::Cursor::skipFromRight(const QString &s)
|
||||
{
|
||||
skipWhitespacesFromRight();
|
||||
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();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ static inline AbstractSymbolGroupNodePtrVector
|
||||
static inline AbstractSymbolGroupNodePtrVector
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
@@ -697,7 +697,7 @@ static bool diffWithWhitespaceExpandedInEqualities(const QList<Diff> &leftInput,
|
||||
}
|
||||
|
||||
Differ differ;
|
||||
const QList<Diff> &diffList = differ.cleanupSemantics(
|
||||
const QList<Diff> &diffList = Differ::cleanupSemantics(
|
||||
differ.diff(leftText, rightText));
|
||||
|
||||
QList<Diff> leftDiffList;
|
||||
@@ -882,7 +882,7 @@ void Differ::diffBetweenEqualities(const QList<Diff> &leftInput,
|
||||
&& previousRightDiff.command == Diff::Insert) {
|
||||
Differ differ;
|
||||
differ.setDiffMode(Differ::CharMode);
|
||||
const QList<Diff> commonOutput = differ.cleanupSemantics(
|
||||
const QList<Diff> commonOutput = cleanupSemantics(
|
||||
differ.diff(previousLeftDiff.text, previousRightDiff.text));
|
||||
|
||||
QList<Diff> outputLeftDiffList;
|
||||
|
||||
@@ -1042,10 +1042,10 @@ void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
|
||||
m_instance->m_config = devConfigs;
|
||||
|
||||
m_instance->save();
|
||||
m_instance->updateAndroidDevice();
|
||||
m_instance->registerNewToolChains();
|
||||
m_instance->updateAutomaticKitList();
|
||||
m_instance->removeOldToolChains();
|
||||
updateAndroidDevice();
|
||||
registerNewToolChains();
|
||||
updateAutomaticKitList();
|
||||
removeOldToolChains();
|
||||
emit m_instance->updated();
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ AutotestPluginPrivate::AutotestPluginPrivate()
|
||||
});
|
||||
ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory);
|
||||
|
||||
m_frameworkManager.activateFrameworksFromSettings(&m_settings);
|
||||
TestFrameworkManager::activateFrameworksFromSettings(&m_settings);
|
||||
m_testTreeModel.synchronizeTestFrameworks();
|
||||
|
||||
auto sessionManager = ProjectExplorer::SessionManager::instance();
|
||||
|
||||
@@ -364,7 +364,7 @@ bool BoostCodeParser::isBoostBindCall(const QByteArray &function)
|
||||
for (const LookupItem &item : lookupItems) {
|
||||
if (Symbol *symbol = item.declaration()) {
|
||||
const QString fullQualified = overview.prettyName(
|
||||
m_lookupContext.fullyQualifiedName(symbol->enclosingNamespace()));
|
||||
LookupContext::fullyQualifiedName(symbol->enclosingNamespace()));
|
||||
if (fullQualified == "boost")
|
||||
return true;
|
||||
}
|
||||
@@ -382,7 +382,7 @@ bool BoostCodeParser::aliasedOrRealNamespace(const QByteArray &symbolName,
|
||||
for (const LookupItem &it : lookup) {
|
||||
if (auto classOrNamespaceSymbol = it.declaration()) {
|
||||
const QString fullQualified = overview.prettyName(
|
||||
m_lookupContext.fullyQualifiedName(classOrNamespaceSymbol));
|
||||
LookupContext::fullyQualifiedName(classOrNamespaceSymbol));
|
||||
if (fullQualified == origNamespace) {
|
||||
*aliasedOrReal = true;
|
||||
if (simplifiedName)
|
||||
|
||||
@@ -48,8 +48,8 @@ bool GTestVisitor::visit(CPlusPlus::FunctionDefinitionAST *ast)
|
||||
if (!id || !ast->symbol || ast->symbol->argumentCount() != 2)
|
||||
return false;
|
||||
|
||||
CPlusPlus::LookupContext lc;
|
||||
QString prettyName = m_overview.prettyName(lc.fullyQualifiedName(ast->symbol));
|
||||
QString prettyName =
|
||||
m_overview.prettyName(CPlusPlus::LookupContext::fullyQualifiedName(ast->symbol));
|
||||
|
||||
// get surrounding namespace(s) and strip them out
|
||||
const QString namespaces = enclosingNamespaces(ast->symbol);
|
||||
|
||||
@@ -57,7 +57,8 @@ bool TestVisitor::visit(Class *symbol)
|
||||
Symbol *member = symbol->memberAt(i);
|
||||
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)
|
||||
continue;
|
||||
|
||||
@@ -91,7 +92,7 @@ bool TestVisitor::visit(Class *symbol)
|
||||
}
|
||||
for (int counter = 0, end = symbol->baseClassCount(); counter < end; ++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")
|
||||
m_baseClasses.insert(baseClassName);
|
||||
}
|
||||
@@ -179,7 +180,8 @@ bool TestDataFunctionVisitor::visit(FunctionDefinitionAST *ast)
|
||||
return false;
|
||||
|
||||
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
|
||||
if (!prettyName.endsWith("_data"))
|
||||
return false;
|
||||
|
||||
@@ -149,7 +149,7 @@ QList<Document::Ptr> QuickTestParser::scanDirectoryForQuickTestQmlFiles(const QS
|
||||
QFutureInterface<void> future;
|
||||
PathsAndLanguages paths;
|
||||
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*/ );
|
||||
|
||||
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);
|
||||
QFutureInterface<void> future;
|
||||
ModelManagerInterface *qmlJsMM = ModelManagerInterface::instance();
|
||||
ModelManagerInterface::importScan(future, qmlJsMM->workingCopy(), paths, qmlJsMM,
|
||||
ModelManagerInterface::importScan(future, ModelManagerInterface::workingCopy(), paths,
|
||||
qmlJsMM,
|
||||
true /*emitDocumentChanges*/,
|
||||
false /*onlyTheLib*/,
|
||||
true /*forceRescan*/ );
|
||||
|
||||
@@ -751,8 +751,8 @@ void TestRunner::buildProject(Project *project)
|
||||
buildManager, &BuildManager::cancel);
|
||||
connect(buildManager, &BuildManager::buildQueueFinished,
|
||||
this, &TestRunner::buildFinished);
|
||||
buildManager->buildProjectWithDependencies(project);
|
||||
if (!buildManager->isBuilding())
|
||||
BuildManager::buildProjectWithDependencies(project);
|
||||
if (!BuildManager::isBuilding())
|
||||
buildFinished(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -476,7 +476,7 @@ void CMakeBuildSettingsWidget::updateSelection()
|
||||
|
||||
for (const QModelIndex &index : selectedIndexes) {
|
||||
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)
|
||||
setableCount++;
|
||||
else
|
||||
@@ -498,7 +498,7 @@ void CMakeBuildSettingsWidget::setVariableUnsetFlag(bool unsetFlag)
|
||||
bool unsetFlagToggled = false;
|
||||
for (const QModelIndex &index : selectedIndexes) {
|
||||
if (index.isValid()) {
|
||||
ConfigModel::DataItem di = m_configModel->dataItemFromIndex(index);
|
||||
const ConfigModel::DataItem di = ConfigModel::dataItemFromIndex(index);
|
||||
if (di.isUnset != unsetFlag) {
|
||||
m_configModel->toggleUnsetFlag(mapToSource(m_configView, index));
|
||||
unsetFlagToggled = true;
|
||||
|
||||
@@ -1068,8 +1068,8 @@ QList<ProjectExplorer::ExtraCompiler *> CMakeBuildSystem::findExtraCompilers()
|
||||
|
||||
// Find all files generated by any of the extra compilers, in a rather crude way.
|
||||
Project *p = project();
|
||||
const FilePaths fileList = p->files([&fileExtensions, p](const Node *n) {
|
||||
if (!p->SourceFiles(n))
|
||||
const FilePaths fileList = p->files([&fileExtensions](const Node *n) {
|
||||
if (!Project::SourceFiles(n))
|
||||
return false;
|
||||
const QString fp = n->filePath().toString();
|
||||
const int pos = fp.lastIndexOf('.');
|
||||
|
||||
@@ -726,14 +726,14 @@ bool EditorManagerPrivate::skipOpeningBigTextFile(const QString &filePath)
|
||||
if (!d->m_warnBeforeOpeningBigFilesEnabled)
|
||||
return false;
|
||||
|
||||
const QFileInfo fileInfo(filePath);
|
||||
if (!fileInfo.exists(filePath))
|
||||
if (!QFileInfo::exists(filePath))
|
||||
return false;
|
||||
|
||||
Utils::MimeType mimeType = Utils::mimeTypeForFile(filePath);
|
||||
if (!mimeType.inherits("text/plain"))
|
||||
return false;
|
||||
|
||||
const QFileInfo fileInfo(filePath);
|
||||
const double fileSizeInMB = fileInfo.size() / 1000.0 / 1000.0;
|
||||
if (fileSizeInMB > d->m_bigFileSizeLimitInMB) {
|
||||
const QString title = EditorManager::tr("Continue Opening Huge Text File?");
|
||||
@@ -754,7 +754,7 @@ bool EditorManagerPrivate::skipOpeningBigTextFile(const QString &filePath)
|
||||
messageBox.setCheckBoxVisible(true);
|
||||
messageBox.setCheckBoxText(CheckableMessageBox::msgDoNotAskAgain());
|
||||
messageBox.exec();
|
||||
d->setWarnBeforeOpeningBigFilesEnabled(!messageBox.isChecked());
|
||||
setWarnBeforeOpeningBigFilesEnabled(!messageBox.isChecked());
|
||||
return messageBox.clickedStandardButton() != QDialogButtonBox::Yes;
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
|
||||
m_replaceLabel->setBuddy(m_replaceTextEdit);
|
||||
m_replaceTextEdit->setMinimumWidth(120);
|
||||
m_replaceTextEdit->setEnabled(false);
|
||||
m_replaceTextEdit->setTabOrder(m_replaceTextEdit, m_searchResultTreeView);
|
||||
setTabOrder(m_replaceTextEdit, m_searchResultTreeView);
|
||||
m_preserveCaseCheck = new QCheckBox(m_topReplaceWidget);
|
||||
m_preserveCaseCheck->setText(tr("Preser&ve case"));
|
||||
m_preserveCaseCheck->setEnabled(false);
|
||||
|
||||
@@ -620,7 +620,8 @@ void SearchResultWindow::readSettings()
|
||||
{
|
||||
QSettings *s = ICore::settings();
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -579,7 +579,7 @@ LocatorWidget::LocatorWidget(Locator *locator) :
|
||||
m_fileLineEdit->setButtonMenu(Utils::FancyLineEdit::Left, m_filterMenu);
|
||||
|
||||
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_fileLineEdit, &QLineEdit::textChanged,
|
||||
|
||||
@@ -308,7 +308,7 @@ void MainWindow::extensionsInitialized()
|
||||
m_windowSupport = new WindowSupport(this, Context("Core.MainWindow"));
|
||||
m_windowSupport->setCloseActionEnabled(false);
|
||||
OutputPaneManager::create();
|
||||
m_vcsManager->extensionsInitialized();
|
||||
VcsManager::extensionsInitialized();
|
||||
m_leftNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories());
|
||||
m_rightNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories());
|
||||
|
||||
|
||||
@@ -206,9 +206,9 @@ NavigationWidget::NavigationWidget(QAction *toggleSideBarAction, Side side) :
|
||||
setOrientation(Qt::Vertical);
|
||||
|
||||
if (side == Side::Left)
|
||||
d->s_instanceLeft = this;
|
||||
NavigationWidgetPrivate::s_instanceLeft = this;
|
||||
else
|
||||
d->s_instanceRight = this;
|
||||
NavigationWidgetPrivate::s_instanceRight = this;
|
||||
}
|
||||
|
||||
NavigationWidget::~NavigationWidget()
|
||||
|
||||
@@ -75,7 +75,7 @@ OutputPanePlaceHolder::OutputPanePlaceHolder(Id mode, QSplitter *parent)
|
||||
|
||||
OutputPanePlaceHolder::~OutputPanePlaceHolder()
|
||||
{
|
||||
if (d->m_current == this) {
|
||||
if (OutputPanePlaceHolderPrivate::m_current == this) {
|
||||
if (Internal::OutputPaneManager *om = Internal::OutputPaneManager::instance()) {
|
||||
om->setParent(nullptr);
|
||||
om->hide();
|
||||
@@ -87,8 +87,8 @@ OutputPanePlaceHolder::~OutputPanePlaceHolder()
|
||||
|
||||
void OutputPanePlaceHolder::currentModeChanged(Id mode)
|
||||
{
|
||||
if (d->m_current == this) {
|
||||
d->m_current = nullptr;
|
||||
if (OutputPanePlaceHolderPrivate::m_current == this) {
|
||||
OutputPanePlaceHolderPrivate::m_current = nullptr;
|
||||
if (d->m_initialized)
|
||||
Internal::OutputPaneManager::setOutputPaneHeightSetting(d->m_nonMaximizedSize);
|
||||
Internal::OutputPaneManager *om = Internal::OutputPaneManager::instance();
|
||||
@@ -97,9 +97,9 @@ void OutputPanePlaceHolder::currentModeChanged(Id mode)
|
||||
om->updateStatusButtons(false);
|
||||
}
|
||||
if (d->m_mode == mode) {
|
||||
if (d->m_current && d->m_current->d->m_initialized)
|
||||
Internal::OutputPaneManager::setOutputPaneHeightSetting(d->m_current->d->m_nonMaximizedSize);
|
||||
d->m_current = this;
|
||||
if (OutputPanePlaceHolderPrivate::m_current && OutputPanePlaceHolderPrivate::m_current->d->m_initialized)
|
||||
Internal::OutputPaneManager::setOutputPaneHeightSetting(OutputPanePlaceHolderPrivate::m_current->d->m_nonMaximizedSize);
|
||||
Core::OutputPanePlaceHolderPrivate::m_current = this;
|
||||
Internal::OutputPaneManager *om = Internal::OutputPaneManager::instance();
|
||||
layout()->addWidget(om);
|
||||
om->show();
|
||||
@@ -119,7 +119,7 @@ void OutputPanePlaceHolder::setMaximized(bool maximize)
|
||||
return;
|
||||
|
||||
d->m_isMaximized = maximize;
|
||||
if (d->m_current == this)
|
||||
if (OutputPanePlaceHolderPrivate::m_current == this)
|
||||
Internal::OutputPaneManager::updateMaximizeButton(d->m_isMaximized);
|
||||
QList<int> sizes = d->m_splitter->sizes();
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ void BuiltinEditorDocumentParser::updateImpl(const QFutureInterface<void> &futur
|
||||
|
||||
// Update the snapshot
|
||||
if (invalidateSnapshot) {
|
||||
const QString configurationFileName = modelManager->configurationFileName();
|
||||
const QString configurationFileName = CppModelManager::configurationFileName();
|
||||
if (invalidateConfig)
|
||||
state.snapshot.remove(configurationFileName);
|
||||
if (!state.snapshot.contains(configurationFileName))
|
||||
|
||||
@@ -804,7 +804,7 @@ const Name *minimalName(Symbol *symbol, Scope *targetScope, const LookupContext
|
||||
ClassOrNamespace *target = context.lookupType(targetScope);
|
||||
if (!target)
|
||||
target = context.globalNamespace();
|
||||
return context.minimalName(symbol, target, context.bindings()->control().data());
|
||||
return LookupContext::minimalName(symbol, target, context.bindings()->control().data());
|
||||
}
|
||||
|
||||
} // Anonymous
|
||||
|
||||
@@ -333,7 +333,7 @@ void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol,
|
||||
CPlusPlus::Overview overview;
|
||||
SearchResult *search = SearchResultWindow::instance()->startNewSearch(tr("C++ Usages:"),
|
||||
QString(),
|
||||
overview.prettyName(context.fullyQualifiedName(symbol)),
|
||||
overview.prettyName(CPlusPlus::LookupContext::fullyQualifiedName(symbol)),
|
||||
replace ? SearchResultWindow::SearchAndReplace
|
||||
: SearchResultWindow::SearchOnly,
|
||||
SearchResultWindow::PreserveCaseDisabled,
|
||||
@@ -352,7 +352,8 @@ void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol,
|
||||
|
||||
if (symbol->isClass() || symbol->isForwardClassDeclaration()) {
|
||||
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));
|
||||
|
||||
@@ -131,7 +131,7 @@ Utils::FilePath CppToolsPlugin::licenseTemplatePath()
|
||||
|
||||
QString CppToolsPlugin::licenseTemplate()
|
||||
{
|
||||
return m_instance->d->m_fileSettings.licenseTemplate();
|
||||
return CppFileSettings::licenseTemplate();
|
||||
}
|
||||
|
||||
bool CppToolsPlugin::usePragmaOnce()
|
||||
|
||||
@@ -486,7 +486,7 @@ public:
|
||||
|
||||
auto editorAndFindWidget = new QWidget;
|
||||
editorAndFindWidget->setLayout(editorHolderLayout);
|
||||
editorHolderLayout->addWidget(mainWindow->centralWidgetStack());
|
||||
editorHolderLayout->addWidget(DebuggerMainWindow::centralWidgetStack());
|
||||
editorHolderLayout->addWidget(new FindToolBarPlaceHolder(editorAndFindWidget));
|
||||
|
||||
auto documentAndRightPane = new MiniSplitter;
|
||||
@@ -517,7 +517,7 @@ public:
|
||||
|
||||
// Navigation and right-side window.
|
||||
auto splitter = new MiniSplitter;
|
||||
splitter->setFocusProxy(mainWindow->centralWidgetStack());
|
||||
splitter->setFocusProxy(DebuggerMainWindow::centralWidgetStack());
|
||||
splitter->addWidget(new NavigationWidgetPlaceHolder(MODE_DEBUG, Side::Left));
|
||||
splitter->addWidget(mainWindowSplitter);
|
||||
splitter->setStretchFactor(0, 0);
|
||||
@@ -833,7 +833,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
|
||||
engineManagerView->setWindowTitle(tr("Running Debuggers"));
|
||||
engineManagerView->setSettings(ICore::settings(), "Debugger.SnapshotView");
|
||||
engineManagerView->setIconSize(QSize(10, 10));
|
||||
engineManagerView->setModel(m_engineManager.model());
|
||||
engineManagerView->setModel(EngineManager::model());
|
||||
engineManagerView->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
engineManagerView->enableColumnHiding();
|
||||
|
||||
|
||||
@@ -2136,7 +2136,7 @@ void QmlEnginePrivate::handleFrame(const QVariantMap &response)
|
||||
|
||||
// Send watchers list
|
||||
if (stackHandler->isContentsValid() && stackHandler->currentFrame().isUsable()) {
|
||||
const QStringList watchers = watchHandler->watchedExpressions();
|
||||
const QStringList watchers = WatchHandler::watchedExpressions();
|
||||
for (const QString &exp : watchers) {
|
||||
const QString iname = watchHandler->watcherName(exp);
|
||||
evaluate(exp, -1, [this, iname, exp](const QVariantMap &response) {
|
||||
|
||||
@@ -1672,7 +1672,7 @@ bool WatchModel::contextMenuEvent(const ItemViewEvent &ev)
|
||||
[this, item] { removeWatchItem(item); });
|
||||
|
||||
addAction(menu, tr("Remove All Expression Evaluators"),
|
||||
canRemoveWatches && !m_handler->watchedExpressions().isEmpty(),
|
||||
canRemoveWatches && !WatchHandler::watchedExpressions().isEmpty(),
|
||||
[this] { clearWatches(); });
|
||||
|
||||
addAction(menu, tr("Select Widget to Add into Expression Evaluator"),
|
||||
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
|
||||
FileData fileData;
|
||||
if (!reloadInfo.binaryFiles) {
|
||||
const QList<Diff> diffList = differ.cleanupSemantics(
|
||||
const QList<Diff> diffList = Differ::cleanupSemantics(
|
||||
differ.diff(reloadInfo.leftText, reloadInfo.rightText));
|
||||
|
||||
QList<Diff> leftDiffList;
|
||||
|
||||
@@ -154,7 +154,7 @@ void HelpManager::unregisterDocumentation(const QStringList &fileNames)
|
||||
const auto getNamespaces = [](const QStringList &fileNames) {
|
||||
QMutexLocker locker(&d->m_helpengineMutex);
|
||||
return Utils::transform(fileNames, [](const QString &filePath) {
|
||||
return d->m_helpEngine->namespaceName(filePath);
|
||||
return QHelpEngineCore::namespaceName(filePath);
|
||||
});
|
||||
};
|
||||
unregisterNamespaces(getNamespaces(fileNames));
|
||||
@@ -179,7 +179,7 @@ void HelpManager::registerDocumentationNow(QFutureInterface<bool> &futureInterfa
|
||||
if (futureInterface.isCanceled())
|
||||
break;
|
||||
futureInterface.setProgressValue(futureInterface.progressValue() + 1);
|
||||
const QString &nameSpace = helpEngine.namespaceName(file);
|
||||
const QString &nameSpace = QHelpEngineCore::namespaceName(file);
|
||||
if (nameSpace.isEmpty())
|
||||
continue;
|
||||
if (!nameSpaces.contains(nameSpace)) {
|
||||
@@ -294,7 +294,7 @@ QStringList HelpManager::registeredNamespaces()
|
||||
QString HelpManager::namespaceFromFile(const QString &file)
|
||||
{
|
||||
QTC_ASSERT(!d->m_needsSetup, return {});
|
||||
return d->m_helpEngine->namespaceName(file);
|
||||
return QHelpEngineCore::namespaceName(file);
|
||||
}
|
||||
|
||||
QString HelpManager::fileFromNamespace(const QString &nameSpace)
|
||||
|
||||
@@ -128,7 +128,7 @@ MacroManagerPrivate::MacroManagerPrivate(MacroManager *qq):
|
||||
void MacroManagerPrivate::initialize()
|
||||
{
|
||||
macros.clear();
|
||||
QDir dir(q->macrosDirectory());
|
||||
const QDir dir(MacroManager::macrosDirectory());
|
||||
QStringList filter;
|
||||
filter << QLatin1String("*.") + QLatin1String(Constants::M_EXTENSION);
|
||||
QStringList files = dir.entryList(filter, QDir::Files);
|
||||
@@ -231,7 +231,7 @@ void MacroManagerPrivate::showSaveDialog()
|
||||
return;
|
||||
|
||||
// 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);
|
||||
currentMacro->setDescription(dialog.description());
|
||||
currentMacro->save(fileName, Core::ICore::dialogParent());
|
||||
|
||||
@@ -222,7 +222,7 @@ void ModelEditor::init()
|
||||
|
||||
d->leftToolBox = new QToolBox(d->leftGroup);
|
||||
// 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)
|
||||
d->leftToolBox->setStyle(windowsStyle);
|
||||
// TODO improve this (and the diagram colors) for use with dark theme
|
||||
|
||||
@@ -1258,8 +1258,8 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const QString &workin
|
||||
if (flags & StdErrToWindow) {
|
||||
process.setStdErrBufferedSignalsEnabled(true);
|
||||
connect(&process, &SynchronousProcess::stdErrBuffered,
|
||||
outputWindow, [outputWindow](const QString &lines) {
|
||||
outputWindow->append(lines);
|
||||
outputWindow, [](const QString &lines) {
|
||||
VcsOutputWindow::append(lines);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1271,8 +1271,8 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const QString &workin
|
||||
outputWindow, &VcsOutputWindow::appendSilently);
|
||||
} else {
|
||||
connect(&process, &SynchronousProcess::stdOutBuffered,
|
||||
outputWindow, [outputWindow](const QString &lines) {
|
||||
outputWindow->append(lines);
|
||||
outputWindow, [](const QString &lines) {
|
||||
VcsOutputWindow::append(lines);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ QWidget *SettingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
|
||||
QComboBox *editor = new QComboBox(parent);
|
||||
for (int i = PerfConfigEventsModel::SubTypeEventTypeHardware;
|
||||
i < PerfConfigEventsModel::SubTypeEventTypeSoftware; ++i) {
|
||||
editor->addItem(model->subTypeString(PerfConfigEventsModel::EventTypeHardware,
|
||||
editor->addItem(PerfConfigEventsModel::subTypeString(PerfConfigEventsModel::EventTypeHardware,
|
||||
PerfConfigEventsModel::SubType(i)), i);
|
||||
}
|
||||
return editor;
|
||||
@@ -290,7 +290,7 @@ QWidget *SettingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
|
||||
QComboBox *editor = new QComboBox(parent);
|
||||
for (int i = PerfConfigEventsModel::SubTypeEventTypeSoftware;
|
||||
i < PerfConfigEventsModel::SubTypeEventTypeCache; ++i) {
|
||||
editor->addItem(model->subTypeString(PerfConfigEventsModel::EventTypeSoftware,
|
||||
editor->addItem(PerfConfigEventsModel::subTypeString(PerfConfigEventsModel::EventTypeSoftware,
|
||||
PerfConfigEventsModel::SubType(i)), i);
|
||||
}
|
||||
return editor;
|
||||
@@ -299,7 +299,7 @@ QWidget *SettingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
|
||||
QComboBox *editor = new QComboBox(parent);
|
||||
for (int i = PerfConfigEventsModel::SubTypeEventTypeCache;
|
||||
i < PerfConfigEventsModel::SubTypeInvalid; ++i) {
|
||||
editor->addItem(model->subTypeString(PerfConfigEventsModel::EventTypeCache,
|
||||
editor->addItem(PerfConfigEventsModel::subTypeString(PerfConfigEventsModel::EventTypeCache,
|
||||
PerfConfigEventsModel::SubType(i)), i);
|
||||
}
|
||||
return editor;
|
||||
|
||||
@@ -476,7 +476,7 @@ void BuildManager::updateTaskCount()
|
||||
void BuildManager::finish()
|
||||
{
|
||||
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();
|
||||
|
||||
QApplication::alert(ICore::dialogParent(), 3000);
|
||||
@@ -484,7 +484,7 @@ void BuildManager::finish()
|
||||
|
||||
void BuildManager::emitCancelMessage()
|
||||
{
|
||||
m_instance->addToOutputWindow(tr("Canceled build/deployment."), BuildStep::OutputFormat::ErrorMessage);
|
||||
addToOutputWindow(tr("Canceled build/deployment."), BuildStep::OutputFormat::ErrorMessage);
|
||||
}
|
||||
|
||||
void BuildManager::clearBuildQueue()
|
||||
|
||||
@@ -295,7 +295,7 @@ void BuildSettingsWidget::cloneConfiguration()
|
||||
if (name.isEmpty())
|
||||
return;
|
||||
|
||||
BuildConfiguration *bc = factory->clone(m_target, m_buildConfiguration);
|
||||
BuildConfiguration *bc = BuildConfigurationFactory::clone(m_target, m_buildConfiguration);
|
||||
if (!bc)
|
||||
return;
|
||||
|
||||
|
||||
@@ -681,7 +681,7 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
|
||||
m_summaryLabel->setContentsMargins(3, 3, 3, 3);
|
||||
m_summaryLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
||||
QPalette pal = m_summaryLabel->palette();
|
||||
pal.setColor(QPalette::Window, Utils::StyleHelper().baseColor());
|
||||
pal.setColor(QPalette::Window, StyleHelper::baseColor());
|
||||
m_summaryLabel->setPalette(pal);
|
||||
m_summaryLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
m_summaryLabel->setTextInteractionFlags(m_summaryLabel->textInteractionFlags() | Qt::LinksAccessibleByMouse);
|
||||
@@ -1554,7 +1554,7 @@ void MiniProjectTargetSelector::updateSummary()
|
||||
void MiniProjectTargetSelector::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter(this);
|
||||
painter.fillRect(rect(), Utils::StyleHelper().baseColor());
|
||||
painter.fillRect(rect(), StyleHelper::baseColor());
|
||||
painter.setPen(creatorTheme()->color(Theme::MiniProjectTargetSelectorBorderColor));
|
||||
// draw border on top and right
|
||||
QRectF borderRect = QRectF(rect()).adjusted(0.5, 0.5, -0.5, -0.5);
|
||||
|
||||
@@ -1678,11 +1678,11 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
BuildManager::cleanProjects(SessionManager::projectOrder(), ConfigSelection::All);
|
||||
});
|
||||
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,
|
||||
dd, &ProjectExplorerPluginPrivate::runProjectContextMenu);
|
||||
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,
|
||||
BuildManager::instance(), &BuildManager::cancel);
|
||||
connect(dd->m_unloadAction, &QAction::triggered,
|
||||
@@ -2716,7 +2716,8 @@ void ProjectExplorerPluginPrivate::runProjectContextMenu()
|
||||
const Node *node = ProjectTree::currentNode();
|
||||
const ProjectNode *projectNode = node ? node->asProjectNode() : nullptr;
|
||||
if (projectNode == ProjectTree::currentProject()->rootProjectNode() || !projectNode) {
|
||||
m_instance->runProject(ProjectTree::currentProject(), Constants::NORMAL_RUN_MODE);
|
||||
ProjectExplorerPlugin::runProject(ProjectTree::currentProject(),
|
||||
Constants::NORMAL_RUN_MODE);
|
||||
} else {
|
||||
auto act = qobject_cast<QAction *>(sender());
|
||||
if (!act)
|
||||
@@ -2724,7 +2725,7 @@ void ProjectExplorerPluginPrivate::runProjectContextMenu()
|
||||
auto *rc = act->data().value<RunConfiguration *>();
|
||||
if (!rc)
|
||||
return;
|
||||
m_instance->runRunConfiguration(rc, Constants::NORMAL_RUN_MODE);
|
||||
ProjectExplorerPlugin::runRunConfiguration(rc, Constants::NORMAL_RUN_MODE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -809,8 +809,8 @@ QSize TaskDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd
|
||||
} else {
|
||||
s.setHeight(fontHeight + 3);
|
||||
}
|
||||
if (s.height() < positions.minimumHeight())
|
||||
s.setHeight(positions.minimumHeight());
|
||||
if (s.height() < Positions::minimumHeight())
|
||||
s.setHeight(Positions::minimumHeight());
|
||||
|
||||
if (!selected) {
|
||||
m_cachedHeight = s.height();
|
||||
@@ -877,7 +877,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
|
||||
// Paint TaskIconArea:
|
||||
QIcon icon = index.data(TaskModel::Icon).value<QIcon>();
|
||||
painter->drawPixmap(positions.left(), positions.top(),
|
||||
icon.pixmap(positions.taskIconWidth(), positions.taskIconHeight()));
|
||||
icon.pixmap(Positions::taskIconWidth(), Positions::taskIconHeight()));
|
||||
|
||||
// Paint TextArea:
|
||||
if (!selected) {
|
||||
|
||||
@@ -150,7 +150,7 @@ QString QbsProfileManager::ensureProfileForKit(const ProjectExplorer::Kit *k)
|
||||
{
|
||||
if (!k)
|
||||
return QString();
|
||||
m_instance->updateProfileIfNecessary(k);
|
||||
updateProfileIfNecessary(k);
|
||||
return profileNameForKit(k);
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ static void setId(const QModelIndex &index, const QString &newId)
|
||||
if (modelNode.id() == newId)
|
||||
return;
|
||||
|
||||
if (!modelNode.isValidId(newId)) {
|
||||
if (!ModelNode::isValidId(newId)) {
|
||||
Core::AsynchronousMessageBox::warning(NavigatorTreeView::tr("Invalid Id"),
|
||||
NavigatorTreeView::tr("%1 is an invalid id.").arg(newId));
|
||||
} else if (modelNode.view()->hasId(newId)) {
|
||||
|
||||
@@ -265,11 +265,11 @@ void DesignModeWidget::setup()
|
||||
|
||||
const QIcon tabsCloseIcon = Utils::StyleHelper::getIconFromIconFont(fontName, {closeIconNormal, closeIconFocused});
|
||||
|
||||
m_dockManager->iconProvider().registerCustomIcon(ADS::TabCloseIcon, tabsCloseIcon);
|
||||
m_dockManager->iconProvider().registerCustomIcon(ADS::DockAreaMenuIcon, menuIcon);
|
||||
m_dockManager->iconProvider().registerCustomIcon(ADS::DockAreaUndockIcon, undockIcon);
|
||||
m_dockManager->iconProvider().registerCustomIcon(ADS::DockAreaCloseIcon, closeIcon);
|
||||
m_dockManager->iconProvider().registerCustomIcon(ADS::FloatingWidgetCloseIcon, closeIcon);
|
||||
ADS::DockManager::iconProvider().registerCustomIcon(ADS::TabCloseIcon, tabsCloseIcon);
|
||||
ADS::DockManager::iconProvider().registerCustomIcon(ADS::DockAreaMenuIcon, menuIcon);
|
||||
ADS::DockManager::iconProvider().registerCustomIcon(ADS::DockAreaUndockIcon, undockIcon);
|
||||
ADS::DockManager::iconProvider().registerCustomIcon(ADS::DockAreaCloseIcon, closeIcon);
|
||||
ADS::DockManager::iconProvider().registerCustomIcon(ADS::FloatingWidgetCloseIcon, closeIcon);
|
||||
|
||||
// Setup Actions and Menus
|
||||
Core::ActionContainer *mview = Core::ActionManager::actionContainer(Core::Constants::M_VIEW);
|
||||
|
||||
@@ -919,7 +919,7 @@ void FindReferences::findUsages(const QString &fileName, quint32 offset)
|
||||
{
|
||||
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());
|
||||
m_watcher.setFuture(result);
|
||||
}
|
||||
@@ -934,7 +934,7 @@ void FindReferences::renameUsages(const QString &fileName, quint32 offset,
|
||||
if (newName.isNull())
|
||||
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);
|
||||
m_watcher.setFuture(result);
|
||||
}
|
||||
|
||||
@@ -658,7 +658,7 @@ QModelIndex QmlOutlineModel::enterFieldMemberExpression(AST::FieldMemberExpressi
|
||||
objectData.insert(AnnotationRole, QString()); // clear possible former annotation
|
||||
|
||||
QmlOutlineItem *item = enterNode(objectData, expression, nullptr,
|
||||
m_icons->functionDeclarationIcon());
|
||||
Icons::functionDeclarationIcon());
|
||||
|
||||
return item->index();
|
||||
}
|
||||
|
||||
@@ -633,7 +633,8 @@ FilePath BaseQtVersion::mkspecsPath() const
|
||||
{
|
||||
const FilePath result = hostDataPath();
|
||||
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");
|
||||
}
|
||||
|
||||
@@ -952,7 +953,7 @@ FilePath BaseQtVersion::sourcePath() const
|
||||
{
|
||||
if (d->m_data.sourcePath.isEmpty()) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ bool AutoCompleter::isNextBlockIndented(const QTextBlock ¤tBlock) const
|
||||
if (block.next().isValid()) { // not the last block
|
||||
block = block.next();
|
||||
//skip all empty blocks
|
||||
while (block.isValid() && m_tabSettings.onlySpace(block.text()))
|
||||
while (block.isValid() && TabSettings::onlySpace(block.text()))
|
||||
block = block.next();
|
||||
if (block.isValid()
|
||||
&& m_tabSettings.indentationColumn(block.text()) > indentation)
|
||||
|
||||
@@ -106,7 +106,7 @@ bool RefactoringChanges::createFile(const QString &fileName, const QString &cont
|
||||
m_data->fileChanged(fileName);
|
||||
|
||||
if (openEditor)
|
||||
this->openEditor(fileName, /*bool activate =*/ false, -1, -1);
|
||||
RefactoringChanges::openEditor(fileName, /*bool activate =*/ false, -1, -1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ QTextCursor TextDocumentPrivate::indentOrUnindent(const QTextCursor &textCursor,
|
||||
const QString text = block.text();
|
||||
int indentPosition = tabSettings.lineIndentPosition(text);
|
||||
if (!doIndent && !indentPosition)
|
||||
indentPosition = tabSettings.firstNonSpace(text);
|
||||
indentPosition = TabSettings::firstNonSpace(text);
|
||||
int targetColumn = tabSettings.indentedColumn(
|
||||
tabSettings.columnAt(text, indentPosition), doIndent);
|
||||
cursor.setPosition(block.position() + indentPosition);
|
||||
@@ -184,7 +184,7 @@ QTextCursor TextDocumentPrivate::indentOrUnindent(const QTextCursor &textCursor,
|
||||
, tabSettings(_tabSettings)
|
||||
{
|
||||
indentPosition = tabSettings.positionAtColumn(text, column, nullptr, true);
|
||||
spaces = tabSettings.spacesLeftFromPosition(text, indentPosition);
|
||||
spaces = TabSettings::spacesLeftFromPosition(text, indentPosition);
|
||||
}
|
||||
|
||||
void indent(const int targetColumn) const
|
||||
@@ -927,12 +927,12 @@ void TextDocument::cleanWhitespace(QTextCursor &cursor, bool inEntireDocument,
|
||||
QString blockText = block.text();
|
||||
|
||||
if (d->m_storageSettings.removeTrailingWhitespace(fileName))
|
||||
currentTabSettings.removeTrailingWhitespace(cursor, block);
|
||||
TabSettings::removeTrailingWhitespace(cursor, block);
|
||||
|
||||
const int indent = indentations[block.blockNumber()];
|
||||
if (cleanIndentation && !currentTabSettings.isIndentationClean(block, indent)) {
|
||||
cursor.setPosition(block.position());
|
||||
int firstNonSpace = currentTabSettings.firstNonSpace(blockText);
|
||||
const int firstNonSpace = TabSettings::firstNonSpace(blockText);
|
||||
if (firstNonSpace == blockText.length()) {
|
||||
cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
|
||||
cursor.removeSelectedText();
|
||||
|
||||
@@ -3425,16 +3425,16 @@ void TextEditorWidgetPrivate::setupDocumentSignals()
|
||||
q, &TextEditorWidget::setExtraEncodingSettings);
|
||||
|
||||
// Apply current settings
|
||||
m_document->setFontSettings(settings->fontSettings());
|
||||
m_document->setTabSettings(settings->codeStyle()->tabSettings()); // also set through code style ???
|
||||
q->setTypingSettings(settings->typingSettings());
|
||||
q->setStorageSettings(settings->storageSettings());
|
||||
q->setBehaviorSettings(settings->behaviorSettings());
|
||||
q->setMarginSettings(settings->marginSettings());
|
||||
q->setDisplaySettings(settings->displaySettings());
|
||||
q->setCompletionSettings(settings->completionSettings());
|
||||
q->setExtraEncodingSettings(settings->extraEncodingSettings());
|
||||
q->setCodeStyle(settings->codeStyle(m_tabSettingsId));
|
||||
m_document->setFontSettings(TextEditorSettings::fontSettings());
|
||||
m_document->setTabSettings(TextEditorSettings::codeStyle()->tabSettings()); // also set through code style ???
|
||||
q->setTypingSettings(TextEditorSettings::typingSettings());
|
||||
q->setStorageSettings(TextEditorSettings::storageSettings());
|
||||
q->setBehaviorSettings(TextEditorSettings::behaviorSettings());
|
||||
q->setMarginSettings(TextEditorSettings::marginSettings());
|
||||
q->setDisplaySettings(TextEditorSettings::displaySettings());
|
||||
q->setCompletionSettings(TextEditorSettings::completionSettings());
|
||||
q->setExtraEncodingSettings(TextEditorSettings::extraEncodingSettings());
|
||||
q->setCodeStyle(TextEditorSettings::codeStyle(m_tabSettingsId));
|
||||
}
|
||||
|
||||
bool TextEditorWidgetPrivate::snippetCheckCursor(const QTextCursor &cursor)
|
||||
@@ -6119,7 +6119,7 @@ void TextEditorWidgetPrivate::handleBackspaceKey()
|
||||
QTextBlock currentBlock = cursor.block();
|
||||
int positionInBlock = pos - currentBlock.position();
|
||||
const QString blockText = currentBlock.text();
|
||||
if (cursor.atBlockStart() || tabSettings.firstNonSpace(blockText) < positionInBlock) {
|
||||
if (cursor.atBlockStart() || TabSettings::firstNonSpace(blockText) < positionInBlock) {
|
||||
if (cursorWithinSnippet)
|
||||
cursor.beginEditBlock();
|
||||
cursor.deletePreviousChar();
|
||||
@@ -6140,7 +6140,7 @@ void TextEditorWidgetPrivate::handleBackspaceKey()
|
||||
continue;
|
||||
previousIndent =
|
||||
tabSettings.columnAt(previousNonEmptyBlockText,
|
||||
tabSettings.firstNonSpace(previousNonEmptyBlockText));
|
||||
TabSettings::firstNonSpace(previousNonEmptyBlockText));
|
||||
if (previousIndent < indent) {
|
||||
cursor.beginEditBlock();
|
||||
cursor.setPosition(currentBlock.position(), QTextCursor::KeepAnchor);
|
||||
|
||||
@@ -172,12 +172,12 @@ void TextEditorPluginPrivate::extensionsInitialized()
|
||||
connect(&settings, &TextEditorSettings::fontSettingsChanged,
|
||||
this, &TextEditorPluginPrivate::updateSearchResultsFont);
|
||||
|
||||
updateSearchResultsFont(settings.fontSettings());
|
||||
updateSearchResultsFont(TextEditorSettings::fontSettings());
|
||||
|
||||
connect(settings.codeStyle(), &ICodeStylePreferences::currentTabSettingsChanged,
|
||||
connect(TextEditorSettings::codeStyle(), &ICodeStylePreferences::currentTabSettingsChanged,
|
||||
this, &TextEditorPluginPrivate::updateSearchResultsTabWidth);
|
||||
|
||||
updateSearchResultsTabWidth(settings.codeStyle()->currentTabSettings());
|
||||
updateSearchResultsTabWidth(TextEditorSettings::codeStyle()->currentTabSettings());
|
||||
|
||||
connect(ExternalToolManager::instance(), &ExternalToolManager::replaceSelectionRequested,
|
||||
this, &TextEditorPluginPrivate::updateCurrentSelection);
|
||||
|
||||
@@ -123,7 +123,7 @@ void TextIndenter::reindent(const QTextCursor &cursor,
|
||||
// skip empty blocks
|
||||
while (block.isValid() && block != end) {
|
||||
QString bt = block.text();
|
||||
if (tabSettings.firstNonSpace(bt) < bt.size())
|
||||
if (TabSettings::firstNonSpace(bt) < bt.size())
|
||||
break;
|
||||
indentBlock(block, QChar::Null, tabSettings);
|
||||
block = block.next();
|
||||
|
||||
@@ -75,7 +75,7 @@ void FunctionCycle::setFunctions(const QVector<const Function *> &functions)
|
||||
|
||||
foreach (const Function *func, functions) {
|
||||
// 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
|
||||
foreach (const FunctionCall *call, func->outgoingCalls()) {
|
||||
if (!functions.contains(call->callee()))
|
||||
@@ -86,7 +86,7 @@ void FunctionCycle::setFunctions(const QVector<const Function *> &functions)
|
||||
if (!functions.contains(call->caller())) {
|
||||
d->accumulateCall(call, Function::Private::Incoming);
|
||||
d->m_called += call->calls();
|
||||
d->accumulateCost(d->m_inclusiveCost, call->costs());
|
||||
Private::accumulateCost(d->m_inclusiveCost, call->costs());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user