mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-18 20:04:00 +02:00
* Use canonicalPath() wherever dealing with file- & dir-paths.
This commit is contained in:
@@ -78,18 +78,18 @@ DatabaseCommand_DeleteFiles::exec( DatabaseImpl* dbi )
|
|||||||
delquery.prepare( QString( "DELETE FROM file WHERE source %1 AND id = ?" )
|
delquery.prepare( QString( "DELETE FROM file WHERE source %1 AND id = ?" )
|
||||||
.arg( source()->isLocal() ? "IS NULL" : QString( "= %1" ).arg( source()->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();
|
dirquery.exec();
|
||||||
|
|
||||||
while ( dirquery.next() )
|
while ( dirquery.next() )
|
||||||
{
|
{
|
||||||
QFileInfo fi( dirquery.value( 1 ).toString().mid( 7 ) ); // remove file://
|
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() )
|
if ( lastPath != fi.canonicalPath() )
|
||||||
qDebug() << "Skipping subdir:" << fi.absolutePath();
|
qDebug() << "Skipping subdir:" << fi.canonicalPath();
|
||||||
|
|
||||||
lastPath = fi.absolutePath();
|
lastPath = fi.canonicalPath();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -60,7 +60,7 @@ DatabaseCommand_DirMtimes::execSelectPath( DatabaseImpl *dbi, const QDir& path,
|
|||||||
"FROM dirs_scanned "
|
"FROM dirs_scanned "
|
||||||
"WHERE name LIKE :prefix" ) );
|
"WHERE name LIKE :prefix" ) );
|
||||||
|
|
||||||
query.bindValue( ":prefix", path.absolutePath() + "%" );
|
query.bindValue( ":prefix", path.canonicalPath() + "%" );
|
||||||
query.exec();
|
query.exec();
|
||||||
|
|
||||||
while( query.next() )
|
while( query.next() )
|
||||||
|
Reference in New Issue
Block a user