forked from qt-creator/qt-creator
BaseFileFind: Some cleanup, also in derived classes
Change-Id: I1fb3d3937543f9c4fd8ca723410494cfc76322ee Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -266,7 +266,7 @@ SearchExecutor GitGrep::searchExecutor() const
|
||||
|
||||
EditorOpener GitGrep::editorOpener() const
|
||||
{
|
||||
return [params = gitParameters()](const Utils::SearchResultItem &item,
|
||||
return [params = gitParameters()](const SearchResultItem &item,
|
||||
const FileFindParameters ¶meters) -> IEditor * {
|
||||
const QStringList &itemPath = item.path();
|
||||
if (params.ref.isEmpty() || itemPath.isEmpty())
|
||||
|
||||
@@ -11,14 +11,11 @@
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
|
||||
#include <texteditor/texteditor.h>
|
||||
#include <texteditor/textdocument.h>
|
||||
|
||||
#include <utils/filesearch.h>
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QSettings>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
#include "projecttree.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/filesearch.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QSettings>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
@@ -24,7 +22,7 @@ CurrentProjectFind::CurrentProjectFind()
|
||||
connect(ProjectTree::instance(), &ProjectTree::currentProjectChanged,
|
||||
this, &CurrentProjectFind::handleProjectChanged);
|
||||
connect(ProjectManager::instance(), &ProjectManager::projectDisplayNameChanged,
|
||||
this, [this](ProjectExplorer::Project *p) {
|
||||
this, [this](Project *p) {
|
||||
if (p == ProjectTree::currentProject())
|
||||
emit displayNameChanged();
|
||||
});
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/filesearch.h>
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
|
||||
@@ -19,22 +19,19 @@
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/fadingindicator.h>
|
||||
#include <utils/filesearch.h>
|
||||
#include <utils/futuresynchronizer.h>
|
||||
#include <utils/process.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/stylehelper.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QSettings>
|
||||
#include <QHash>
|
||||
#include <QPair>
|
||||
#include <QPromise>
|
||||
#include <QStringListModel>
|
||||
#include <QFutureWatcher>
|
||||
#include <QPointer>
|
||||
#include <QComboBox>
|
||||
#include <QFutureWatcher>
|
||||
#include <QHash>
|
||||
#include <QLabel>
|
||||
#include <QPair>
|
||||
#include <QPointer>
|
||||
#include <QPromise>
|
||||
#include <QSettings>
|
||||
#include <QStringListModel>
|
||||
|
||||
using namespace Utils;
|
||||
using namespace Core;
|
||||
@@ -389,9 +386,8 @@ void BaseFileFind::doReplace(const QString &text, const SearchResultItems &items
|
||||
{
|
||||
const FilePaths files = replaceAll(text, items, preserveCase);
|
||||
if (!files.isEmpty()) {
|
||||
Utils::FadingIndicator::showText(ICore::dialogParent(),
|
||||
Tr::tr("%n occurrences replaced.", nullptr, items.size()),
|
||||
Utils::FadingIndicator::SmallText);
|
||||
FadingIndicator::showText(ICore::dialogParent(),
|
||||
Tr::tr("%n occurrences replaced.", nullptr, items.size()), FadingIndicator::SmallText);
|
||||
DocumentManager::notifyFilesChangedInternally(files);
|
||||
SearchResultWindow::instance()->hide();
|
||||
}
|
||||
@@ -428,7 +424,7 @@ QList<QPair<QWidget *, QWidget *>> BaseFileFind::createPatternWidgets()
|
||||
syncComboWithSettings(d->m_filterCombo, d->m_filterSetting);
|
||||
QLabel *exclusionLabel = createLabel(msgExclusionPatternLabel());
|
||||
d->m_exclusionCombo = createCombo(&d->m_exclusionStrings);
|
||||
d->m_exclusionCombo->setToolTip(msgFilePatternToolTip(Utils::InclusionType::Excluded));
|
||||
d->m_exclusionCombo->setToolTip(msgFilePatternToolTip(InclusionType::Excluded));
|
||||
exclusionLabel->setBuddy(d->m_exclusionCombo);
|
||||
syncComboWithSettings(d->m_exclusionCombo, d->m_exclusionSetting);
|
||||
return {{filterLabel, d->m_filterCombo}, {exclusionLabel, d->m_exclusionCombo}};
|
||||
|
||||
@@ -6,13 +6,9 @@
|
||||
#include "textdocument.h"
|
||||
#include "texteditortr.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
|
||||
#include <utils/filesearch.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
@@ -9,20 +9,13 @@
|
||||
#include <coreplugin/find/findplugin.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <utils/filesearch.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/historycompleter.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/stringutils.h>
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QSettings>
|
||||
#include <QStackedWidget>
|
||||
|
||||
@@ -153,7 +146,7 @@ QWidget *FindInFiles::createConfigWidget()
|
||||
/*restoreLastItemFromHistory=*/ true);
|
||||
if (!HistoryCompleter::historyExistsFor(QLatin1String(HistoryKey))) {
|
||||
auto completer = static_cast<HistoryCompleter *>(m_directory->lineEdit()->completer());
|
||||
const QStringList legacyHistory = Core::ICore::settings()->value(
|
||||
const QStringList legacyHistory = ICore::settings()->value(
|
||||
QLatin1String("Find/FindInFiles/directories")).toStringList();
|
||||
for (const QString &dir: legacyHistory)
|
||||
completer->addEntry(dir);
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
|
||||
#include "basefilefind.h"
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QPointer>
|
||||
#include <QStringListModel>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QComboBox;
|
||||
|
||||
@@ -6,12 +6,9 @@
|
||||
#include "textdocument.h"
|
||||
#include "texteditortr.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/editormanager/documentmodel.h>
|
||||
|
||||
#include <utils/filesearch.h>
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
Reference in New Issue
Block a user