diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2020-05-31 17:38:30 +0200 |
---|---|---|
committer | Anne Jan Brouwer <brouwer@annejan.com> | 2020-05-31 17:38:30 +0200 |
commit | f803f9d481fc2886c695ddff35776d5aed3cec13 (patch) | |
tree | f5b0042e4fb2e5ac1d3ecaf08445e201292bf7c5 | |
parent | ed15f31e5887495f5092458c945d212ff05a7290 (diff) |
Fallback for deprecated feature
-rw-r--r-- | src/imitatepass.cpp | 4 | ||||
-rw-r--r-- | src/keygendialog.cpp | 8 | ||||
-rw-r--r-- | src/pass.cpp | 4 |
3 files changed, 16 insertions, 0 deletions
diff --git a/src/imitatepass.cpp b/src/imitatepass.cpp index e4314d90..57395134 100644 --- a/src/imitatepass.cpp +++ b/src/imitatepass.cpp @@ -263,7 +263,11 @@ void ImitatePass::reencryptPath(const QString &dir) { exec.executeBlocking(QtPassSettings::getGpgExecutable(), args, &keys, &err); QStringList actualKeys; keys += err; +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) QStringList key = keys.split(QRegExp("[\r\n]"), Qt::SkipEmptyParts); +#else + QStringList key = keys.split(QRegExp("[\r\n]"), QString::SkipEmptyParts); +#endif QListIterator<QString> itr(key); while (itr.hasNext()) { QString current = itr.next(); diff --git a/src/keygendialog.cpp b/src/keygendialog.cpp index e9a74342..e8abe389 100644 --- a/src/keygendialog.cpp +++ b/src/keygendialog.cpp @@ -83,7 +83,11 @@ void KeygenDialog::on_name_textChanged(const QString &arg1) { void KeygenDialog::replace(const QString &key, const QString &value) { QStringList clear; QString expert = ui->plainTextEdit->toPlainText(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) QStringList lines = expert.split(QRegExp("[\r\n]"), Qt::SkipEmptyParts); +#else + QStringList lines = expert.split(QRegExp("[\r\n]"), QString::SkipEmptyParts); +#endif foreach (QString line, lines) { line.replace(QRegExp(key + ":.*"), key + ": " + value); if (key == "Passphrase") @@ -101,7 +105,11 @@ void KeygenDialog::replace(const QString &key, const QString &value) { void KeygenDialog::no_protection(bool enable) { QStringList clear; QString expert = ui->plainTextEdit->toPlainText(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) QStringList lines = expert.split(QRegExp("[\r\n]"), Qt::SkipEmptyParts); +#else + QStringList lines = expert.split(QRegExp("[\r\n]"), QString::SkipEmptyParts); +#endif foreach (QString line, lines) { bool remove = false; if (!enable) { diff --git a/src/pass.cpp b/src/pass.cpp index 5e2b4ee1..d7f4a8ca 100644 --- a/src/pass.cpp +++ b/src/pass.cpp @@ -139,7 +139,11 @@ QList<UserInfo> Pass::listKeys(QStringList keystrings, bool secret) { if (exec.executeBlocking(QtPassSettings::getGpgExecutable(), args, &p_out) != 0) return users; +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) QStringList keys = p_out.split(QRegExp("[\r\n]"), Qt::SkipEmptyParts); +#else + QStringList keys = p_out.split(QRegExp("[\r\n]"), QString::SkipEmptyParts); +#endif UserInfo current_user; foreach (QString key, keys) { QStringList props = key.split(':'); |