From f66a062796b958811c8dd067df196a2253902a89 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Sun, 3 Apr 2011 13:30:13 -0400 Subject: [PATCH] Hopefully fix removing files actually being removed from db during watch scan --- src/musicscanner.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/musicscanner.cpp b/src/musicscanner.cpp index dc0647c73..71707012e 100644 --- a/src/musicscanner.cpp +++ b/src/musicscanner.cpp @@ -75,9 +75,9 @@ DirLister::scanDir( QDir dir, int depth, DirLister::Mode mode ) { // dont scan this dir, unchanged since last time. } - else if( mode != DirLister::MTimeOnly ) + else { - if( m_dirmtimes.contains( dir.absolutePath() ) ) + if( m_dirmtimes.contains( dir.absolutePath() ) || !m_recursive ) Database::instance()->enqueue( QSharedPointer( new DatabaseCommand_DeleteFiles( dir, SourceList::instance()->getLocal() ) ) ); dir.setFilter( QDir::Files | QDir::Readable | QDir::NoDotAndDotDot ); @@ -97,8 +97,6 @@ DirLister::scanDir( QDir dir, int depth, DirLister::Mode mode ) qDebug() << "m_dirmtimes contains it? " << (m_dirmtimes.contains( di.absoluteFilePath() ) ? "true" : "false"); if( mode == DirLister::Recursive || !m_dirmtimes.contains( di.absoluteFilePath() ) ) scanDir( di.absoluteFilePath(), depth + 1, DirLister::Recursive ); - //else //should be the non-recursive case since the second test above should only happen with a new dir - // scanDir( di.absoluteFilePath(), depth + 1, DirLister::MTimeOnly ); } }