aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/gitgrep.cpp
diff options
context:
space:
mode:
authorTobias Hunger <[email protected]>2016-02-10 11:19:27 +0100
committerTobias Hunger <[email protected]>2016-02-10 15:01:57 +0000
commitb4195d51746d86f4aa459d07d14a328c7945981a (patch)
treeca13ba842a38e2514a923eb6a9ecadd439159110 /src/plugins/git/gitgrep.cpp
parent7db0023e8c97336e0e449552410de674bbe2ffd0 (diff)
Git: Modernize
* pragma once * member initialization * s/struct/class/ * Introduce a static GitPlugin::client() method and use it Change-Id: Ifdcac86dd16f3cdba11d564d03e9a15f00a6afdb Reviewed-by: Orgad Shaneh <[email protected]>
Diffstat (limited to 'src/plugins/git/gitgrep.cpp')
-rw-r--r--src/plugins/git/gitgrep.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp
index 390a546f64a..ec3bff0737b 100644
--- a/src/plugins/git/gitgrep.cpp
+++ b/src/plugins/git/gitgrep.cpp
@@ -151,8 +151,7 @@ public:
m_ref = params.ref + QLatin1Char(':');
}
arguments << QLatin1String("--") << m_parameters.nameFilters;
- GitClient *client = GitPlugin::instance()->client();
- QScopedPointer<VcsCommand> command(client->createCommand(m_directory));
+ QScopedPointer<VcsCommand> command(GitPlugin::client()->createCommand(m_directory));
command->addFlags(VcsCommand::SilentOutput);
command->setProgressiveOutput(true);
QFutureWatcher<FileSearchResultList> watcher;
@@ -160,7 +159,7 @@ public:
connect(&watcher, &QFutureWatcher<FileSearchResultList>::canceled,
command.data(), &VcsCommand::cancel);
connect(command.data(), &VcsCommand::stdOutText, this, &GitGrepRunner::read);
- SynchronousProcessResponse resp = command->runCommand(client->vcsBinary(), arguments, 0);
+ SynchronousProcessResponse resp = command->runCommand(GitPlugin::client()->vcsBinary(), arguments, 0);
switch (resp.result) {
case SynchronousProcessResponse::TerminatedAbnormally:
case SynchronousProcessResponse::StartFailed:
@@ -292,11 +291,10 @@ IEditor *GitGrep::openEditor(const SearchResultItem &item,
return nullptr;
const QString path = QDir::fromNativeSeparators(item.path.first());
QByteArray content;
- GitClient *client = GitPlugin::instance()->client();
const QString topLevel = parameters.additionalParameters.toString();
const QString relativePath = QDir(topLevel).relativeFilePath(path);
- if (!client->synchronousShow(topLevel, params.ref + QLatin1String(":./") + relativePath,
- &content, nullptr)) {
+ if (!GitPlugin::client()->synchronousShow(topLevel, params.ref + QLatin1String(":./") + relativePath,
+ &content, nullptr)) {
return nullptr;
}
if (content.isEmpty())