diff options
Diffstat (limited to 'src/modules/help')
| -rw-r--r-- | src/modules/help/HelpIndex.cpp | 20 | ||||
| -rw-r--r-- | src/modules/help/HelpIndex.h | 4 | ||||
| -rw-r--r-- | src/modules/help/HelpWindow.cpp | 2 |
3 files changed, 17 insertions, 9 deletions
diff --git a/src/modules/help/HelpIndex.cpp b/src/modules/help/HelpIndex.cpp index 8b7db7720..4e37eca2e 100644 --- a/src/modules/help/HelpIndex.cpp +++ b/src/modules/help/HelpIndex.cpp @@ -45,18 +45,24 @@ #include <QTextStream> #include <QUrl> #include <QTextCodec> -#include <ctype.h> +#include <cctype> #include <QTextDocument> #include <QTimer> #include <algorithm> +#include <utility> QT_BEGIN_NAMESPACE struct Term { Term() = default; - Term(const QString & t, int f, QVector<Document> l) : term(t), frequency(f), documents(l) {} + Term(QString t, int f, QVector<Document> l) + : term(std::move(t)) + , frequency(f) + , documents(std::move(l)) + { + } QString term; int frequency = -1; QVector<Document> documents; @@ -77,8 +83,9 @@ QDataStream & operator<<(QDataStream & s, const Document & l) return s; } -HelpIndex::HelpIndex(const QString & dp, const QString & hp) - : QObject(nullptr), docPath(dp) +HelpIndex::HelpIndex(QString dp, const QString & hp) + : QObject(nullptr) + , docPath(std::move(dp)) { Q_UNUSED(hp); @@ -92,8 +99,9 @@ HelpIndex::HelpIndex(const QString & dp, const QString & hp) connect(m_pTimer, SIGNAL(timeout()), this, SLOT(filterNext())); } -HelpIndex::HelpIndex(const QStringList & dl, const QString & hp) - : QObject(nullptr), docList{dl} +HelpIndex::HelpIndex(QStringList dl, const QString & hp) + : QObject(nullptr) + , docList{ std::move(dl) } { Q_UNUSED(hp); diff --git a/src/modules/help/HelpIndex.h b/src/modules/help/HelpIndex.h index 968640699..5938ec136 100644 --- a/src/modules/help/HelpIndex.h +++ b/src/modules/help/HelpIndex.h @@ -93,8 +93,8 @@ public: QList<uint> positions; }; - HelpIndex(const QString & dp, const QString & hp); - HelpIndex(const QStringList & dl, const QString & hp); + HelpIndex(QString dp, const QString & hp); + HelpIndex(QStringList dl, const QString & hp); void writeDict(); void readDict(); void makeIndex(); diff --git a/src/modules/help/HelpWindow.cpp b/src/modules/help/HelpWindow.cpp index 8ae68e57b..c7140d641 100644 --- a/src/modules/help/HelpWindow.cpp +++ b/src/modules/help/HelpWindow.cpp @@ -186,7 +186,7 @@ void HelpWindow::startSearch() str = str.replace("`", "\""); QString buf = str; str = str.replace("-", " "); - str = str.replace(QRegExp("\\s[\\S]?\\s"), " "); + str = str.replace(QRegExp(R"(\s[\S]?\s)"), " "); m_terms = str.split(" ", QString::SkipEmptyParts); QStringList termSeq; QStringList seqWords; |
