aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/help/HelpIndex.cpp
diff options
context:
space:
mode:
authorGravatar IceN9ne2017-10-21 23:35:01 -0400
committerGravatar IceN9ne2017-10-21 23:35:01 -0400
commit0f76c9b0c706764c334c1b0fa49842ccaddd8d94 (patch)
tree176348ef638ad6bb8ee56d564c3a5d932fc6d2f7 /src/modules/help/HelpIndex.cpp
parentFix typo introduced in e9f3c22 (diff)
downloadKVIrc-0f76c9b0c706764c334c1b0fa49842ccaddd8d94.tar.gz
KVIrc-0f76c9b0c706764c334c1b0fa49842ccaddd8d94.tar.bz2
KVIrc-0f76c9b0c706764c334c1b0fa49842ccaddd8d94.zip
General code cleanup and coverity fixes - mostly fixes uninitialized members
Diffstat (limited to 'src/modules/help/HelpIndex.cpp')
-rw-r--r--src/modules/help/HelpIndex.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/modules/help/HelpIndex.cpp b/src/modules/help/HelpIndex.cpp
index f34a9fc47..8b7db7720 100644
--- a/src/modules/help/HelpIndex.cpp
+++ b/src/modules/help/HelpIndex.cpp
@@ -55,10 +55,10 @@ QT_BEGIN_NAMESPACE
struct Term
{
- Term() : frequency(-1) {}
+ Term() = default;
Term(const QString & t, int f, QVector<Document> l) : term(t), frequency(f), documents(l) {}
QString term;
- int frequency;
+ int frequency = -1;
QVector<Document> documents;
bool operator<(const Term & i2) const { return frequency < i2.frequency; }
};
@@ -83,9 +83,8 @@ HelpIndex::HelpIndex(const QString & dp, const QString & hp)
Q_UNUSED(hp);
alreadyHaveDocList = false;
- lastWindowClosed = false;
- connect(qApp, SIGNAL(lastWindowClosed()),
- this, SLOT(setLastWinClosed()));
+
+ connect(qApp, SIGNAL(lastWindowClosed()), this, SLOT(setLastWinClosed()));
m_pTimer = new QTimer(this);
m_pTimer->setSingleShot(true);
@@ -94,12 +93,12 @@ HelpIndex::HelpIndex(const QString & dp, const QString & hp)
}
HelpIndex::HelpIndex(const QStringList & dl, const QString & hp)
- : QObject(nullptr)
+ : QObject(nullptr), docList{dl}
{
Q_UNUSED(hp);
- docList = dl;
+
alreadyHaveDocList = true;
- lastWindowClosed = false;
+
connect(qApp, SIGNAL(lastWindowClosed()), this, SLOT(setLastWinClosed()));
}