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:
@@ -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() );
|
||||
}
|
||||
|
||||
|
@@ -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 )
|
||||
{}
|
||||
|
||||
|
Reference in New Issue
Block a user