Fix caching of remote, fix memory leak

parent a4f1dc5b
......@@ -90,7 +90,7 @@ LocalLister::run()
tree = 0;
}
qDebug() << "Emitting signal to cache results ...";
emit branchCompleted(tree, true);
emit branchCompleted(tree);
qDebug() << "Thread terminating ...";
}
......
......@@ -42,7 +42,7 @@ public:
static void readMounts();
signals:
void branchCompleted(Folder* tree, bool finished);
void branchCompleted(Folder* tree);
private:
QString m_path;
......
......@@ -97,7 +97,7 @@ RemoteLister::~RemoteLister()
{
Folder *tree = isFinished() ? m_store->folder : 0;
emit branchCompleted(tree, false);
emit branchCompleted(tree);
delete m_root;
}
......
......@@ -38,7 +38,7 @@ public:
~RemoteLister();
signals:
void branchCompleted(Folder* tree, bool finished);
void branchCompleted(Folder* tree);
private slots:
void completed();
......
......@@ -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
}
......
......@@ -56,7 +56,7 @@ public:
public slots:
bool abort();
void emptyCache();
void cacheTree(Folder*, bool);
void cacheTree(Folder*);
void foundCached(Folder*);
signals:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment