From 9e20674b8409937bbd2294681d1801ada39b2126 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 4 Apr 2011 09:27:16 +0200 Subject: [PATCH 1/7] * Properly escaped mtimes sql query and removed further debug. --- src/libtomahawk/database/databasecommand_dirmtimes.cpp | 3 ++- src/libtomahawk/playlist/trackmodel.cpp | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libtomahawk/database/databasecommand_dirmtimes.cpp b/src/libtomahawk/database/databasecommand_dirmtimes.cpp index 829a609c8..76b99fb0b 100644 --- a/src/libtomahawk/database/databasecommand_dirmtimes.cpp +++ b/src/libtomahawk/database/databasecommand_dirmtimes.cpp @@ -44,7 +44,8 @@ DatabaseCommand_DirMtimes::execSelect( DatabaseImpl* dbi ) { query.prepare( QString( "SELECT name, mtime " "FROM dirs_scanned " - "WHERE name LIKE '%1%'" ).arg( m_prefix.replace( '\'',"''" ) ) ); + "WHERE name LIKE :prefix" ) ); + query.bindValue( ":prefix", m_prefix ); query.exec(); } while( query.next() ) diff --git a/src/libtomahawk/playlist/trackmodel.cpp b/src/libtomahawk/playlist/trackmodel.cpp index e3fd2083a..f96d3b026 100644 --- a/src/libtomahawk/playlist/trackmodel.cpp +++ b/src/libtomahawk/playlist/trackmodel.cpp @@ -303,7 +303,7 @@ TrackModel::removeIndex( const QModelIndex& index, bool moreToCome ) { if ( QThread::currentThread() != thread() ) { - qDebug() << "Reinvoking in correct thread:" << Q_FUNC_INFO; +// qDebug() << "Reinvoking in correct thread:" << Q_FUNC_INFO; QMetaObject::invokeMethod( this, "removeIndex", Qt::QueuedConnection, Q_ARG(const QModelIndex, index), @@ -312,8 +312,6 @@ TrackModel::removeIndex( const QModelIndex& index, bool moreToCome ) return; } - qDebug() << Q_FUNC_INFO; - if ( index.column() > 0 ) return; From efaf180b80e3299ee2289e6187e5952acd335d88 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 4 Apr 2011 09:34:17 +0200 Subject: [PATCH 2/7] * Forgot the wildcard match. --- src/libtomahawk/database/databasecommand_dirmtimes.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/database/databasecommand_dirmtimes.cpp b/src/libtomahawk/database/databasecommand_dirmtimes.cpp index 76b99fb0b..5384abfd6 100644 --- a/src/libtomahawk/database/databasecommand_dirmtimes.cpp +++ b/src/libtomahawk/database/databasecommand_dirmtimes.cpp @@ -45,11 +45,12 @@ DatabaseCommand_DirMtimes::execSelect( DatabaseImpl* dbi ) query.prepare( QString( "SELECT name, mtime " "FROM dirs_scanned " "WHERE name LIKE :prefix" ) ); - query.bindValue( ":prefix", m_prefix ); + query.bindValue( ":prefix", m_prefix + "%" ); query.exec(); } while( query.next() ) { + qDebug() << query.value( 0 ).toString(); mtimes.insert( query.value( 0 ).toString(), query.value( 1 ).toUInt() ); } From e824fcc7b3bde5333652ae2cc9a18d9e0bb9fa51 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 4 Apr 2011 10:01:14 +0200 Subject: [PATCH 3/7] * Gather more debug to fix mtimes issue. --- src/libtomahawk/database/databasecommand_dirmtimes.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libtomahawk/database/databasecommand_dirmtimes.cpp b/src/libtomahawk/database/databasecommand_dirmtimes.cpp index 5384abfd6..5b6034086 100644 --- a/src/libtomahawk/database/databasecommand_dirmtimes.cpp +++ b/src/libtomahawk/database/databasecommand_dirmtimes.cpp @@ -36,17 +36,24 @@ DatabaseCommand_DirMtimes::exec( DatabaseImpl* dbi ) void DatabaseCommand_DirMtimes::execSelect( DatabaseImpl* dbi ) { + qDebug() << Q_FUNC_INFO << m_prefix << m_update; QMap mtimes; TomahawkSqlQuery query = dbi->newquery(); + if( m_prefix.isEmpty() ) + { query.exec( "SELECT name, mtime FROM dirs_scanned" ); + } else { query.prepare( QString( "SELECT name, mtime " "FROM dirs_scanned " "WHERE name LIKE :prefix" ) ); query.bindValue( ":prefix", m_prefix + "%" ); + + qDebug() << query.lastQuery(); query.exec(); + qDebug() << query.lastQuery(); } while( query.next() ) { From 856824535544aaf7f93f557518feed51072871c8 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 25 Mar 2011 11:43:39 +0000 Subject: [PATCH 4/7] * Preparing release version 0.0.3. --- CMakeLists.txt | 2 +- admin/win/nsi/revision.txt | 2 +- admin/win/nsi/tomahawk.nsi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100755 => 100644 admin/win/nsi/revision.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index d00a02eec..dde40af13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) SET( ORGANIZATION_NAME "Tomahawk" ) SET( ORGANIZATION_DOMAIN "tomahawk-player.org" ) SET( APPLICATION_NAME "Tomahawk" ) -SET( VERSION "0.0.2" ) +SET( VERSION "0.0.3" ) # set paths diff --git a/admin/win/nsi/revision.txt b/admin/win/nsi/revision.txt old mode 100755 new mode 100644 index c4fbb1cfa..d97edbb29 --- a/admin/win/nsi/revision.txt +++ b/admin/win/nsi/revision.txt @@ -1 +1 @@ -97 \ No newline at end of file +99 \ No newline at end of file diff --git a/admin/win/nsi/tomahawk.nsi b/admin/win/nsi/tomahawk.nsi index e724d3df9..416944114 100644 --- a/admin/win/nsi/tomahawk.nsi +++ b/admin/win/nsi/tomahawk.nsi @@ -35,7 +35,7 @@ !define VER_MAJOR "0" !define VER_MINOR "0" -!define VER_BUILD "2" +!define VER_BUILD "3" !define VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_BUILD}" From 81f4ec2337ca33f53643b7ff0baf80ff08e8d7ed Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 25 Mar 2011 12:10:22 +0000 Subject: [PATCH 5/7] * Update revision. --- admin/win/nsi/revision.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/win/nsi/revision.txt b/admin/win/nsi/revision.txt index d97edbb29..105d7d9ad 100644 --- a/admin/win/nsi/revision.txt +++ b/admin/win/nsi/revision.txt @@ -1 +1 @@ -99 \ No newline at end of file +100 \ No newline at end of file From 5e2d196ba00251efccc7e92a5952966825f94dbb Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 4 Apr 2011 10:36:07 +0200 Subject: [PATCH 6/7] * Fixed mtimes issue with windows paths. --- src/libtomahawk/database/databasecommand_dirmtimes.cpp | 10 ++++------ src/libtomahawk/database/databasecommand_dirmtimes.h | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/libtomahawk/database/databasecommand_dirmtimes.cpp b/src/libtomahawk/database/databasecommand_dirmtimes.cpp index 5b6034086..210f5e7e2 100644 --- a/src/libtomahawk/database/databasecommand_dirmtimes.cpp +++ b/src/libtomahawk/database/databasecommand_dirmtimes.cpp @@ -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 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() ); } diff --git a/src/libtomahawk/database/databasecommand_dirmtimes.h b/src/libtomahawk/database/databasecommand_dirmtimes.h index f35a78437..8b7c1c95d 100644 --- a/src/libtomahawk/database/databasecommand_dirmtimes.h +++ b/src/libtomahawk/database/databasecommand_dirmtimes.h @@ -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 ) {} From 60b9d48d73e182d09be957180e1a16249859f503 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 4 Apr 2011 10:48:48 +0200 Subject: [PATCH 7/7] * Updated Changelog. --- ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3bcf6476b..03ede73fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ Version 0.0.3: + * Fixed an issue which caused duplicate items when rescanning. * Fix crashes in Twitter authentication. * Properly honor the chosen port number if a static host and port are marked as preferred. @@ -6,7 +7,7 @@ Version 0.0.3: speeds up importing sources a lot. * Faster painting of playlists with lots of unresolved tracks. * The tomahawk:// protocol handler works on Windows now. - * Fixed launching Tomahawk from Installer with administrative permissions. + * Fixed launching Tomahawk from Windows installer with admin privileges. * Prefer local results when results' score is equal. Version 0.0.2: