Convert accidental instances of STQL to the proper SQL

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/amarok@1247182 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 4cb09d377b
commit 394f15165b

@ -176,7 +176,7 @@ namespace Amarok
/** /**
* Returns internal code for database type, DbConnection::sqlite, DbConnection::mysql, or DbConnection::postgresql * Returns internal code for database type, DbConnection::sqlite, DbConnection::mysql, or DbConnection::postgresql
* @param type either "STQLite", "MySQL", or "Postgresql". * @param type either "SQLite", "MySQL", or "Postgresql".
*/ */
int databaseTypeCode( const TQString type ); //defined in configdialog.cpp int databaseTypeCode( const TQString type ); //defined in configdialog.cpp

@ -871,7 +871,7 @@ CollectionView::slotExpand( TQListViewItem* item ) //SLOT
if ( dynamic_cast<CollectionItem*>( item ) ) if ( dynamic_cast<CollectionItem*>( item ) )
{ {
itemText = static_cast<CollectionItem*>( item )->getSTQLText( 0 ); itemText = static_cast<CollectionItem*>( item )->getSQLText( 0 );
} }
else else
{ {
@ -940,7 +940,7 @@ CollectionView::slotExpand( TQListViewItem* item ) //SLOT
case 1: case 1:
tmptext = dynamic_cast<CollectionItem*>( item->parent() ) ? tmptext = dynamic_cast<CollectionItem*>( item->parent() ) ?
static_cast<CollectionItem*>( item->parent() )->getSTQLText( 0 ) : static_cast<CollectionItem*>( item->parent() )->getSQLText( 0 ) :
item->parent()->text( 0 ); item->parent()->text( 0 );
isUnknown = tmptext.isEmpty(); isUnknown = tmptext.isEmpty();
@ -1015,7 +1015,7 @@ CollectionView::slotExpand( TQListViewItem* item ) //SLOT
case 2: case 2:
tmptext = dynamic_cast<CollectionItem*> ( item->parent()->parent() ) ? tmptext = dynamic_cast<CollectionItem*> ( item->parent()->parent() ) ?
static_cast<CollectionItem*>( item->parent()->parent() )->getSTQLText( 0 ) : static_cast<CollectionItem*>( item->parent()->parent() )->getSQLText( 0 ) :
item->parent()->parent()->text( 0 ); item->parent()->parent()->text( 0 );
isUnknown = tmptext.isEmpty(); isUnknown = tmptext.isEmpty();
@ -1042,7 +1042,7 @@ CollectionView::slotExpand( TQListViewItem* item ) //SLOT
} }
tmptext = dynamic_cast<CollectionItem*>( item->parent() ) ? tmptext = dynamic_cast<CollectionItem*>( item->parent() ) ?
static_cast<CollectionItem*>( item->parent() )->getSTQLText( 0 ) : static_cast<CollectionItem*>( item->parent() )->getSQLText( 0 ) :
item->parent()->text( 0 ); item->parent()->text( 0 );
isUnknown = tmptext.isEmpty(); isUnknown = tmptext.isEmpty();
@ -2175,7 +2175,7 @@ CollectionView::getTrueItemText( int cat, TQListViewItem* item ) const
if ( dynamic_cast<CollectionItem*>( item ) ) if ( dynamic_cast<CollectionItem*>( item ) )
{ {
CollectionItem* collectItem = static_cast<CollectionItem*>( item ); CollectionItem* collectItem = static_cast<CollectionItem*>( item );
trueItemText = collectItem->getSTQLText( 0 ); trueItemText = collectItem->getSQLText( 0 );
if ( cat == IdVisYearAlbum && !collectItem->isUnknown() ) if ( cat == IdVisYearAlbum && !collectItem->isUnknown() )
trueItemText = trueItemText.right( trueItemText.length() - trueItemText.find( i18n( " - " ) ) - i18n( " - " ).length() ); trueItemText = trueItemText.right( trueItemText.length() - trueItemText.find( i18n( " - " ) ) - i18n( " - " ).length() );
} }
@ -2389,7 +2389,7 @@ CollectionView::listSelected()
qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL );
tmptext = static_cast<CollectionItem*>( item )->getSTQLText( 0 ); tmptext = static_cast<CollectionItem*>( item )->getSQLText( 0 );
unknownText = tmptext.isEmpty(); unknownText = tmptext.isEmpty();
if ( !sampler ) if ( !sampler )
@ -2470,7 +2470,7 @@ CollectionView::listSelected()
if ( q_cat1 == IdArtist ) if ( q_cat1 == IdArtist )
qb.setOptions( QueryBuilder::optNoCompilations ); qb.setOptions( QueryBuilder::optNoCompilations );
tmptext = static_cast<CollectionItem*>( item )->getSTQLText( 0 ); tmptext = static_cast<CollectionItem*>( item )->getSQLText( 0 );
unknownText = tmptext.isEmpty(); unknownText = tmptext.isEmpty();
if( VisYearAlbum == 1 ) if( VisYearAlbum == 1 )
@ -2489,7 +2489,7 @@ CollectionView::listSelected()
qb.setOptions( QueryBuilder::optOnlyCompilations ); qb.setOptions( QueryBuilder::optOnlyCompilations );
tmptext = static_cast<CollectionItem*>( child )->getSTQLText( 0 ); tmptext = static_cast<CollectionItem*>( child )->getSQLText( 0 );
unknownText = tmptext.isEmpty(); unknownText = tmptext.isEmpty();
if( VisYearAlbum == 2 ) if( VisYearAlbum == 2 )
@ -2574,7 +2574,7 @@ CollectionView::listSelected()
if ( q_cat1 == IdArtist ) if ( q_cat1 == IdArtist )
qb.setOptions( QueryBuilder::optNoCompilations ); qb.setOptions( QueryBuilder::optNoCompilations );
tmptext = static_cast<CollectionItem*>( item )->getSTQLText( 0 ); tmptext = static_cast<CollectionItem*>( item )->getSQLText( 0 );
unknownText = tmptext.isEmpty(); unknownText = tmptext.isEmpty();
if( VisYearAlbum == 1 ) if( VisYearAlbum == 1 )
@ -2592,7 +2592,7 @@ CollectionView::listSelected()
else else
qb.setOptions( QueryBuilder::optOnlyCompilations ); qb.setOptions( QueryBuilder::optOnlyCompilations );
tmptext = static_cast<CollectionItem*>( child )->getSTQLText( 0 ); tmptext = static_cast<CollectionItem*>( child )->getSQLText( 0 );
unknownText = tmptext.isEmpty(); unknownText = tmptext.isEmpty();
if( VisYearAlbum == 2 ) if( VisYearAlbum == 2 )
@ -2607,7 +2607,7 @@ CollectionView::listSelected()
qb.addMatch( q_cat2, tmptext, false, true ); qb.addMatch( q_cat2, tmptext, false, true );
tmptext = static_cast<CollectionItem*>( grandChild )->getSTQLText( 0 ); tmptext = static_cast<CollectionItem*>( grandChild )->getSQLText( 0 );
unknownText = tmptext.isEmpty(); unknownText = tmptext.isEmpty();
if( VisYearAlbum == 3 ) if( VisYearAlbum == 3 )
@ -3021,7 +3021,7 @@ CollectionView::incrementDepth( bool rerender /*= true*/ )
} }
else else
m_ipodFilters[m_currentDepth] << item->getSTQLText( 0 ); m_ipodFilters[m_currentDepth] << item->getSQLText( 0 );
// Save the selection // Save the selection
m_ipodSelected[m_currentDepth] << item->text( 0 ); m_ipodSelected[m_currentDepth] << item->text( 0 );

