mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
Actually remove deleted files from the collection
This commit is contained in:
@@ -253,11 +253,12 @@ MusicScanner::listerFinished( const QMap<QString, unsigned int>& newmtimes )
|
|||||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
|
||||||
|
|
||||||
// any remaining stuff that wasnt emitted as a batch:
|
// any remaining stuff that wasnt emitted as a batch:
|
||||||
if( m_scannedfiles.length() )
|
SourceList::instance()->getLocal()->scanningFinished( m_scanned );
|
||||||
|
foreach( QString key, m_filemtimes.keys() )
|
||||||
{
|
{
|
||||||
SourceList::instance()->getLocal()->scanningFinished( m_scanned );
|
m_filesToDelete << m_filemtimes[ key ].keys().first();
|
||||||
commitBatch( m_scannedfiles, m_filesToDelete );
|
|
||||||
}
|
}
|
||||||
|
commitBatch( m_scannedfiles, m_filesToDelete );
|
||||||
|
|
||||||
// remove obsolete / stale files
|
// remove obsolete / stale files
|
||||||
foreach ( const QString& path, m_dirmtimes.keys() )
|
foreach ( const QString& path, m_dirmtimes.keys() )
|
||||||
@@ -323,7 +324,10 @@ MusicScanner::scanFile( const QFileInfo& fi )
|
|||||||
if ( m_mode == TomahawkSettings::Files && m_filemtimes.contains( "file://" + fi.canonicalFilePath() ) )
|
if ( m_mode == TomahawkSettings::Files && m_filemtimes.contains( "file://" + fi.canonicalFilePath() ) )
|
||||||
{
|
{
|
||||||
if ( fi.lastModified().toUTC().toTime_t() == m_filemtimes.value( "file://" + fi.canonicalFilePath() ).values().first() )
|
if ( fi.lastModified().toUTC().toTime_t() == m_filemtimes.value( "file://" + fi.canonicalFilePath() ).values().first() )
|
||||||
|
{
|
||||||
|
m_filemtimes.remove( "file://" + fi.canonicalFilePath() );
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_filesToDelete << m_filemtimes.value( "file://" + fi.canonicalFilePath() ).keys().first();
|
m_filesToDelete << m_filemtimes.value( "file://" + fi.canonicalFilePath() ).keys().first();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user