summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-08-06 16:19:48 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-08-06 16:19:48 (GMT)
commitf15cd5c8f9b8fe867ae62d04eedb9c9cb7d5b250 (patch)
treea250f56120aaf9865400948a9347f024a5833d08
parent6a49b5c220b141f29dbff9fbc30a27b7ff320d47 (diff)
delete dangerous constructor
-rw-r--r--src/part/fileTree.h3
-rw-r--r--src/part/scan.cpp3
2 files changed, 3 insertions, 3 deletions
diff --git a/src/part/fileTree.h b/src/part/fileTree.h
index f6fb6c6..bad4097 100644
--- a/src/part/fileTree.h
+++ b/src/part/fileTree.h
@@ -76,7 +76,8 @@ template <class T>
class Iterator
{
public:
- Iterator() : link(0) { } //**** remove this, remove this REMOVE THIS!!! dangerous as your implementation doesn't test for null links, always assumes they can be derefenced
+ Iterator() = delete;
+
Iterator(Link<T> *p) : link(p) { }
bool operator==(const Iterator<T>& it) const {
diff --git a/src/part/scan.cpp b/src/part/scan.cpp
index d762ecf..567d637 100644
--- a/src/part/scan.cpp
+++ b/src/part/scan.cpp
@@ -114,10 +114,9 @@ bool ScanManager::start(const QUrl &url)
QVector<QStringRef> split = path.midRef(cachePath.length()).split(QLatin1Char('/'));
Folder *d = *it;
- Iterator<File> jt;
while (!split.isEmpty() && d != NULL) { //if NULL we have got lost so abort!!
- jt = d->iterator();
+ Iterator<File> jt = d->iterator();
const Link<File> *end = d->end();
if (split.first().isEmpty()) { //found the dir