@ -161,7 +161,7 @@ class CollectionItem : public KListViewItem {
virtual void sortChildItems ( int column, bool ascending ); //reimplemented virtual void sortChildItems ( int column, bool ascending ); //reimplemented
inline TQString getSTQLText( int column ) inline TQString getSQLText( int column )
{ {
return ( !column && m_isUnknown ) ? "" : text( column ); return ( !column && m_isUnknown ) ? "" : text( column );
} }

@ -415,7 +415,7 @@ QueryBuilder::setLimit( int startPos, int length )
void void
QueryBuilder::initSTQLDrag() QueryBuilder::initSQLDrag()
{ {
clear(); clear();
addReturnValue( QueryBuilder::tabAlbum, QueryBuilder::valName ); addReturnValue( QueryBuilder::tabAlbum, QueryBuilder::valName );

@ -101,7 +101,7 @@ class QueryBuilder
void groupBy( int table, int value ); void groupBy( int table, int value );
void setLimit( int startPos, int length ); void setLimit( int startPos, int length );
void initSTQLDrag(); void initSQLDrag();
void buildQuery(); void buildQuery();
TQString getQuery(); TQString getQuery();
TQString query() { buildQuery(); return m_query; }; TQString query() { buildQuery(); return m_query; };

@ -290,7 +290,7 @@ ThreadManager::Thread::run()
DEBUG_BLOCK DEBUG_BLOCK
//keep this first, before anything that uses the database, or STQLite may error out //keep this first, before anything that uses the database, or SQLite may error out
if ( AmarokConfig::databaseEngine().toInt() == DbConnection::sqlite ) if ( AmarokConfig::databaseEngine().toInt() == DbConnection::sqlite )
CollectionDB::instance()->releasePreviousConnection( this ); CollectionDB::instance()->releasePreviousConnection( this );

Loading…
Cancel
Save