diff options
Diffstat (limited to 'src/plugins/bazaar/bazaarclient.cpp')
-rw-r--r-- | src/plugins/bazaar/bazaarclient.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/plugins/bazaar/bazaarclient.cpp b/src/plugins/bazaar/bazaarclient.cpp index 6fca62d459..84ff8c7d7d 100644 --- a/src/plugins/bazaar/bazaarclient.cpp +++ b/src/plugins/bazaar/bazaarclient.cpp @@ -26,8 +26,6 @@ #include "bazaarclient.h" #include "constants.h" -#include <coreplugin/id.h> - #include <vcsbase/vcsbaseplugin.h> #include <vcsbase/vcsoutputwindow.h> #include <vcsbase/vcsbaseeditorconfig.h> @@ -36,7 +34,7 @@ #include <QDir> #include <QFileInfo> -#include <QRegExp> +#include <QRegularExpression> #include <QTextStream> #include <QDebug> @@ -123,14 +121,18 @@ BranchInfo BazaarClient::synchronousBranchQuery(const QString &repositoryRoot) c QTextStream ts(&branchConfFile); QString branchLocation; QString isBranchBound; - QRegExp branchLocationRx(QLatin1String("bound_location\\s*=\\s*(.+)$")); - QRegExp isBranchBoundRx(QLatin1String("bound\\s*=\\s*(.+)$")); + QRegularExpression branchLocationRx("bound_location\\s*=\\s*(.+)$"); + QRegularExpression isBranchBoundRx("bound\\s*=\\s*(.+)$"); while (!ts.atEnd() && (branchLocation.isEmpty() || isBranchBound.isEmpty())) { const QString line = ts.readLine(); - if (branchLocationRx.indexIn(line) != -1) - branchLocation = branchLocationRx.cap(1); - else if (isBranchBoundRx.indexIn(line) != -1) - isBranchBound = isBranchBoundRx.cap(1); + QRegularExpressionMatch match = branchLocationRx.match(line); + if (match.hasMatch()) { + branchLocation = match.captured(1); + } else { + QRegularExpressionMatch match = isBranchBoundRx.match(line); + if (match.hasMatch()) + isBranchBound = match.captured(1); + } } if (isBranchBound.simplified().toLower() == QLatin1String("true")) return BranchInfo(branchLocation, true); @@ -202,7 +204,7 @@ void BazaarClient::view(const QString &source, const QString &id, const QStringL VcsBaseClient::view(source, id, args); } -Core::Id BazaarClient::vcsEditorKind(VcsCommandTag cmd) const +Utils::Id BazaarClient::vcsEditorKind(VcsCommandTag cmd) const { switch (cmd) { case AnnotateCommand: @@ -212,7 +214,7 @@ Core::Id BazaarClient::vcsEditorKind(VcsCommandTag cmd) const case LogCommand: return Constants::FILELOG_ID; default: - return Core::Id(); + return Utils::Id(); } } |