1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-16 11:04:01 +02:00

* Fixed mtimes issue with windows paths.

This commit is contained in:
Christian Muehlhaeuser
2011-04-04 10:36:07 +02:00
parent 81f4ec2337
commit 5e2d196ba0
2 changed files with 5 additions and 7 deletions

View File

@@ -36,11 +36,12 @@ DatabaseCommand_DirMtimes::exec( DatabaseImpl* dbi )
void
DatabaseCommand_DirMtimes::execSelect( DatabaseImpl* dbi )
{
qDebug() << Q_FUNC_INFO << m_prefix << m_update;
QDir dir( m_prefix );
qDebug() << Q_FUNC_INFO << dir.absolutePath() << m_update;
QMap<QString,unsigned int> mtimes;
TomahawkSqlQuery query = dbi->newquery();
if( m_prefix.isEmpty() )
if ( m_prefix.isEmpty() )
{
query.exec( "SELECT name, mtime FROM dirs_scanned" );
}
@@ -49,15 +50,12 @@ DatabaseCommand_DirMtimes::execSelect( DatabaseImpl* dbi )
query.prepare( QString( "SELECT name, mtime "
"FROM dirs_scanned "
"WHERE name LIKE :prefix" ) );
query.bindValue( ":prefix", m_prefix + "%" );
qDebug() << query.lastQuery();
query.bindValue( ":prefix", dir.absolutePath() + "%" );
query.exec();
qDebug() << query.lastQuery();
}
while( query.next() )
{
qDebug() << query.value( 0 ).toString();
mtimes.insert( query.value( 0 ).toString(), query.value( 1 ).toUInt() );
}

View File

@@ -34,7 +34,7 @@ class DLLEXPORT DatabaseCommand_DirMtimes : public DatabaseCommand
Q_OBJECT
public:
explicit DatabaseCommand_DirMtimes( const QString& prefix = "", QObject* parent = 0 )
explicit DatabaseCommand_DirMtimes( const QString& prefix = QString(), QObject* parent = 0 )
: DatabaseCommand( parent ), m_prefix( prefix ), m_update( false )
{}