aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <[email protected]>2016-06-11 23:53:35 +0200
committerMartin T. H. Sandsmark <[email protected]>2016-06-11 23:53:35 +0200
commit874e420a89a05067c7e50d44a1d85277ea4b782a (patch)
tree14f2ccd3b6a9eb12347b68f5d628bcacae9cdb97
parenta4f1dc5bd4821539bf7840a91a9b01f4de2d3660 (diff)
Fix caching of remote, fix memory leak
-rw-r--r--src/part/localLister.cpp2
-rw-r--r--src/part/localLister.h2
-rw-r--r--src/part/remoteLister.cpp2
-rw-r--r--src/part/remoteLister.h2
-rw-r--r--src/part/scan.cpp7
-rw-r--r--src/part/scan.h2
6 files changed, 7 insertions, 10 deletions
diff --git a/src/part/localLister.cpp b/src/part/localLister.cpp
index e106736..1399ffc 100644
--- a/src/part/localLister.cpp
+++ b/src/part/localLister.cpp
@@ -90,7 +90,7 @@ LocalLister::run()
tree = 0;
}
qDebug() << "Emitting signal to cache results ...";
- emit branchCompleted(tree, true);
+ emit branchCompleted(tree);
qDebug() << "Thread terminating ...";
}
diff --git a/src/part/localLister.h b/src/part/localLister.h
index d9c6b4b..ea5acee 100644
--- a/src/part/localLister.h
+++ b/src/part/localLister.h
@@ -42,7 +42,7 @@ public:
static void readMounts();
signals:
- void branchCompleted(Folder* tree, bool finished);
+ void branchCompleted(Folder* tree);
private:
QString m_path;
diff --git a/src/part/remoteLister.cpp b/src/part/remoteLister.cpp
index 764e7b3..5a990a0 100644
--- a/src/part/remoteLister.cpp
+++ b/src/part/remoteLister.cpp
@@ -97,7 +97,7 @@ RemoteLister::~RemoteLister()
{
Folder *tree = isFinished() ? m_store->folder : 0;
- emit branchCompleted(tree, false);
+ emit branchCompleted(tree);
delete m_root;
}
diff --git a/src/part/remoteLister.h b/src/part/remoteLister.h
index 94267c3..289cf59 100644
--- a/src/part/remoteLister.h
+++ b/src/part/remoteLister.h
@@ -38,7 +38,7 @@ public:
~RemoteLister();
signals:
- void branchCompleted(Folder* tree, bool finished);
+ void branchCompleted(Folder* tree);
private slots:
void completed();
diff --git a/src/part/scan.cpp b/src/part/scan.cpp
index 4604880..d762ecf 100644
--- a/src/part/scan.cpp
+++ b/src/part/scan.cpp
@@ -187,7 +187,7 @@ void ScanManager::emptyCache()
m_cache->empty();
}
-void ScanManager::cacheTree(Folder *tree, bool finished)
+void ScanManager::cacheTree(Folder *tree)
{
QMutexLocker locker(&m_mutex); // This gets released once it is destroyed.
@@ -204,10 +204,7 @@ void ScanManager::cacheTree(Folder *tree, bool finished)
if (tree) {
//we don't cache foreign stuff
//we don't recache stuff (thus only type 1000 events)
- if (finished) {
- //TODO sanity check the cache
- m_cache->append(tree);
- }
+ m_cache->append(tree);
} else { //scan failed
m_cache->empty(); //FIXME this is safe but annoying
}
diff --git a/src/part/scan.h b/src/part/scan.h
index 74fcd15..7f0109f 100644
--- a/src/part/scan.h
+++ b/src/part/scan.h
@@ -56,7 +56,7 @@ public:
public slots:
bool abort();
void emptyCache();
- void cacheTree(Folder*, bool);
+ void cacheTree(Folder*);
void foundCached(Folder*);
signals: