Commit 71166d06 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

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: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 974070d2
......@@ -45,12 +45,11 @@
#include <QSettings>
#include <QTextStream>
using namespace Utils;
namespace Git {
namespace Internal {
using namespace Core;
using namespace Utils;
using VcsBase::VcsCommand;
namespace {
......@@ -187,8 +186,8 @@ GitGrep::GitGrep()
"that are managed by source control."));
TextEditor::FindInFiles *findInFiles = TextEditor::FindInFiles::instance();
QTC_ASSERT(findInFiles, return);
QObject::connect(findInFiles, &TextEditor::FindInFiles::pathChanged,
m_widget.data(), [this](const QString &path) {
connect(findInFiles, &TextEditor::FindInFiles::pathChanged,
m_widget, [this](const QString &path) {
m_widget->setEnabled(validateDirectory(path));
});
findInFiles->setFindExtension(this);
......@@ -196,7 +195,7 @@ GitGrep::GitGrep()
GitGrep::~GitGrep()
{
delete m_widget.data();
delete m_widget;
}
QString GitGrep::title() const
......@@ -206,7 +205,7 @@ QString GitGrep::title() const
QWidget *GitGrep::widget() const
{
return m_widget.data();
return m_widget;
}
bool GitGrep::isEnabled() const
......
......@@ -30,9 +30,6 @@
#include <utils/fileutils.h>
#include <QPointer>
#include <QStringListModel>
QT_FORWARD_DECLARE_CLASS(QCheckBox)
namespace Git {
......@@ -56,7 +53,7 @@ public:
const TextEditor::FileFindParameters &parameters) override;
private:
QPointer<QCheckBox> m_widget;
QCheckBox *m_widget;
};
} // namespace Internal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment