forked from qt-creator/qt-creator
Core: Make member functions const/static
readability-make-member-function-const finds lots of member functions that could be made const. This change just picks getter functions that really should be const. readability-convert-member-functions-to-static finds non-static member functions which do not access this. This change turns most of them into static ones, but leaves some non static to keep the class API consistent. Change-Id: I004d6f7fab4375f9902f940f29b4a4f561fc7604 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -398,7 +398,7 @@ TouchBar *ActionContainerPrivate::touchBar() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool ActionContainerPrivate::canAddAction(Command *action) const
|
||||
bool ActionContainerPrivate::canAddAction(Command *action)
|
||||
{
|
||||
return action && action->action();
|
||||
}
|
||||
|
@@ -80,7 +80,7 @@ public:
|
||||
virtual bool updateInternal() = 0;
|
||||
|
||||
protected:
|
||||
bool canAddAction(Command *action) const;
|
||||
static bool canAddAction(Command *action);
|
||||
bool canAddMenu(ActionContainer *menu) const;
|
||||
virtual bool canBeAddedToContainer(ActionContainerPrivate *container) const = 0;
|
||||
|
||||
|
@@ -328,7 +328,7 @@ void ActionManager::unregisterAction(QAction *action, Id id)
|
||||
a->removeOverrideAction(action);
|
||||
if (a->isEmpty()) {
|
||||
// clean up
|
||||
d->saveSettings(a);
|
||||
ActionManagerPrivate::saveSettings(a);
|
||||
ICore::mainWindow()->removeAction(a->action());
|
||||
// ActionContainers listen to the commands' destroyed signals
|
||||
delete a->action();
|
||||
|
@@ -55,13 +55,13 @@ public:
|
||||
bool hasContext(int context) const;
|
||||
|
||||
void saveSettings();
|
||||
void saveSettings(Action *cmd);
|
||||
static void saveSettings(Action *cmd);
|
||||
|
||||
void showShortcutPopup(const QString &shortcut);
|
||||
static void showShortcutPopup(const QString &shortcut);
|
||||
bool hasContext(const Context &context) const;
|
||||
Action *overridableAction(Utils::Id id);
|
||||
|
||||
void readUserSettings(Utils::Id id, Action *cmd);
|
||||
static void readUserSettings(Utils::Id id, Action *cmd);
|
||||
|
||||
void containerDestroyed();
|
||||
void actionTriggered();
|
||||
|
@@ -70,7 +70,7 @@ protected:
|
||||
void setFilterText(const QString &text);
|
||||
void setPageTitle(const QString &s);
|
||||
void setTargetHeader(const QString &s);
|
||||
void setModified(QTreeWidgetItem *item, bool modified);
|
||||
static void setModified(QTreeWidgetItem *item, bool modified);
|
||||
|
||||
private:
|
||||
bool filter(const QString &filterString, QTreeWidgetItem *item);
|
||||
|
@@ -84,7 +84,7 @@ void BaseFileWizard::accept()
|
||||
QString errorMessage;
|
||||
|
||||
// Compile result list and prompt for overwrite
|
||||
switch (m_factory->promptOverwrite(&m_files, &errorMessage)) {
|
||||
switch (BaseFileWizardFactory::promptOverwrite(&m_files, &errorMessage)) {
|
||||
case BaseFileWizardFactory::OverwriteCanceled:
|
||||
reject();
|
||||
return;
|
||||
|
@@ -203,7 +203,7 @@ bool BaseFileWizardFactory::postGenerateOpenEditors(const GeneratedFiles &l, QSt
|
||||
*/
|
||||
|
||||
BaseFileWizardFactory::OverwriteResult BaseFileWizardFactory::promptOverwrite(GeneratedFiles *files,
|
||||
QString *errorMessage) const
|
||||
QString *errorMessage)
|
||||
{
|
||||
if (debugWizard)
|
||||
qDebug() << Q_FUNC_INFO << files;
|
||||
|
@@ -109,8 +109,8 @@ protected:
|
||||
static QString preferredSuffix(const QString &mimeType);
|
||||
|
||||
enum OverwriteResult { OverwriteOk, OverwriteError, OverwriteCanceled };
|
||||
OverwriteResult promptOverwrite(GeneratedFiles *files,
|
||||
QString *errorMessage) const;
|
||||
static OverwriteResult promptOverwrite(GeneratedFiles *files,
|
||||
QString *errorMessage);
|
||||
static bool postGenerateOpenEditors(const GeneratedFiles &l, QString *errorMessage = nullptr);
|
||||
|
||||
private:
|
||||
|
@@ -270,7 +270,7 @@ QObject *CorePlugin::remoteCommand(const QStringList & /* options */,
|
||||
});
|
||||
return nullptr;
|
||||
}
|
||||
IDocument *res = m_mainWindow->openFiles(
|
||||
IDocument *res = MainWindow::openFiles(
|
||||
args, ICore::OpenFilesFlags(ICore::SwitchMode | ICore::CanContainLineAndColumnNumbers | ICore::SwitchSplitIfAlreadyVisible),
|
||||
workingDirectory);
|
||||
m_mainWindow->raiseWindow();
|
||||
|
@@ -87,7 +87,7 @@ private slots:
|
||||
|
||||
private:
|
||||
static void addToPathChooserContextMenu(Utils::PathChooser *pathChooser, QMenu *menu);
|
||||
void setupSystemEnvironment();
|
||||
static void setupSystemEnvironment();
|
||||
void checkSettings();
|
||||
|
||||
MainWindow *m_mainWindow = nullptr;
|
||||
|
@@ -88,7 +88,7 @@ public:
|
||||
void setTools(const QMap<QString, QList<ExternalTool *> > &tools);
|
||||
QMap<QString, QList<ExternalTool *> > tools() const { return m_tools; }
|
||||
|
||||
ExternalTool *toolForIndex(const QModelIndex &modelIndex) const;
|
||||
static ExternalTool *toolForIndex(const QModelIndex &modelIndex);
|
||||
QString categoryForIndex(const QModelIndex &modelIndex, bool *found) const;
|
||||
void revertTool(const QModelIndex &modelIndex);
|
||||
QModelIndex addCategory();
|
||||
@@ -97,8 +97,8 @@ public:
|
||||
Qt::DropActions supportedDropActions() const override { return Qt::MoveAction; }
|
||||
|
||||
private:
|
||||
QVariant data(ExternalTool *tool, int role = Qt::DisplayRole) const;
|
||||
QVariant data(const QString &category, int role = Qt::DisplayRole) const;
|
||||
static QVariant data(ExternalTool *tool, int role = Qt::DisplayRole);
|
||||
static QVariant data(const QString &category, int role = Qt::DisplayRole);
|
||||
|
||||
QMap<QString, QList<ExternalTool *> > m_tools;
|
||||
};
|
||||
@@ -129,7 +129,7 @@ QVariant ExternalToolModel::data(const QModelIndex &index, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QVariant ExternalToolModel::data(ExternalTool *tool, int role) const
|
||||
QVariant ExternalToolModel::data(ExternalTool *tool, int role)
|
||||
{
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
@@ -141,7 +141,7 @@ QVariant ExternalToolModel::data(ExternalTool *tool, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QVariant ExternalToolModel::data(const QString &category, int role) const
|
||||
QVariant ExternalToolModel::data(const QString &category, int role)
|
||||
{
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
@@ -315,7 +315,7 @@ void ExternalToolModel::setTools(const QMap<QString, QList<ExternalTool *> > &to
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
ExternalTool *ExternalToolModel::toolForIndex(const QModelIndex &index) const
|
||||
ExternalTool *ExternalToolModel::toolForIndex(const QModelIndex &index)
|
||||
{
|
||||
return static_cast<ExternalTool *>(index.internalPointer());
|
||||
}
|
||||
@@ -547,7 +547,7 @@ void ExternalToolConfig::handleCurrentChanged(const QModelIndex &now, const QMod
|
||||
|
||||
void ExternalToolConfig::updateButtons(const QModelIndex &index)
|
||||
{
|
||||
ExternalTool *tool = m_model.toolForIndex(index);
|
||||
const ExternalTool *tool = ExternalToolModel::toolForIndex(index);
|
||||
if (!tool) {
|
||||
m_ui.removeButton->setEnabled(false);
|
||||
m_ui.revertButton->setEnabled(false);
|
||||
@@ -571,7 +571,7 @@ void ExternalToolConfig::updateCurrentItem()
|
||||
|
||||
void ExternalToolConfig::updateItem(const QModelIndex &index)
|
||||
{
|
||||
ExternalTool *tool = m_model.toolForIndex(index);
|
||||
ExternalTool *tool = ExternalToolModel::toolForIndex(index);
|
||||
if (!tool)
|
||||
return;
|
||||
tool->setDescription(m_ui.description->text());
|
||||
@@ -594,7 +594,7 @@ void ExternalToolConfig::updateItem(const QModelIndex &index)
|
||||
void ExternalToolConfig::showInfoForItem(const QModelIndex &index)
|
||||
{
|
||||
updateButtons(index);
|
||||
ExternalTool *tool = m_model.toolForIndex(index);
|
||||
const ExternalTool *tool = ExternalToolModel::toolForIndex(index);
|
||||
if (!tool) {
|
||||
m_ui.description->clear();
|
||||
m_ui.executable->setPath(QString());
|
||||
|
@@ -417,7 +417,7 @@ private:
|
||||
|
||||
void createGui();
|
||||
void showCategory(int index);
|
||||
void updateEnabledTabs(Category *category, const QString &searchText);
|
||||
static void updateEnabledTabs(Category *category, const QString &searchText);
|
||||
void ensureCategoryWidget(Category *category);
|
||||
void disconnectTabWidgets();
|
||||
|
||||
|
@@ -428,12 +428,10 @@ bool ShortcutSettingsWidget::updateAndCheckForConflicts(const QKeySequence &key,
|
||||
while (index >= item->m_keys.size())
|
||||
item->m_keys.append(QKeySequence());
|
||||
item->m_keys[index] = key;
|
||||
auto that = const_cast<ShortcutSettingsWidget *>(this);
|
||||
if (cleanKeys(item->m_keys) != item->m_cmd->defaultKeySequences())
|
||||
that->setModified(current, true);
|
||||
else
|
||||
that->setModified(current, false);
|
||||
CommandMappings::setModified(current,
|
||||
cleanKeys(item->m_keys) != item->m_cmd->defaultKeySequences());
|
||||
current->setText(2, keySequencesToNativeString(item->m_keys));
|
||||
auto that = const_cast<ShortcutSettingsWidget *>(this);
|
||||
return that->markCollisions(item, index);
|
||||
}
|
||||
|
||||
|
@@ -159,7 +159,7 @@ SplitterOrView *EditorView::parentSplitterOrView() const
|
||||
return m_parentSplitterOrView;
|
||||
}
|
||||
|
||||
EditorView *EditorView::findNextView()
|
||||
EditorView *EditorView::findNextView() const
|
||||
{
|
||||
SplitterOrView *current = parentSplitterOrView();
|
||||
QTC_ASSERT(current, return nullptr);
|
||||
@@ -182,7 +182,7 @@ EditorView *EditorView::findNextView()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
EditorView *EditorView::findPreviousView()
|
||||
EditorView *EditorView::findPreviousView() const
|
||||
{
|
||||
SplitterOrView *current = parentSplitterOrView();
|
||||
QTC_ASSERT(current, return nullptr);
|
||||
@@ -363,7 +363,7 @@ void EditorView::listSelectionActivated(int index)
|
||||
EditorManagerPrivate::activateEditorForEntry(this, DocumentModel::entryAtRow(index));
|
||||
}
|
||||
|
||||
void EditorView::fillListContextMenu(QMenu *menu)
|
||||
void EditorView::fillListContextMenu(QMenu *menu) const
|
||||
{
|
||||
IEditor *editor = currentEditor();
|
||||
DocumentModel::Entry *entry = editor ? DocumentModel::entryForDocument(editor->document())
|
||||
|
@@ -78,8 +78,8 @@ public:
|
||||
~EditorView() override;
|
||||
|
||||
SplitterOrView *parentSplitterOrView() const;
|
||||
EditorView *findNextView();
|
||||
EditorView *findPreviousView();
|
||||
EditorView *findNextView() const;
|
||||
EditorView *findPreviousView() const;
|
||||
|
||||
int editorCount() const;
|
||||
void addEditor(IEditor *editor);
|
||||
@@ -123,7 +123,7 @@ private:
|
||||
|
||||
void setParentSplitterOrView(SplitterOrView *splitterOrView);
|
||||
|
||||
void fillListContextMenu(QMenu *menu);
|
||||
void fillListContextMenu(QMenu *menu) const;
|
||||
void updateNavigatorActions();
|
||||
void updateToolBar(IEditor *editor);
|
||||
void checkProjectLoaded(IEditor *editor);
|
||||
|
@@ -74,7 +74,7 @@ public slots:
|
||||
|
||||
private:
|
||||
void editorClicked(QTreeWidgetItem *item);
|
||||
void selectEditor(QTreeWidgetItem *item);
|
||||
static void selectEditor(QTreeWidgetItem *item);
|
||||
|
||||
void addHistoryItems(const QList<EditLocation> &history, EditorView *view,
|
||||
QSet<const DocumentModel::Entry *> &entriesDone);
|
||||
|
@@ -97,8 +97,8 @@ protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
||||
private:
|
||||
void changeActiveEditor(int row);
|
||||
void makeEditorWritable();
|
||||
static void changeActiveEditor(int row);
|
||||
static void makeEditorWritable();
|
||||
|
||||
void checkDocumentStatus();
|
||||
void closeEditor();
|
||||
|
@@ -182,7 +182,8 @@ public:
|
||||
bool isAnyFilterEnabled() const;
|
||||
void writeSettings();
|
||||
void setFindFlag(Core::FindFlag flag, bool enabled);
|
||||
void updateCompletion(const QString &text, QStringList &completions, QStringListModel *model);
|
||||
static void updateCompletion(const QString &text, QStringList &completions,
|
||||
QStringListModel *model);
|
||||
void setupMenu();
|
||||
void setupFilterMenuItems();
|
||||
void readSettings();
|
||||
@@ -429,7 +430,7 @@ void Find::updateFindCompletion(const QString &text, FindFlags flags)
|
||||
|
||||
void Find::updateReplaceCompletion(const QString &text)
|
||||
{
|
||||
d->updateCompletion(text, d->m_replaceCompletions, &d->m_replaceCompletionModel);
|
||||
FindPrivate::updateCompletion(text, d->m_replaceCompletions, &d->m_replaceCompletionModel);
|
||||
}
|
||||
|
||||
void FindPrivate::updateCompletion(const QString &text, QStringList &completions, QStringListModel *model)
|
||||
|
@@ -733,7 +733,7 @@ void FindToolBar::hideAndResetFocus()
|
||||
hide();
|
||||
}
|
||||
|
||||
FindToolBarPlaceHolder *FindToolBar::findToolBarPlaceHolder() const
|
||||
FindToolBarPlaceHolder *FindToolBar::findToolBarPlaceHolder()
|
||||
{
|
||||
const QList<FindToolBarPlaceHolder*> placeholders = FindToolBarPlaceHolder::allFindToolbarPlaceHolders();
|
||||
QWidget *candidate = QApplication::focusWidget();
|
||||
|
@@ -124,7 +124,7 @@ private:
|
||||
void setFindFlag(FindFlag flag, bool enabled);
|
||||
bool hasFindFlag(FindFlag flag);
|
||||
FindFlags effectiveFindFlags();
|
||||
FindToolBarPlaceHolder *findToolBarPlaceHolder() const;
|
||||
static FindToolBarPlaceHolder *findToolBarPlaceHolder();
|
||||
bool toolBarHasFocus() const;
|
||||
ControlStyle controlStyle(bool replaceIsVisible);
|
||||
void setFindButtonStyle(Qt::ToolButtonStyle style);
|
||||
|
@@ -65,7 +65,7 @@ private:
|
||||
void updateButtonStates();
|
||||
void updateFindFlags();
|
||||
void updateFindFilterName(IFindFilter *filter);
|
||||
void findCompleterActivated(const QModelIndex &index);
|
||||
static void findCompleterActivated(const QModelIndex &index);
|
||||
|
||||
void acceptAndGetParameters(QString *term, IFindFilter **filter);
|
||||
|
||||
|
@@ -149,7 +149,7 @@ int SearchResultTreeModel::columnCount(const QModelIndex &parent) const
|
||||
return 1;
|
||||
}
|
||||
|
||||
SearchResultTreeItem *SearchResultTreeModel::treeItemAtIndex(const QModelIndex &idx) const
|
||||
SearchResultTreeItem *SearchResultTreeModel::treeItemAtIndex(const QModelIndex &idx)
|
||||
{
|
||||
return static_cast<SearchResultTreeItem*>(idx.internalPointer());
|
||||
}
|
||||
|
@@ -76,7 +76,7 @@ private:
|
||||
bool setCheckState(const QModelIndex &idx, Qt::CheckState checkState, bool firstCall = true);
|
||||
QModelIndex nextIndex(const QModelIndex &idx, bool *wrapped = nullptr) const;
|
||||
QModelIndex prevIndex(const QModelIndex &idx, bool *wrapped = nullptr) const;
|
||||
SearchResultTreeItem *treeItemAtIndex(const QModelIndex &idx) const;
|
||||
static SearchResultTreeItem *treeItemAtIndex(const QModelIndex &idx);
|
||||
|
||||
SearchResultTreeItem *m_rootItem;
|
||||
SearchResultTreeItem *m_currentParent;
|
||||
|
@@ -64,10 +64,10 @@ public:
|
||||
void resetWarnings();
|
||||
void resetLanguage();
|
||||
|
||||
bool canResetWarnings() const;
|
||||
static bool canResetWarnings();
|
||||
void fillLanguageBox() const;
|
||||
QString language() const;
|
||||
void setLanguage(const QString&);
|
||||
static QString language();
|
||||
static void setLanguage(const QString&);
|
||||
|
||||
GeneralSettings *q;
|
||||
Ui::GeneralSettings m_ui;
|
||||
@@ -86,7 +86,7 @@ GeneralSettingsWidget::GeneralSettingsWidget(GeneralSettings *q)
|
||||
m_ui.showShortcutsInContextMenus->setText(
|
||||
tr("Show keyboard shortcuts in context menus (default: %1)")
|
||||
.arg(q->m_defaultShowShortcutsInContextMenu ? tr("on") : tr("off")));
|
||||
m_ui.showShortcutsInContextMenus->setChecked(q->showShortcutsInContextMenu());
|
||||
m_ui.showShortcutsInContextMenus->setChecked(GeneralSettings::showShortcutsInContextMenu());
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 13, 0))
|
||||
m_ui.showShortcutsInContextMenus->setVisible(false);
|
||||
#endif
|
||||
@@ -157,7 +157,7 @@ void GeneralSettingsWidget::apply()
|
||||
m_ui.themeChooser->apply();
|
||||
}
|
||||
|
||||
bool GeneralSettings::showShortcutsInContextMenu() const
|
||||
bool GeneralSettings::showShortcutsInContextMenu()
|
||||
{
|
||||
return ICore::settings()
|
||||
->value(settingsKeyShortcutsInContextMenu,
|
||||
@@ -177,7 +177,7 @@ void GeneralSettingsWidget::resetWarnings()
|
||||
m_ui.resetWarningsButton->setEnabled(false);
|
||||
}
|
||||
|
||||
bool GeneralSettingsWidget::canResetWarnings() const
|
||||
bool GeneralSettingsWidget::canResetWarnings()
|
||||
{
|
||||
return InfoBar::anyGloballySuppressed()
|
||||
|| CheckableMessageBox::hasSuppressedQuestions(ICore::settings());
|
||||
@@ -189,7 +189,7 @@ void GeneralSettingsWidget::resetLanguage()
|
||||
m_ui.languageBox->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
QString GeneralSettingsWidget::language() const
|
||||
QString GeneralSettingsWidget::language()
|
||||
{
|
||||
QSettings *settings = ICore::settings();
|
||||
return settings->value(QLatin1String("General/OverrideLanguage")).toString();
|
||||
|
@@ -35,7 +35,7 @@ class GeneralSettings : public IOptionsPage
|
||||
public:
|
||||
GeneralSettings();
|
||||
|
||||
bool showShortcutsInContextMenu() const;
|
||||
static bool showShortcutsInContextMenu();
|
||||
void setShowShortcutsInContextMenu(bool show);
|
||||
|
||||
private:
|
||||
|
@@ -769,7 +769,7 @@ void ICore::registerWindow(QWidget *window, const Context &context)
|
||||
|
||||
void ICore::openFiles(const QStringList &arguments, ICore::OpenFilesFlags flags)
|
||||
{
|
||||
m_mainwindow->openFiles(arguments, flags);
|
||||
MainWindow::openFiles(arguments, flags);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@@ -227,7 +227,7 @@ QList<IWizardFactory*> IWizardFactory::allWizardFactories()
|
||||
return s_allFactories;
|
||||
}
|
||||
|
||||
QString IWizardFactory::runPath(const QString &defaultPath)
|
||||
QString IWizardFactory::runPath(const QString &defaultPath) const
|
||||
{
|
||||
QString path = defaultPath;
|
||||
if (path.isEmpty()) {
|
||||
@@ -381,7 +381,7 @@ void IWizardFactory::clearWizardFactories()
|
||||
s_areFactoriesLoaded = false;
|
||||
}
|
||||
|
||||
QSet<Id> IWizardFactory::pluginFeatures() const
|
||||
QSet<Id> IWizardFactory::pluginFeatures()
|
||||
{
|
||||
static QSet<Id> plugins;
|
||||
if (plugins.isEmpty()) {
|
||||
@@ -394,7 +394,7 @@ QSet<Id> IWizardFactory::pluginFeatures() const
|
||||
return plugins;
|
||||
}
|
||||
|
||||
QSet<Id> IWizardFactory::availableFeatures(Id platformId) const
|
||||
QSet<Id> IWizardFactory::availableFeatures(Id platformId)
|
||||
{
|
||||
QSet<Id> availableFeatures;
|
||||
|
||||
|
@@ -83,7 +83,7 @@ public:
|
||||
void addRequiredFeature(const Utils::Id &feature) { m_requiredFeatures |= feature; }
|
||||
void setFlags(WizardFlags flags) { m_flags = flags; }
|
||||
|
||||
QString runPath(const QString &defaultPath);
|
||||
QString runPath(const QString &defaultPath) const;
|
||||
|
||||
// Does bookkeeping and the calls runWizardImpl. Please implement that.
|
||||
Utils::Wizard *runWizard(const QString &path, QWidget *parent, Utils::Id platform,
|
||||
@@ -111,8 +111,8 @@ public:
|
||||
const QVariantMap &extraVariables);
|
||||
|
||||
protected:
|
||||
QSet<Utils::Id> pluginFeatures() const;
|
||||
QSet<Utils::Id> availableFeatures(Utils::Id platformId) const;
|
||||
static QSet<Utils::Id> pluginFeatures();
|
||||
static QSet<Utils::Id> availableFeatures(Utils::Id platformId);
|
||||
|
||||
virtual Utils::Wizard *runWizardImpl(const QString &path, QWidget *parent, Utils::Id platform,
|
||||
const QVariantMap &variables) = 0;
|
||||
|
@@ -118,7 +118,7 @@ void BaseFileFilter::prepareSearch(const QString &entry)
|
||||
}
|
||||
|
||||
ILocatorFilter::MatchLevel BaseFileFilter::matchLevelFor(const QRegularExpressionMatch &match,
|
||||
const QString &matchText) const
|
||||
const QString &matchText)
|
||||
{
|
||||
const int consecutivePos = match.capturedStart(1);
|
||||
if (consecutivePos == 0)
|
||||
|
@@ -76,7 +76,8 @@ protected:
|
||||
QSharedPointer<Iterator> fileIterator();
|
||||
|
||||
private:
|
||||
MatchLevel matchLevelFor(const QRegularExpressionMatch &match, const QString &matchText) const;
|
||||
static MatchLevel matchLevelFor(const QRegularExpressionMatch &match,
|
||||
const QString &matchText);
|
||||
void updatePreviousResultData();
|
||||
|
||||
Internal::BaseFileFilterPrivate *d = nullptr;
|
||||
|
@@ -47,7 +47,7 @@ using namespace Core::Internal;
|
||||
using namespace Utils;
|
||||
|
||||
ILocatorFilter::MatchLevel FileSystemFilter::matchLevelFor(const QRegularExpressionMatch &match,
|
||||
const QString &matchText) const
|
||||
const QString &matchText)
|
||||
{
|
||||
const int consecutivePos = match.capturedStart(1);
|
||||
if (consecutivePos == 0)
|
||||
|
@@ -53,7 +53,7 @@ public:
|
||||
void refresh(QFutureInterface<void> &) override {}
|
||||
|
||||
private:
|
||||
MatchLevel matchLevelFor(const QRegularExpressionMatch &match, const QString &matchText) const;
|
||||
static MatchLevel matchLevelFor(const QRegularExpressionMatch &match, const QString &matchText);
|
||||
|
||||
bool m_includeHidden = true;
|
||||
QString m_currentDocumentDirectory;
|
||||
|
@@ -156,7 +156,7 @@ public:
|
||||
static Qt::CaseSensitivity caseSensitivity(const QString &str);
|
||||
static QRegularExpression createRegExp(const QString &text,
|
||||
Qt::CaseSensitivity caseSensitivity = Qt::CaseInsensitive);
|
||||
LocatorFilterEntry::HighlightInfo highlightInfo(const QRegularExpressionMatch &match,
|
||||
static LocatorFilterEntry::HighlightInfo highlightInfo(const QRegularExpressionMatch &match,
|
||||
LocatorFilterEntry::HighlightInfo::DataType dataType = LocatorFilterEntry::HighlightInfo::DisplayName);
|
||||
|
||||
static QString msgConfigureDialogTitle();
|
||||
|
@@ -76,7 +76,7 @@ private:
|
||||
void showPopupDelayed();
|
||||
void showPopupNow();
|
||||
void acceptEntry(int row);
|
||||
void showConfigureDialog();
|
||||
static void showConfigureDialog();
|
||||
void addSearchResults(int firstIndex, int endIndex);
|
||||
void handleSearchFinished();
|
||||
void updateFilterList();
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
||||
void updateCompletionList(const QString &text);
|
||||
QList<ILocatorFilter*> filtersFor(const QString &text, QString &searchText);
|
||||
static QList<ILocatorFilter*> filtersFor(const QString &text, QString &searchText);
|
||||
void setProgressIndicatorVisible(bool visible);
|
||||
|
||||
LocatorModel *m_locatorModel = nullptr;
|
||||
|
@@ -148,7 +148,7 @@ MainWindow::MainWindow()
|
||||
|
||||
QApplication::setStyle(new ManhattanStyle(baseName));
|
||||
m_generalSettings->setShowShortcutsInContextMenu(
|
||||
m_generalSettings->showShortcutsInContextMenu());
|
||||
GeneralSettings::showShortcutsInContextMenu());
|
||||
|
||||
setDockNestingEnabled(true);
|
||||
|
||||
|
@@ -89,9 +89,9 @@ public:
|
||||
void addContextObject(IContext *context);
|
||||
void removeContextObject(IContext *context);
|
||||
|
||||
IDocument *openFiles(const QStringList &fileNames,
|
||||
ICore::OpenFilesFlags flags,
|
||||
const QString &workingDirectory = QString());
|
||||
static IDocument *openFiles(const QStringList &fileNames,
|
||||
ICore::OpenFilesFlags flags,
|
||||
const QString &workingDirectory = QString());
|
||||
|
||||
inline SettingsDatabase *settingsDatabase() const { return m_settingsDatabase; }
|
||||
virtual QPrinter *printer() const;
|
||||
@@ -117,16 +117,16 @@ public:
|
||||
void restart();
|
||||
|
||||
public slots:
|
||||
void openFileWith();
|
||||
static void openFileWith();
|
||||
void exit();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
private:
|
||||
void openFile();
|
||||
static void openFile();
|
||||
void aboutToShowRecentFiles();
|
||||
void setFocusToEditor();
|
||||
static void setFocusToEditor();
|
||||
void aboutQtCreator();
|
||||
void aboutPlugins();
|
||||
void updateFocusWidget(QWidget *old, QWidget *now);
|
||||
|
@@ -1174,7 +1174,7 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
||||
}
|
||||
}
|
||||
|
||||
void ManhattanStyle::drawButtonSeparator(QPainter *painter, const QRect &rect, bool reverse) const
|
||||
void ManhattanStyle::drawButtonSeparator(QPainter *painter, const QRect &rect, bool reverse)
|
||||
{
|
||||
const QRectF borderRect = QRectF(rect).adjusted(0.5, 0.5, -0.5, -0.5);
|
||||
if (creatorTheme()->flag(Theme::FlatToolBars)) {
|
||||
|
@@ -67,7 +67,7 @@ public:
|
||||
void unpolish(QApplication *app) override;
|
||||
|
||||
private:
|
||||
void drawButtonSeparator(QPainter *painter, const QRect &rect, bool reverse) const;
|
||||
static void drawButtonSeparator(QPainter *painter, const QRect &rect, bool reverse);
|
||||
|
||||
ManhattanStylePrivate *d;
|
||||
};
|
||||
|
@@ -121,7 +121,7 @@ MagicData MimeTypeMagicDialog::magicData() const
|
||||
}
|
||||
|
||||
|
||||
bool MagicData::operator==(const MagicData &other)
|
||||
bool MagicData::operator==(const MagicData &other) const
|
||||
{
|
||||
return m_priority == other.m_priority && m_rule == other.m_rule;
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
bool operator==(const MagicData &other);
|
||||
bool operator==(const MagicData &other) const;
|
||||
bool operator!=(const MagicData &other) { return !(*this == other); }
|
||||
|
||||
static QByteArray normalizedMask(const Utils::Internal::MimeMagicRule &rule);
|
||||
|
@@ -84,7 +84,7 @@ public:
|
||||
class UserMimeType
|
||||
{
|
||||
public:
|
||||
bool isValid() { return !name.isEmpty(); }
|
||||
bool isValid() const { return !name.isEmpty(); }
|
||||
QString name;
|
||||
QStringList globPatterns;
|
||||
QMap<int, QList<Utils::Internal::MimeMagicRule> > rules;
|
||||
|
@@ -59,7 +59,7 @@ public slots:
|
||||
void slotHide();
|
||||
void slotNext();
|
||||
void slotPrev();
|
||||
void toggleMaximized();
|
||||
static void toggleMaximized();
|
||||
|
||||
protected:
|
||||
void focusInEvent(QFocusEvent *e) override;
|
||||
|
@@ -159,7 +159,7 @@ QWidget *RightPaneWidget::widget() const
|
||||
return m_widget;
|
||||
}
|
||||
|
||||
int RightPaneWidget::storedWidth()
|
||||
int RightPaneWidget::storedWidth() const
|
||||
{
|
||||
return m_width;
|
||||
}
|
||||
@@ -197,7 +197,7 @@ void RightPaneWidget::setShown(bool b)
|
||||
m_shown = b;
|
||||
}
|
||||
|
||||
bool RightPaneWidget::isShown()
|
||||
bool RightPaneWidget::isShown() const
|
||||
{
|
||||
return m_shown;
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ public:
|
||||
void saveSettings(Utils::QtcSettings *settings);
|
||||
void readSettings(QSettings *settings);
|
||||
|
||||
bool isShown();
|
||||
bool isShown() const;
|
||||
void setShown(bool b);
|
||||
|
||||
static RightPaneWidget *instance();
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
void setWidget(QWidget *widget);
|
||||
QWidget *widget() const;
|
||||
|
||||
int storedWidth();
|
||||
int storedWidth() const;
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *) override;
|
||||
|
@@ -79,7 +79,7 @@ public:
|
||||
QString topLevel;
|
||||
};
|
||||
|
||||
Utils::optional<VcsInfo> findInCache(const QString &dir)
|
||||
Utils::optional<VcsInfo> findInCache(const QString &dir) const
|
||||
{
|
||||
QTC_ASSERT(QDir(dir).isAbsolute(), return Utils::nullopt);
|
||||
QTC_ASSERT(!dir.endsWith(QLatin1Char('/')), return Utils::nullopt);
|
||||
|
Reference in New Issue
Block a user