diff options
author | hjk <[email protected]> | 2020-06-23 18:36:26 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2020-06-24 05:48:56 +0000 |
commit | 9efa934ae099585bb63e5daeade8e4989523b961 (patch) | |
tree | ec715bf9551e9bd3da5a8114c8d84cd0d0dc00a9 /src/plugins/clearcase/clearcasesync.cpp | |
parent | a6fe2efd4e7409c99c2adc5e0911a540b86ae81e (diff) |
ClearCase: Drop QRegExp use
Change-Id: Ia47d2efec42e9df59c5d30a695b4becee942e085
Reviewed-by: Orgad Shaneh <[email protected]>
Diffstat (limited to 'src/plugins/clearcase/clearcasesync.cpp')
-rw-r--r-- | src/plugins/clearcase/clearcasesync.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/clearcase/clearcasesync.cpp b/src/plugins/clearcase/clearcasesync.cpp index cc8efeb0c5d..939badec15d 100644 --- a/src/plugins/clearcase/clearcasesync.cpp +++ b/src/plugins/clearcase/clearcasesync.cpp @@ -29,7 +29,7 @@ #include <QDir> #include <QFutureInterface> #include <QProcess> -#include <QRegExp> +#include <QRegularExpression> #include <QStringList> #include <utils/qtcassert.h> @@ -85,17 +85,19 @@ void ClearCaseSync::processCleartoolLsLine(const QDir &viewRootDir, const QStrin return; // find first whitespace. anything before that is not interesting - const int wspos = buffer.indexOf(QRegExp(QLatin1String("\\s"))); + const int wspos = buffer.indexOf(QRegularExpression("\\s")); const QString absFile = viewRootDir.absoluteFilePath( QDir::fromNativeSeparators(buffer.left(atatpos))); QTC_CHECK(QFileInfo::exists(absFile)); QTC_CHECK(!absFile.isEmpty()); - QString ccState; - const QRegExp reState(QLatin1String("^\\s*\\[[^\\]]*\\]")); // [hijacked]; [loaded but missing] - if (reState.indexIn(buffer, wspos + 1, QRegExp::CaretAtOffset) != -1) { - ccState = reState.cap(); + const QRegularExpression reState("^\\s*\\[[^\\]]*\\]"); // [hijacked]; [loaded but missing] + const QRegularExpressionMatch match = reState.match(buffer, wspos + 1, + QRegularExpression::NormalMatch, + QRegularExpression::AnchorAtOffsetMatchOption); + if (match.hasMatch()) { + const QString ccState = match.captured(); if (ccState.indexOf(QLatin1String("hijacked")) != -1) ClearCasePlugin::setStatus(absFile, FileStatus::Hijacked, true); else if (ccState.indexOf(QLatin1String("loaded but missing")) != -1) |