diff --git a/src/libtomahawk/database/databasecommand_deletefiles.cpp b/src/libtomahawk/database/databasecommand_deletefiles.cpp index 503d3887b..f3675369f 100644 --- a/src/libtomahawk/database/databasecommand_deletefiles.cpp +++ b/src/libtomahawk/database/databasecommand_deletefiles.cpp @@ -1,5 +1,5 @@ /* === This file is part of Tomahawk Player - === - * + * * Copyright 2010-2011, Christian Muehlhaeuser * * Tomahawk is free software: you can redistribute it and/or modify @@ -78,18 +78,18 @@ DatabaseCommand_DeleteFiles::exec( DatabaseImpl* dbi ) delquery.prepare( QString( "DELETE FROM file WHERE source %1 AND id = ?" ) .arg( source()->isLocal() ? "IS NULL" : QString( "= %1" ).arg( source()->id() ) ) ); - dirquery.bindValue( 0, "file://" + m_dir.absolutePath() + "/%" ); + dirquery.bindValue( 0, "file://" + m_dir.canonicalPath() + "/%" ); dirquery.exec(); while ( dirquery.next() ) { QFileInfo fi( dirquery.value( 1 ).toString().mid( 7 ) ); // remove file:// - if ( fi.absolutePath() != m_dir.absolutePath() ) + if ( fi.canonicalPath() != m_dir.canonicalPath() ) { - if ( lastPath != fi.absolutePath() ) - qDebug() << "Skipping subdir:" << fi.absolutePath(); + if ( lastPath != fi.canonicalPath() ) + qDebug() << "Skipping subdir:" << fi.canonicalPath(); - lastPath = fi.absolutePath(); + lastPath = fi.canonicalPath(); continue; } @@ -133,11 +133,11 @@ DatabaseCommand_DeleteFiles::exec( DatabaseImpl* dbi ) << delquery.boundValues(); continue; } - + deleted++; } } - + qDebug() << "Deleted" << deleted << m_ids << m_files; emit done( m_files, source()->collection() ); diff --git a/src/libtomahawk/database/databasecommand_dirmtimes.cpp b/src/libtomahawk/database/databasecommand_dirmtimes.cpp index 07fbad637..c0ef4ffc5 100644 --- a/src/libtomahawk/database/databasecommand_dirmtimes.cpp +++ b/src/libtomahawk/database/databasecommand_dirmtimes.cpp @@ -1,5 +1,5 @@ /* === This file is part of Tomahawk Player - === - * + * * Copyright 2010-2011, Christian Muehlhaeuser * * Tomahawk is free software: you can redistribute it and/or modify @@ -60,7 +60,7 @@ DatabaseCommand_DirMtimes::execSelectPath( DatabaseImpl *dbi, const QDir& path, "FROM dirs_scanned " "WHERE name LIKE :prefix" ) ); - query.bindValue( ":prefix", path.absolutePath() + "%" ); + query.bindValue( ":prefix", path.canonicalPath() + "%" ); query.exec(); while( query.next() )