forked from qt-creator/qt-creator
Git: Minor cleanup
* Remove unused includes * Remove QObject qualification * Use a raw pointer for widget instead of QPointer. It is owned by GitGrep. Change-Id: I4e2c9878289ed3491bfd7b0565a683bc01e485f3 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
974070d2c8
commit
71166d06d0
@@ -45,12 +45,11 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
using namespace Utils;
|
|
||||||
|
|
||||||
namespace Git {
|
namespace Git {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
using namespace Utils;
|
||||||
using VcsBase::VcsCommand;
|
using VcsBase::VcsCommand;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -187,8 +186,8 @@ GitGrep::GitGrep()
|
|||||||
"that are managed by source control."));
|
"that are managed by source control."));
|
||||||
TextEditor::FindInFiles *findInFiles = TextEditor::FindInFiles::instance();
|
TextEditor::FindInFiles *findInFiles = TextEditor::FindInFiles::instance();
|
||||||
QTC_ASSERT(findInFiles, return);
|
QTC_ASSERT(findInFiles, return);
|
||||||
QObject::connect(findInFiles, &TextEditor::FindInFiles::pathChanged,
|
connect(findInFiles, &TextEditor::FindInFiles::pathChanged,
|
||||||
m_widget.data(), [this](const QString &path) {
|
m_widget, [this](const QString &path) {
|
||||||
m_widget->setEnabled(validateDirectory(path));
|
m_widget->setEnabled(validateDirectory(path));
|
||||||
});
|
});
|
||||||
findInFiles->setFindExtension(this);
|
findInFiles->setFindExtension(this);
|
||||||
@@ -196,7 +195,7 @@ GitGrep::GitGrep()
|
|||||||
|
|
||||||
GitGrep::~GitGrep()
|
GitGrep::~GitGrep()
|
||||||
{
|
{
|
||||||
delete m_widget.data();
|
delete m_widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GitGrep::title() const
|
QString GitGrep::title() const
|
||||||
@@ -206,7 +205,7 @@ QString GitGrep::title() const
|
|||||||
|
|
||||||
QWidget *GitGrep::widget() const
|
QWidget *GitGrep::widget() const
|
||||||
{
|
{
|
||||||
return m_widget.data();
|
return m_widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GitGrep::isEnabled() const
|
bool GitGrep::isEnabled() const
|
||||||
|
|||||||
@@ -30,9 +30,6 @@
|
|||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
#include <QPointer>
|
|
||||||
#include <QStringListModel>
|
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QCheckBox)
|
QT_FORWARD_DECLARE_CLASS(QCheckBox)
|
||||||
|
|
||||||
namespace Git {
|
namespace Git {
|
||||||
@@ -56,7 +53,7 @@ public:
|
|||||||
const TextEditor::FileFindParameters ¶meters) override;
|
const TextEditor::FileFindParameters ¶meters) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<QCheckBox> m_widget;
|
QCheckBox *m_widget;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user