Skip to content

Commit

Permalink
Fix parsing of newer NordVPN cli versions
Browse files Browse the repository at this point in the history
Fixes #6
  • Loading branch information
alex1701c committed Jul 14, 2022
1 parent 4eeb663 commit 699531a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@

QString Utilities::filterBeginning(QString &str) {
static const QRegularExpression cleanupRegex(R"(^[\r\\\|/\- ]*)");
// https://github.com/alex1701c/NordVPNKrunner/issues/6
str.remove(QLatin1String("\r-\r"));
str.remove(QLatin1Char('\r'));

str = str.remove("A new version of NordVPN is available! Please update the application.\n");
static const QRegularExpression newFeatureRegex(QStringLiteral("^New feature -.*\n"));
str = str.remove(newFeatureRegex).trimmed();
return str.remove(cleanupRegex);
}

Expand Down

0 comments on commit 699531a

Please sign in to comment.