Browse Source

Fix Amarok FTBFS under Autotools

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/amarok@1247158 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 11 years ago
parent
commit
4cb09d377b
  1. 16
      amarok/configure.in.in
  2. 74
      amarok/src/collectiondb.cpp
  3. 4
      amarok/src/collectiondb.h
  4. 36
      amarok/src/database_refactor/sqlite/sqlite_dbengine.cpp
  5. 6
      amarok/src/database_refactor/sqlite/sqlite_dbengine.h
  6. 6
      amarok/src/ktrm.cpp
  7. 24
      amarok/src/playlistbrowser.cpp
  8. 4
      amarok/src/playlistbrowseritem.cpp
  9. 9286
      amarok/src/sqlite/sqlite3.c
  10. 554
      amarok/src/sqlite/sqlite3.h
  11. 6
      amarok/src/statistics.cpp

16
amarok/configure.in.in

@ -313,7 +313,7 @@ if test "$build_yauap" != "no"; then
LIB_YAUAP=""
CFLAGS_YAUAP=""
else
LIB_YAUAP="$DBUS_LIBS -ldbus-qt-1"
LIB_YAUAP="$DBUS_LIBS -ldbus-tqt-1"
CFLAGS_YAUAP="$DBUS_CFLAGS"
AC_SUBST(LIB_YAUAP)
AC_SUBST(CFLAGS_YAUAP)
@ -834,7 +834,21 @@ AC_ARG_WITH(ifp,
if test "$build_ifp" != "no"; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
save_CXXFLAGS="$CXXFLAGS"
save_LIBS="$LIBS"
save_LDFLAGS="$LDFLAGS"
AC_CHECK_HEADERS([ifp.h], [have_ifp=yes], [], [])
CXXFLAGS="$save_CXXFLAGS"
LIBS="$save_LIBS"
LDFLAGS="$save_LDFLAGS"
AC_LANG_RESTORE
# AC_CHECK_HEADERS([ifp.h], [have_ifp=yes], [], [])
AC_CHECK_HEADERS([usb.h], [have_usb=yes], [], [])
if test "$have_ifp" = "yes"; then

74
amarok/src/collectiondb.cpp

@ -6062,11 +6062,11 @@ SqliteConnection::SqliteConnection( const SqliteConfig* config )
{
TQString format;
file.readLine( format, 50 );
if ( !format.startsWith( "STQLite format 3" ) )
if ( !format.startsWith( "SQLite format 3" ) )
{
warning() << "Database versions incompatible. Removing and rebuilding database.\n";
}
else if ( sqlite3_open( path, &m_db ) != STQLITE_OK )
else if ( sqlite3_open( path, &m_db ) != SQLITE_OK )
{
warning() << "Database file corrupt. Removing and rebuilding database.\n";
sqlite3_close( m_db );
@ -6079,24 +6079,24 @@ SqliteConnection::SqliteConnection( const SqliteConfig* config )
{
// Remove old db file; create new
TQFile::remove( path );
if ( sqlite3_open( path, &m_db ) == STQLITE_OK )
if ( sqlite3_open( path, &m_db ) == SQLITE_OK )
{
m_initialized = true;
}
}
if ( m_initialized )
{
if( sqlite3_create_function(m_db, "rand", 0, STQLITE_UTF8, NULL, sqlite_rand, NULL, NULL) != STQLITE_OK )
if( sqlite3_create_function(m_db, "rand", 0, SQLITE_UTF8, NULL, sqlite_rand, NULL, NULL) != SQLITE_OK )
m_initialized = false;
if( sqlite3_create_function(m_db, "power", 2, STQLITE_UTF8, NULL, sqlite_power, NULL, NULL) != STQLITE_OK )
if( sqlite3_create_function(m_db, "power", 2, SQLITE_UTF8, NULL, sqlite_power, NULL, NULL) != SQLITE_OK )
m_initialized = false;
if ( sqlite3_create_function(m_db, "like", 2, STQLITE_UTF8, NULL, sqlite_like_new, NULL, NULL) != STQLITE_OK )
if ( sqlite3_create_function(m_db, "like", 2, SQLITE_UTF8, NULL, sqlite_like_new, NULL, NULL) != SQLITE_OK )
m_initialized = false;
if ( sqlite3_create_function(m_db, "like", 3, STQLITE_UTF8, NULL, sqlite_like_new, NULL, NULL) != STQLITE_OK )
if ( sqlite3_create_function(m_db, "like", 3, SQLITE_UTF8, NULL, sqlite_like_new, NULL, NULL) != SQLITE_OK )
m_initialized = false;
}
//optimization for speeding up STQLite
//optimization for speeding up SQLite
query( "PRAGMA default_synchronous = OFF;" );
}
@ -6128,11 +6128,11 @@ TQStringList SqliteConnection::query( const TQString& statement, bool /*suppress
}
error = sqlite3_prepare( m_db, statement.utf8(), -1, &stmt, &tail );
}
while ( STQLITE_BUSY==error && busyCnt++ < 120 );
while ( SQLITE_BUSY==error && busyCnt++ < 120 );
if ( error != STQLITE_OK )
if ( error != SQLITE_OK )
{
if ( STQLITE_BUSY==error )
if ( SQLITE_BUSY==error )
Debug::error() << "Gave up waiting for lock to clear" << endl;
Debug::error() << k_funcinfo << " sqlite3_compile error:" << endl;
Debug::error() << sqlite3_errmsg( m_db ) << endl;
@ -6149,7 +6149,7 @@ TQStringList SqliteConnection::query( const TQString& statement, bool /*suppress
{
error = sqlite3_step( stmt );
if ( error == STQLITE_BUSY )
if ( error == SQLITE_BUSY )
{
if ( busyCnt++ > 120 ) {
Debug::error() << "Busy-counter has reached maximum. Aborting this sql statement!\n";
@ -6159,9 +6159,9 @@ TQStringList SqliteConnection::query( const TQString& statement, bool /*suppress
debug() << "sqlite3_step: BUSY counter: " << busyCnt << endl;
continue;
}
if ( error == STQLITE_MISUSE )
if ( error == SQLITE_MISUSE )
debug() << "sqlite3_step: MISUSE" << endl;
if ( error == STQLITE_DONE || error == STQLITE_ERROR )
if ( error == SQLITE_DONE || error == SQLITE_ERROR )
break;
//iterate over columns
@ -6173,17 +6173,17 @@ TQStringList SqliteConnection::query( const TQString& statement, bool /*suppress
//deallocate vm resources
rc = sqlite3_finalize( stmt );
if ( error != STQLITE_DONE && rc != STQLITE_SCHEMA )
if ( error != SQLITE_DONE && rc != SQLITE_SCHEMA )
{
Debug::error() << k_funcinfo << "sqlite_step error.\n";
Debug::error() << sqlite3_errmsg( m_db ) << endl;
Debug::error() << "on query: " << statement << endl;
values = TQStringList();
}
if ( rc == STQLITE_SCHEMA )
if ( rc == SQLITE_SCHEMA )
{
retryCnt++;
debug() << "STQLITE_SCHEMA error occurred on query: " << statement << endl;
debug() << "SQLITE_SCHEMA error occurred on query: " << statement << endl;
if ( retryCnt < 10 )
debug() << "Retrying now." << endl;
else
@ -6195,7 +6195,7 @@ TQStringList SqliteConnection::query( const TQString& statement, bool /*suppress
}
}
}
while ( rc == STQLITE_SCHEMA && retryCnt < 10 );
while ( rc == SQLITE_SCHEMA && retryCnt < 10 );
return values;
}
@ -6220,11 +6220,11 @@ int SqliteConnection::insert( const TQString& statement, const TQString& /* tabl
}
error = sqlite3_prepare( m_db, statement.utf8(), -1, &stmt, &tail );
}
while ( STQLITE_BUSY==error && busyCnt++ < 120 );
while ( SQLITE_BUSY==error && busyCnt++ < 120 );
if ( error != STQLITE_OK )
if ( error != SQLITE_OK )
{
if ( STQLITE_BUSY==error )
if ( SQLITE_BUSY==error )
Debug::error() << "Gave up waiting for lock to clear" << endl;
Debug::error() << k_funcinfo << " sqlite3_compile error:" << endl;
Debug::error() << sqlite3_errmsg( m_db ) << endl;
@ -6239,7 +6239,7 @@ int SqliteConnection::insert( const TQString& statement, const TQString& /* tabl
{
error = sqlite3_step( stmt );
if ( error == STQLITE_BUSY )
if ( error == SQLITE_BUSY )
{
if ( busyCnt++ > 120 ) {
Debug::error() << "Busy-counter has reached maximum. Aborting this sql statement!\n";
@ -6248,24 +6248,24 @@ int SqliteConnection::insert( const TQString& statement, const TQString& /* tabl
::usleep( 100000 ); // Sleep 100 msec
debug() << "sqlite3_step: BUSY counter: " << busyCnt << endl;
}
if ( error == STQLITE_MISUSE )
if ( error == SQLITE_MISUSE )
debug() << "sqlite3_step: MISUSE" << endl;
if ( error == STQLITE_DONE || error == STQLITE_ERROR )
if ( error == SQLITE_DONE || error == SQLITE_ERROR )
break;
}
//deallocate vm resources
rc = sqlite3_finalize( stmt );
if ( error != STQLITE_DONE && rc != STQLITE_SCHEMA)
if ( error != SQLITE_DONE && rc != SQLITE_SCHEMA)
{
Debug::error() << k_funcinfo << "sqlite_step error.\n";
Debug::error() << sqlite3_errmsg( m_db ) << endl;
Debug::error() << "on insert: " << statement << endl;
}
if ( rc == STQLITE_SCHEMA )
if ( rc == SQLITE_SCHEMA )
{
retryCnt++;
debug() << "STQLITE_SCHEMA error occurred on insert: " << statement << endl;
debug() << "SQLITE_SCHEMA error occurred on insert: " << statement << endl;
if ( retryCnt < 10 )
debug() << "Retrying now." << endl;
else
@ -6276,7 +6276,7 @@ int SqliteConnection::insert( const TQString& statement, const TQString& /* tabl
}
}
}
while ( STQLITE_SCHEMA == rc && retryCnt < 10 );
while ( SQLITE_SCHEMA == rc && retryCnt < 10 );
return sqlite3_last_insert_rowid( m_db );
}
@ -6291,7 +6291,7 @@ void SqliteConnection::sqlite_rand(sqlite3_context *context, int /*argc*/, sqlit
void SqliteConnection::sqlite_power(sqlite3_context *context, int argc, sqlite3_value **argv)
{
Q_ASSERT( argc==2 );
if( sqlite3_value_type(argv[0])==STQLITE_NULL || sqlite3_value_type(argv[1])==STQLITE_NULL ) {
if( sqlite3_value_type(argv[0])==SQLITE_NULL || sqlite3_value_type(argv[1])==SQLITE_NULL ) {
sqlite3_result_null(context);
return;
}
@ -6356,7 +6356,7 @@ MySqlConnection::MySqlConnection( const MySqlConfig* config )
{
m_initialized = true;
#if MYSTQL_VERSION_ID >= 40113
#if MYSQL_VERSION_ID >= 40113
// now set the right charset for the connection
TQStringList my_qslist = query( "SHOW VARIABLES LIKE 'character_set_database'" );
if( !my_qslist.isEmpty() && !mysql_set_character_set( m_db, const_cast<char *>( my_qslist[1].latin1() ) ) )
@ -6409,11 +6409,11 @@ TQStringList MySqlConnection::query( const TQString& statement, bool suppressDeb
if ( !mysql_query( m_db, statement.utf8() ) )
{
MYSTQL_RES* result;
MYSQL_RES* result;
if ( ( result = mysql_use_result( m_db ) ) )
{
int number = mysql_field_count( m_db );
MYSTQL_ROW row;
MYSQL_ROW row;
while ( ( row = mysql_fetch_row( result ) ) )
{
for ( int i = 0; i < number; i++ )
@ -6530,7 +6530,7 @@ TQStringList PostgresqlConnection::query( const TQString& statement, bool suppre
return values;
}
status = PQresulttqStatus(result);
status = PQresultStatus(result);
if ((status != PGRES_COMMAND_OK) && (status != PGRES_TUPLES_OK))
{
if ( !suppressDebug )
@ -6579,7 +6579,7 @@ int PostgresqlConnection::insert( const TQString& statement, const TQString& tab
return 0;
}
status = PQresulttqStatus(result);
status = PQresultStatus(result);
if (status != PGRES_COMMAND_OK)
{
debug() << "POSTGRESQL INSERT FAILED: " << PQerrorMessage( m_db ) << "\n" << "FAILED SQL: " << statement << "\n";
@ -6601,7 +6601,7 @@ int PostgresqlConnection::insert( const TQString& statement, const TQString& tab
return 0;
}
status = PQresulttqStatus(result);
status = PQresultStatus(result);
if (status != PGRES_TUPLES_OK)
{
debug() << "POSTGRESQL INSERT FAILED: " << PQerrorMessage( m_db ) << "\n" << "FAILED SQL: " << curvalSql << "\n";
@ -7660,7 +7660,7 @@ const int
QueryBuilder::dragFieldCount = 21;
TQString
QueryBuilder::dragSTQLFields()
QueryBuilder::dragSQLFields()
{
return "tags.url, tags.deviceid, album.name, artist.name, composer.name, "
"genre.name, tags.title, year.name, "
@ -7672,7 +7672,7 @@ QueryBuilder::dragSTQLFields()
}
void
QueryBuilder::initSTQLDrag()
QueryBuilder::initSQLDrag()
{
clear();
addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL );

4
amarok/src/collectiondb.h

@ -799,8 +799,8 @@ class QueryBuilder
void shuffle( int table = 0, TQ_INT64 value = 0 );
static const int dragFieldCount;
static TQString dragSTQLFields();
void initSTQLDrag();
static TQString dragSQLFields();
void initSQLDrag();
void buildQuery( bool withDeviceidPlaceholder = false );
TQString getQuery();

36
amarok/src/database_refactor/sqlite/sqlite_dbengine.cpp

@ -4,7 +4,7 @@
// (c) 2005 Ian Monroe <ian@monroe.nu>
// See COPYING file for licensing information.
#define DEBUG_PREFIX "STQLite-DBEngine"
#define DEBUG_PREFIX "SQLite-DBEngine"
#include "app.h"
#include "amarok.h"
@ -43,11 +43,11 @@ SqliteDbEngine::SqliteDbEngine()
{
TQString format;
file.readLine( format, 50 );
if ( !format.startsWith( "STQLite format 3" ) )
if ( !format.startsWith( "SQLite format 3" ) )
{
warning() << "Database versions incompatible. Removing and rebuilding database.\n";
}
else if ( sqlite3_open( path, &m_db ) != STQLITE_OK )
else if ( sqlite3_open( path, &m_db ) != SQLITE_OK )
{
warning() << "Database file corrupt. Removing and rebuilding database.\n";
sqlite3_close( m_db );
@ -60,20 +60,20 @@ SqliteDbEngine::SqliteDbEngine()
{
// Remove old db file; create new
TQFile::remove( path );
if ( sqlite3_open( path, &m_db ) == STQLITE_OK )
if ( sqlite3_open( path, &m_db ) == SQLITE_OK )
{
m_initialized = true;
}
}
if ( m_initialized )
{
if( sqlite3_create_function(m_db, "rand", 0, STQLITE_UTF8, NULL, sqlite_rand, NULL, NULL) != STQLITE_OK )
if( sqlite3_create_function(m_db, "rand", 0, SQLITE_UTF8, NULL, sqlite_rand, NULL, NULL) != SQLITE_OK )
m_initialized = false;
if( sqlite3_create_function(m_db, "power", 2, STQLITE_UTF8, NULL, sqlite_power, NULL, NULL) != STQLITE_OK )
if( sqlite3_create_function(m_db, "power", 2, SQLITE_UTF8, NULL, sqlite_power, NULL, NULL) != SQLITE_OK )
m_initialized = false;
}
//optimization for speeding up STQLite
//optimization for speeding up SQLite
query( "PRAGMA default_synchronous = OFF;" );
}
@ -94,7 +94,7 @@ TQStringList SqliteDbEngine::query( const TQString& statement )
//compile SQL program to virtual machine
error = sqlite3_prepare( m_db, statement.utf8(), statement.length(), &stmt, &tail );
if ( error != STQLITE_OK )
if ( error != SQLITE_OK )
{
Debug::error() << k_funcinfo << " sqlite3_compile error:" << endl;
Debug::error() << sqlite3_errmsg( m_db ) << endl;
@ -110,7 +110,7 @@ TQStringList SqliteDbEngine::query( const TQString& statement )
{
error = sqlite3_step( stmt );
if ( error == STQLITE_BUSY )
if ( error == SQLITE_BUSY )
{
if ( busyCnt++ > 20 ) {
Debug::error() << "Busy-counter has reached maximum. Aborting this sql statement!\n";
@ -119,9 +119,9 @@ TQStringList SqliteDbEngine::query( const TQString& statement )
::usleep( 100000 ); // Sleep 100 msec
debug() << "sqlite3_step: BUSY counter: " << busyCnt << endl;
}
if ( error == STQLITE_MISUSE )
if ( error == SQLITE_MISUSE )
debug() << "sqlite3_step: MISUSE" << endl;
if ( error == STQLITE_DONE || error == STQLITE_ERROR )
if ( error == SQLITE_DONE || error == SQLITE_ERROR )
break;
//iterate over columns
@ -133,7 +133,7 @@ TQStringList SqliteDbEngine::query( const TQString& statement )
//deallocate vm resources
sqlite3_finalize( stmt );
if ( error != STQLITE_DONE )
if ( error != SQLITE_DONE )
{
Debug::error() << k_funcinfo << "sqlite_step error.\n";
Debug::error() << sqlite3_errmsg( m_db ) << endl;
@ -155,7 +155,7 @@ int SqliteDbEngine::insert( const TQString& statement, const TQString& /* table
//compile SQL program to virtual machine
error = sqlite3_prepare( m_db, statement.utf8(), statement.length(), &stmt, &tail );
if ( error != STQLITE_OK )
if ( error != SQLITE_OK )
{
Debug::error() << k_funcinfo << " sqlite3_compile error:" << endl;
Debug::error() << sqlite3_errmsg( m_db ) << endl;
@ -169,7 +169,7 @@ int SqliteDbEngine::insert( const TQString& statement, const TQString& /* table
{
error = sqlite3_step( stmt );
if ( error == STQLITE_BUSY )
if ( error == SQLITE_BUSY )
{
if ( busyCnt++ > 20 ) {
Debug::error() << "Busy-counter has reached maximum. Aborting this sql statement!\n";
@ -178,15 +178,15 @@ int SqliteDbEngine::insert( const TQString& statement, const TQString& /* table
::usleep( 100000 ); // Sleep 100 msec
debug() << "sqlite3_step: BUSY counter: " << busyCnt << endl;
}
if ( error == STQLITE_MISUSE )
if ( error == SQLITE_MISUSE )
debug() << "sqlite3_step: MISUSE" << endl;
if ( error == STQLITE_DONE || error == STQLITE_ERROR )
if ( error == SQLITE_DONE || error == SQLITE_ERROR )
break;
}
//deallocate vm resources
sqlite3_finalize( stmt );
if ( error != STQLITE_DONE )
if ( error != SQLITE_DONE )
{
Debug::error() << k_funcinfo << "sqlite_step error.\n";
Debug::error() << sqlite3_errmsg( m_db ) << endl;
@ -207,7 +207,7 @@ void SqliteDbEngine::sqlite_rand(sqlite3_context *context, int /*argc*/, sqlite3
void SqliteDbEngine::sqlite_power(sqlite3_context *context, int argc, sqlite3_value **argv)
{
Q_ASSERT( argc==2 );
if( sqlite3_value_type(argv[0])==STQLITE_NULL || sqlite3_value_type(argv[1])==STQLITE_NULL ) {
if( sqlite3_value_type(argv[0])==SQLITE_NULL || sqlite3_value_type(argv[1])==SQLITE_NULL ) {
sqlite3_result_null(context);
return;
}

6
amarok/src/database_refactor/sqlite/sqlite_dbengine.h

@ -3,8 +3,8 @@
// (c) 2004 Sami Nieminen <sami.nieminen@iki.fi>
// See COPYING file for licensing information.
#ifndef AMAROK_STQLITE_DBENGINE_H
#define AMAROK_STQLITE_DBENGINE_H
#ifndef AMAROK_SQLITE_DBENGINE_H
#define AMAROK_SQLITE_DBENGINE_H
#include "dbenginebase.h"
#include <kurl.h>
@ -55,4 +55,4 @@ class SqliteDbEngine : public DbConnection
};
#endif /*STQLITE_DBENGINE_H*/
#endif /*SQLITE_DBENGINE_H*/

6
amarok/src/ktrm.cpp

@ -52,7 +52,7 @@ class KTRMLookup;
extern "C"
{
#if HAVE_TUNEPIMP >= 4
static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId, TPFiletqStatus status);
static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId, TPFileStatus status);
#else
static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId);
#endif
@ -314,7 +314,7 @@ protected:
* Callback function for TunePimp lookup events.
*/
#if HAVE_TUNEPIMP >= 4
static void TRMNotifyCallback(tunepimp_t /*pimp*/, void */*data*/, TPCallbackEnum type, int fileId, TPFiletqStatus status)
static void TRMNotifyCallback(tunepimp_t /*pimp*/, void */*data*/, TPCallbackEnum type, int fileId, TPFileStatus status)
#else
static void TRMNotifyCallback(tunepimp_t pimp, void */*data*/, TPCallbackEnum type, int fileId)
#endif
@ -617,7 +617,7 @@ void KTRMLookup::unrecognized()
tr_GetTRM(track, trm, 255);
#endif
if ( !trm[0] ) {
tr_SettqStatus(track, ePending);
tr_SetStatus(track, ePending);
tp_Wake(KTRMRequestHandler::instance()->tunePimp(), track);
}
else

24
amarok/src/playlistbrowser.cpp

@ -794,7 +794,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
m_smartDefaults->setOpen( m_smartDefaultsOpen );
m_smartDefaults->setKept( false );
/********** All Collection **************/
qb.initSTQLDrag();
qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabArtist, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack );
@ -803,14 +803,14 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
item->setPixmap( 0, SmallIcon( Amarok::icon( "collection" ) ) );
item->setKept( false );
/********** Favorite Tracks **************/
qb.initSTQLDrag();
qb.initSQLDrag();
qb.sortByFavorite();
qb.setLimit( 0, 15 );
item = new SmartPlaylist( m_smartDefaults, item, i18n( "Favorite Tracks" ), qb.query() );
item->setKept( false );
last = 0;
qb.initSTQLDrag();
qb.initSQLDrag();
qb.sortByFavorite();
qb.setLimit( 0, 15 );
foreach( artists ) {
@ -822,7 +822,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
}
/********** Most Played **************/
qb.initSTQLDrag();
qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valPlayCounter, true );
qb.setLimit( 0, 15 );
@ -830,7 +830,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
item->setKept( false );
last = 0;
qb.initSTQLDrag();
qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valPlayCounter, true );
qb.setLimit( 0, 15 );
foreach( artists ) {
@ -842,7 +842,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
}
/********** Newest Tracks **************/
qb.initSTQLDrag();
qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valCreateDate, true );
qb.setLimit( 0, 15 );
@ -850,7 +850,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
item->setKept( false );
last = 0;
qb.initSTQLDrag();
qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valCreateDate, true );
qb.setLimit( 0, 15 );
foreach( artists ) {
@ -862,7 +862,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
}
/********** Last Played **************/
qb.initSTQLDrag();
qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valAccessDate, true );
qb.setLimit( 0, 15 );
@ -870,7 +870,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
item->setKept( false );
/********** Never Played **************/
qb.initSTQLDrag();
qb.initSQLDrag();
qb.addNumericFilter( QueryBuilder::tabStats, QueryBuilder::valPlayCounter, "0" );
qb.sortBy( QueryBuilder::tabArtist, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
@ -880,7 +880,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
item->setKept( false );
/********** Ever Played **************/
qb.initSTQLDrag();
qb.initSQLDrag();
qb.excludeFilter( QueryBuilder::tabStats, QueryBuilder::valPlayCounter, "1", QueryBuilder::modeLess );
qb.sortBy( QueryBuilder::tabArtist, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
@ -895,7 +895,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
item->setKept( false );
last = 0;
qb.initSTQLDrag();
qb.initSQLDrag();
qb.sortBy( QueryBuilder::tabArtist, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack );
@ -908,7 +908,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists()
}
/********** 50 Random Tracks **************/
qb.initSTQLDrag();
qb.initSQLDrag();
qb.setOptions( QueryBuilder::optRandomize );
qb.setLimit( 0, 50 );
item = new SmartPlaylist( m_smartDefaults, item, i18n( "50 Random Tracks" ), qb.query( true ) );

4
amarok/src/playlistbrowseritem.cpp

@ -3150,7 +3150,7 @@ TQString SmartPlaylist::query()
return TQString( m_sqlForTags.tqunicode(), m_sqlForTags.length() )
.replace( "(*CurrentTimeT*)" ,
TQString::number(TQDateTime::tqcurrentDateTime().toTime_t()) )
.replace( "(*ListOfFields*)" , QueryBuilder::dragSTQLFields() )
.replace( "(*ListOfFields*)" , QueryBuilder::dragSQLFields() )
.replace( "(*MountedDeviceSelection*)" ,
CollectionDB::instance()->deviceidSelection() );
}
@ -3160,7 +3160,7 @@ TQString
SmartPlaylist::xmlToQuery(const TQDomElement &xml, bool forExpand /* = false */) {
QueryBuilder qb;
qb.initSTQLDrag();
qb.initSQLDrag();
// This code is partly copied from SmartPlaylistEditor -- but refactoring
// to have it common would involve adding an internal data structure for smart
// playlist queries. I think having the XML be that data structure is almost as good,

9286
amarok/src/sqlite/sqlite3.c

File diff suppressed because it is too large Load Diff

554
amarok/src/sqlite/sqlite3.h

File diff suppressed because it is too large Load Diff

6
amarok/src/statistics.cpp

@ -965,7 +965,7 @@ StatisticsDetailedItem::getSQL()
if( itemType() == StatisticsDetailedItem::ALBUM || itemType() == StatisticsDetailedItem::HISTORY )
{
qb.initSTQLDrag();
qb.initSQLDrag();
if ( artist != "0" )
qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, artist );
qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valAlbumID, album );
@ -977,7 +977,7 @@ StatisticsDetailedItem::getSQL()
{
const uint artist_id = CollectionDB::instance()->artistID( url() );
qb.initSTQLDrag();
qb.initSQLDrag();
qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, TQString::number( artist_id ) );
qb.sortBy( QueryBuilder::tabYear, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
@ -989,7 +989,7 @@ StatisticsDetailedItem::getSQL()
{
const uint genre_id = CollectionDB::instance()->genreID( url() );
qb.initSTQLDrag();
qb.initSQLDrag();
qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valGenreID, TQString::number( genre_id ) );
qb.sortBy( QueryBuilder::tabArtist, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabYear, QueryBuilder::valName );

Loading…
Cancel
Save