Changeset View
Changeset View
Standalone View
Standalone View
transactions/kgpgtextorfiletransaction.cpp
Show All 13 Lines | |||||
14 | #include "kgpgtextorfiletransaction.h" | 14 | #include "kgpgtextorfiletransaction.h" | ||
15 | #include "kgpg_general_debug.h" | 15 | #include "kgpg_general_debug.h" | ||
16 | 16 | | |||
17 | #include "gpgproc.h" | 17 | #include "gpgproc.h" | ||
18 | 18 | | |||
19 | #include <KIO/Job> | 19 | #include <KIO/Job> | ||
20 | 20 | | |||
21 | 21 | | |||
22 | #include <QRegExp> | 22 | #include <QRegularExpression> | ||
23 | #include <QTemporaryFile> | 23 | #include <QTemporaryFile> | ||
24 | 24 | | |||
25 | KGpgTextOrFileTransaction::KGpgTextOrFileTransaction(QObject *parent, const QString &text, const bool allowChaining) | 25 | KGpgTextOrFileTransaction::KGpgTextOrFileTransaction(QObject *parent, const QString &text, const bool allowChaining) | ||
26 | : KGpgTransaction(parent, allowChaining) | 26 | : KGpgTransaction(parent, allowChaining) | ||
27 | { | 27 | { | ||
28 | setText(text); | 28 | setText(text); | ||
29 | } | 29 | } | ||
30 | 30 | | |||
Show All 9 Lines | |||||
40 | } | 40 | } | ||
41 | 41 | | |||
42 | void | 42 | void | ||
43 | KGpgTextOrFileTransaction::setText(const QString &text) | 43 | KGpgTextOrFileTransaction::setText(const QString &text) | ||
44 | { | 44 | { | ||
45 | m_text = text; | 45 | m_text = text; | ||
46 | cleanUrls(); | 46 | cleanUrls(); | ||
47 | 47 | | |||
48 | int begin = text.indexOf(QRegExp(QLatin1String("^(.*\n)?-----BEGIN PGP [A-Z ]*-----\r?\n"))); | 48 | int begin = text.indexOf(QRegularExpression(QStringLiteral("^(.*\n)?-----BEGIN PGP [A-Z ]*-----\r?\n"))); | ||
49 | if (begin < 0) | 49 | if (begin < 0) | ||
50 | return; | 50 | return; | ||
51 | 51 | | |||
52 | // find the end of the BEGIN PGP ... line | 52 | // find the end of the BEGIN PGP ... line | ||
53 | static const QChar lf = QLatin1Char('\n'); | 53 | static const QChar lf = QLatin1Char('\n'); | ||
54 | begin = text.indexOf(lf, begin); | 54 | begin = text.indexOf(lf, begin); | ||
55 | Q_ASSERT(begin > 0); | 55 | Q_ASSERT(begin > 0); | ||
56 | 56 | | |||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |