Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 201284
Collapse All | Expand All

(-)amarok/src/app.cpp (-4 / +13 lines)
Lines 1355-1371 Link Here
1355
        result.replace( QChar(0x00fd), "y" ).replace( QChar(0x00dd), "Y" );
1355
        result.replace( QChar(0x00fd), "y" ).replace( QChar(0x00dd), "Y" );
1356
        result.replace( QChar(0x00f1), "n" ).replace( QChar(0x00d1), "N" );
1356
        result.replace( QChar(0x00f1), "n" ).replace( QChar(0x00d1), "N" );
1357
1357
1358
        // czech letters with carons
1359
        result.replace( QChar(0x0161), "s" ).replace( QChar(0x0160), "S" );
1360
        result.replace( QChar(0x010d), "c" ).replace( QChar(0x010c), "C" );
1361
        result.replace( QChar(0x0159), "r" ).replace( QChar(0x0158), "R" );
1362
        result.replace( QChar(0x017e), "z" ).replace( QChar(0x017d), "Z" );
1363
        result.replace( QChar(0x0165), "t" ).replace( QChar(0x0164), "T" );
1364
        result.replace( QChar(0x0148), "n" ).replace( QChar(0x0147), "N" );
1365
        result.replace( QChar(0x010f), "d" ).replace( QChar(0x010e), "D" );
1366
1358
        // accented vowels
1367
        // accented vowels
1359
        QChar a[] = { 'a', 0xe0,0xe1,0xe2,0xe3,0xe5, 0 };
1368
        QChar a[] = { 'a', 0xe0,0xe1,0xe2,0xe3,0xe5, 0 };
1360
        QChar A[] = { 'A', 0xc0,0xc1,0xc2,0xc3,0xc5, 0 };
1369
        QChar A[] = { 'A', 0xc0,0xc1,0xc2,0xc3,0xc5, 0 };
1361
        QChar E[] = { 'e', 0xe8,0xe9,0xea,0xeb, 0 };
1370
        QChar e[] = { 'e', 0xe8,0xe9,0xea,0xeb,0x11b, 0 };
1362
        QChar e[] = { 'E', 0xc8,0xc9,0xca,0xcb, 0 };
1371
        QChar E[] = { 'E', 0xc8,0xc9,0xca,0xcb,0x11a, 0 };
1363
        QChar i[] = { 'i', 0xec,0xed,0xee,0xef, 0 };
1372
        QChar i[] = { 'i', 0xec,0xed,0xee,0xef, 0 };
1364
        QChar I[] = { 'I', 0xcc,0xcd,0xce,0xcf, 0 };
1373
        QChar I[] = { 'I', 0xcc,0xcd,0xce,0xcf, 0 };
1365
        QChar o[] = { 'o', 0xf2,0xf3,0xf4,0xf5,0xf8, 0 };
1374
        QChar o[] = { 'o', 0xf2,0xf3,0xf4,0xf5,0xf8, 0 };
1366
        QChar O[] = { 'O', 0xd2,0xd3,0xd4,0xd5,0xd8, 0 };
1375
        QChar O[] = { 'O', 0xd2,0xd3,0xd4,0xd5,0xd8, 0 };
1367
        QChar u[] = { 'u', 0xf9,0xfa,0xfb, 0 };
1376
        QChar u[] = { 'u', 0xf9,0xfa,0xfb,0x16f, 0 };
1368
        QChar U[] = { 'U', 0xd9,0xda,0xdb, 0 };
1377
        QChar U[] = { 'U', 0xd9,0xda,0xdb,0x16e, 0 };
1369
        QChar nul[] = { 0 };
1378
        QChar nul[] = { 0 };
1370
        QChar *replacements[] = { a, A, e, E, i, I, o, O, u, U, nul };
1379
        QChar *replacements[] = { a, A, e, E, i, I, o, O, u, U, nul };
1371
1380
(-)amarok/src/collectionbrowser.cpp (-1 lines)
Lines 63-69 Link Here
63
#include <klocale.h>
63
#include <klocale.h>
64
#include <kmessagebox.h>
64
#include <kmessagebox.h>
65
#include <kpopupmenu.h>
65
#include <kpopupmenu.h>
66
#include <kstandarddirs.h>   //KGlobal::dirs()
67
#include <ktoolbarbutton.h> //ctor
66
#include <ktoolbarbutton.h> //ctor
68
#include <kurldrag.h>       //dragObject()
67
#include <kurldrag.h>       //dragObject()
69
#include <kio/job.h>
68
#include <kio/job.h>
(-)amarok/src/collectiondb.cpp (-20 / +27 lines)
Lines 67-72 Link Here
67
67
68
#include <cmath>                 //DbConnection::sqlite_power()
68
#include <cmath>                 //DbConnection::sqlite_power()
69
#include <ctime>                 //query()
69
#include <ctime>                 //query()
70
#include <cstdlib>               //exit()
70
#include <unistd.h>              //usleep()
71
#include <unistd.h>              //usleep()
71
72
72
#include <taglib/audioproperties.h>
73
#include <taglib/audioproperties.h>
Lines 217-222 Link Here
217
        : EngineObserver( EngineController::instance() )
218
        : EngineObserver( EngineController::instance() )
218
        , m_autoScoring( true )
219
        , m_autoScoring( true )
219
        , m_noCover( locate( "data", "amarok/images/nocover.png" ) )
220
        , m_noCover( locate( "data", "amarok/images/nocover.png" ) )
221
        , m_shadowImage( locate( "data", "amarok/images/shadow_albumcover.png" ) )
220
        , m_scanInProgress( false )
222
        , m_scanInProgress( false )
221
        , m_rescanRequired( false )
223
        , m_rescanRequired( false )
222
        , m_aftEnabledPersistentTables()
224
        , m_aftEnabledPersistentTables()
Lines 738-747 Link Here
738
    query( "CREATE INDEX tags_artist_index ON tags( artist );" );
740
    query( "CREATE INDEX tags_artist_index ON tags( artist );" );
739
    query( "CREATE INDEX tags_album_index ON tags( album );" );
741
    query( "CREATE INDEX tags_album_index ON tags( album );" );
740
    query( "CREATE INDEX tags_deviceid_index ON tags( deviceid ); ");
742
    query( "CREATE INDEX tags_deviceid_index ON tags( deviceid ); ");
741
    query( "CREATE INDEX tags_url_index ON tags( url(20) ); ");
743
    query( "CREATE INDEX tags_url_index ON tags( url ); ");
742
744
743
    query( "CREATE INDEX embed_deviceid_index ON embed( deviceid ); ");
745
    query( "CREATE INDEX embed_deviceid_index ON embed( deviceid ); ");
744
    query( "CREATE INDEX embed_url_index ON embed( url(20) ); "); 
746
    query( "CREATE INDEX embed_url_index ON embed( url ); "); 
745
747
746
    query( "CREATE INDEX related_artists_artist ON related_artists( artist );" );
748
    query( "CREATE INDEX related_artists_artist ON related_artists( artist );" );
747
749
Lines 2055-2065 Link Here
2055
    return s;
2057
    return s;
2056
}
2058
}
2057
2059
2058
2059
QString
2060
QString
2060
CollectionDB::makeShadowedImage( const QString& albumImage, bool cache )
2061
CollectionDB::makeShadowedImage( const QString& albumImage, bool cache )
2061
{
2062
{
2062
    const QImage original( albumImage );
2063
    qApp->lock();
2064
    const QImage original( albumImage, "PNG" );
2065
    qApp->unlock();
2063
2066
2064
    if( original.hasAlphaBuffer() )
2067
    if( original.hasAlphaBuffer() )
2065
        return albumImage;
2068
        return albumImage;
Lines 2067-2088 Link Here
2067
    const QFileInfo fileInfo( albumImage );
2070
    const QFileInfo fileInfo( albumImage );
2068
    const uint shadowSize = static_cast<uint>( original.width() / 100.0 * 6.0 );
2071
    const uint shadowSize = static_cast<uint>( original.width() / 100.0 * 6.0 );
2069
    const QString cacheFile = fileInfo.fileName() + "@shadow";
2072
    const QString cacheFile = fileInfo.fileName() + "@shadow";
2070
    QImage shadow;
2071
2073
2072
    if ( !cache && cacheCoverDir().exists( cacheFile ) )
2074
    if ( !cache && cacheCoverDir().exists( cacheFile ) )
2073
        return cacheCoverDir().filePath( cacheFile );
2075
        return cacheCoverDir().filePath( cacheFile );
2074
2076
2077
    QImage shadow;
2078
2075
    const QString folder = Amarok::saveLocation( "covershadow-cache/" );
2079
    const QString folder = Amarok::saveLocation( "covershadow-cache/" );
2076
    const QString file = QString( "shadow_albumcover%1x%2.png" ).arg( original.width() + shadowSize ).arg( original.height() + shadowSize  );
2080
    const QString file = QString( "shadow_albumcover%1x%2.png" ).arg( original.width() + shadowSize ).arg( original.height() + shadowSize  );
2077
    if ( QFile::exists( folder + file ) )
2081
    if ( QFile::exists( folder + file ) ) {
2078
        shadow.load( folder + file );
2082
        qApp->lock();
2083
        shadow.load( folder + file, "PNG" );
2084
        qApp->unlock();
2085
    }
2079
    else {
2086
    else {
2080
        shadow.load( locate( "data", "amarok/images/shadow_albumcover.png" ) );
2087
        shadow = QDeepCopy<QImage>(instance()->m_shadowImage);
2081
        shadow = shadow.smoothScale( original.width() + shadowSize, original.height() + shadowSize );
2088
        shadow = shadow.smoothScale( original.width() + shadowSize, original.height() + shadowSize );
2082
        shadow.save( folder + file, "PNG" );
2089
        shadow.save( folder + file, "PNG" );
2083
    }
2090
    }
2084
2091
2085
    QImage target( shadow );
2092
    QImage target(shadow);
2086
    bitBlt( &target, 0, 0, &original );
2093
    bitBlt( &target, 0, 0, &original );
2087
2094
2088
    if ( cache ) {
2095
    if ( cache ) {
Lines 2642-2651 Link Here
2642
        pcb.setCopyright   ( *++it );
2649
        pcb.setCopyright   ( *++it );
2643
        pcb.setParentId    ( (*++it).toInt() );
2650
        pcb.setParentId    ( (*++it).toInt() );
2644
        pcb.setSaveLocation( *++it );
2651
        pcb.setSaveLocation( *++it );
2645
        pcb.setAutoScan    ( *++it == boolT() ? true : false );
2652
        pcb.setAutoScan    ( boolFromSql( *++it ) );
2646
        pcb.setFetchType   ( (*++it).toInt() );
2653
        pcb.setFetchType   ( (*++it).toInt() );
2647
        pcb.setAutoTransfer( *++it == boolT() ? true : false  );
2654
        pcb.setAutoTransfer( boolFromSql( *++it ) );
2648
        pcb.setPurge       ( *++it == boolT() ? true : false  );
2655
        pcb.setPurge       ( boolFromSql( *++it ) );
2649
        pcb.setPurgeCount  ( (*++it).toInt() );
2656
        pcb.setPurgeCount  ( (*++it).toInt() );
2650
2657
2651
        bundles.append( pcb );
2658
        bundles.append( pcb );
Lines 2689-2695 Link Here
2689
            peb.setSize        ( 0 );
2696
            peb.setSize        ( 0 );
2690
        else
2697
        else
2691
            peb.setSize        ( (*it).toInt() );
2698
            peb.setSize        ( (*it).toInt() );
2692
        peb.setNew         ( (*++it) == boolT() ? true : false  );
2699
        peb.setNew         ( boolFromSql( *++it ) );
2693
2700
2694
        bundles.append( peb );
2701
        bundles.append( peb );
2695
    }
2702
    }
Lines 2723-2729 Link Here
2723
            peb.setSize    ( 0 );
2730
            peb.setSize    ( 0 );
2724
        else
2731
        else
2725
            peb.setSize    ( (*it).toInt() );
2732
            peb.setSize    ( (*it).toInt() );
2726
        peb.setNew         ( (*++it) == boolT() ? true : false  );
2733
        peb.setNew         ( boolFromSql( *++it ) );
2727
    }
2734
    }
2728
2735
2729
    return peb;
2736
    return peb;
Lines 2778-2787 Link Here
2778
        pcb->setCopyright   ( *++it );
2785
        pcb->setCopyright   ( *++it );
2779
        pcb->setParentId    ( (*++it).toInt() );
2786
        pcb->setParentId    ( (*++it).toInt() );
2780
        pcb->setSaveLocation( *++it );
2787
        pcb->setSaveLocation( *++it );
2781
        pcb->setAutoScan    ( *++it == boolT() ? true : false );
2788
        pcb->setAutoScan    ( boolFromSql( *++it ) );
2782
        pcb->setFetchType   ( (*++it).toInt() );
2789
        pcb->setFetchType   ( (*++it).toInt() );
2783
        pcb->setAutoTransfer( *++it == boolT() ? true : false  );
2790
        pcb->setAutoTransfer( boolFromSql( *++it ) );
2784
        pcb->setPurge       ( *++it == boolT() ? true : false  );
2791
        pcb->setPurge       ( boolFromSql( *++it ) );
2785
        pcb->setPurgeCount  ( (*++it).toInt() );
2792
        pcb->setPurgeCount  ( (*++it).toInt() );
2786
    }
2793
    }
2787
2794
Lines 2794-2800 Link Here
2794
{
2801
{
2795
    QString command = QString( "INSERT INTO podcastfolders ( name, parent, isOpen ) VALUES ('" );
2802
    QString command = QString( "INSERT INTO podcastfolders ( name, parent, isOpen ) VALUES ('" );
2796
    command += escapeString( name )   + "',";
2803
    command += escapeString( name )   + "',";
2797
    command += QString::number( parent_id ) + ',';
2804
    command += QString::number( parent_id ) + ",";
2798
    command += isOpen ? boolT() + ");" : boolF() + ");";
2805
    command += isOpen ? boolT() + ");" : boolF() + ");";
2799
2806
2800
    insert( command, NULL );
2807
    insert( command, NULL );
Lines 4718-4724 Link Here
4718
        {
4725
        {
4719
            recreateConnections = true;
4726
            recreateConnections = true;
4720
        }
4727
        }
4721
        else if ( AmarokConfig::mySqlPassword() != config->password() )
4728
        else if ( AmarokConfig::mySqlPassword2() != config->password() )
4722
        {
4729
        {
4723
            recreateConnections = true;
4730
            recreateConnections = true;
4724
        }
4731
        }
Lines 7834-7840 Link Here
7834
QueryBuilder::tableName( int table )
7841
QueryBuilder::tableName( int table )
7835
{
7842
{
7836
    // optimize for 1 table which is by far the most frequent case
7843
    // optimize for 1 table which is by far the most frequent case
7837
    static const QString tabNames[] = {
7844
    static const char tabNames[][16] = {
7838
        "album",
7845
        "album",
7839
        "artist",
7846
        "artist",
7840
        "composer",
7847
        "composer",
(-)amarok/src/collectiondb.h (-1 / +2 lines)
Lines 253-258 Link Here
253
253
254
        QString boolT() const { if (getDbConnectionType() == DbConnection::postgresql) return "true"; else return "1"; }
254
        QString boolT() const { if (getDbConnectionType() == DbConnection::postgresql) return "true"; else return "1"; }
255
        QString boolF() const { if (getDbConnectionType() == DbConnection::postgresql) return "false"; else return "0"; }
255
        QString boolF() const { if (getDbConnectionType() == DbConnection::postgresql) return "false"; else return "0"; }
256
        inline bool boolFromSql( const QString &b ) { return ( b == boolT() || b == "t" ); }
256
        //textColumnType should be used for normal strings, which need to be compared
257
        //textColumnType should be used for normal strings, which need to be compared
257
        //either case-sensitively or -insensitively
258
        //either case-sensitively or -insensitively
258
        QString textColumnType( int length=255 ) const { if ( getDbConnectionType() == DbConnection::postgresql ) return "TEXT"; else return QString("VARCHAR(%1)").arg(length); }
259
        QString textColumnType( int length=255 ) const { if ( getDbConnectionType() == DbConnection::postgresql ) return "TEXT"; else return QString("VARCHAR(%1)").arg(length); }
Lines 619-625 Link Here
619
620
620
        static QMap<QListViewItem*, CoverFetcher*> *itemCoverMap;
621
        static QMap<QListViewItem*, CoverFetcher*> *itemCoverMap;
621
        static QMutex *itemCoverMapMutex;
622
        static QMutex *itemCoverMapMutex;
622
        QImage m_noCover;
623
        QImage m_noCover, m_shadowImage;
623
624
624
        static QMap<QThread *, DbConnection *> *threadConnections;
625
        static QMap<QThread *, DbConnection *> *threadConnections;
625
        static QMutex *connectionMutex;
626
        static QMutex *connectionMutex;
(-)amarok/src/contextbrowser.cpp (-11 / +31 lines)
Lines 212-218 Link Here
212
212
213
    m_contextTab = new QVBox(this, "context_tab");
213
    m_contextTab = new QVBox(this, "context_tab");
214
214
215
    m_currentTrackPage = new HTMLView( m_contextTab, "current_track_page", true /* DNDEnabled */ );
215
    m_currentTrackPage = new HTMLView( m_contextTab, "current_track_page", true /* DNDEnabled */,
216
            true /*JScriptEnabled*/ );
216
217
217
    m_lyricsTab = new QVBox(this, "lyrics_tab");
218
    m_lyricsTab = new QVBox(this, "lyrics_tab");
218
219
Lines 264-270 Link Here
264
265
265
266
266
267
267
    m_lyricsPage = new HTMLView( m_lyricsTab, "lyrics_page", true /* DNDEnabled */ );
268
    m_lyricsPage = new HTMLView( m_lyricsTab, "lyrics_page", true /* DNDEnabled */, false /* JScriptEnabled*/ );
268
    m_lyricsTextEdit = new KTextEdit ( m_lyricsTab, "lyrics_text_edit");
269
    m_lyricsTextEdit = new KTextEdit ( m_lyricsTab, "lyrics_text_edit");
269
    m_lyricsTextEdit->setTextFormat( Qt::PlainText );
270
    m_lyricsTextEdit->setTextFormat( Qt::PlainText );
270
    m_lyricsTextEdit->hide();
271
    m_lyricsTextEdit->hide();
Lines 285-291 Link Here
285
    m_wikiToolBar->setDelayedPopup( WIKI_BACK, m_wikiBackPopup );
286
    m_wikiToolBar->setDelayedPopup( WIKI_BACK, m_wikiBackPopup );
286
    m_wikiToolBar->setDelayedPopup( WIKI_FORWARD, m_wikiForwardPopup );
287
    m_wikiToolBar->setDelayedPopup( WIKI_FORWARD, m_wikiForwardPopup );
287
288
288
    m_wikiPage = new HTMLView( m_wikiTab, "wiki_page", true /* DNDEnabled */ );
289
    m_wikiPage = new HTMLView( m_wikiTab, "wiki_page", true /* DNDEnabled */, false /* JScriptEnabled */ );
289
290
290
    m_cuefile = CueFile::instance();
291
    m_cuefile = CueFile::instance();
291
    connect( m_cuefile, SIGNAL(metaData( const MetaBundle& )),
292
    connect( m_cuefile, SIGNAL(metaData( const MetaBundle& )),
Lines 1104-1109 Link Here
1104
        {
1105
        {
1105
            m_metadataHistory += QDeepCopy<QString>( *it );
1106
            m_metadataHistory += QDeepCopy<QString>( *it );
1106
        }
1107
        }
1108
1109
1110
        m_amarokIconPath = QDeepCopy<QString>(KGlobal::iconLoader()->iconPath( "amarok",
1111
                    -KIcon::SizeEnormous ) );
1112
        m_musicBrainIconPath = QDeepCopy<QString>(locate( "data", "amarok/images/musicbrainz.png" )
1113
                );
1114
        m_lastfmIcon = "file://" + locate( "data","amarok/images/lastfm.png" );
1107
    }
1115
    }
1108
1116
1109
private:
1117
private:
Lines 1145-1150 Link Here
1145
        b->saveHtmlData(); // Send html code to file
1153
        b->saveHtmlData(); // Send html code to file
1146
    }
1154
    }
1147
    QString m_HTMLSource;
1155
    QString m_HTMLSource;
1156
    QString m_amarokIconPath;
1157
    QString m_musicBrainIconPath;
1158
    QString m_lastfmIcon;
1148
1159
1149
    ContextBrowser *b;
1160
    ContextBrowser *b;
1150
    MetaBundle m_currentTrack;
1161
    MetaBundle m_currentTrack;
Lines 1329-1335 Link Here
1329
                "</div>\n" )
1340
                "</div>\n" )
1330
            .args( QStringList()
1341
            .args( QStringList()
1331
                    << escapeHTMLAttr( "externalurl://amarok.kde.org" )
1342
                    << escapeHTMLAttr( "externalurl://amarok.kde.org" )
1332
                    << escapeHTMLAttr( KGlobal::iconLoader()->iconPath( "amarok", -KIcon::SizeEnormous ) )
1343
                    << escapeHTMLAttr( m_amarokIconPath )
1333
                    << i18n( "1 Track",  "%n Tracks",  songCount.toInt() )
1344
                    << i18n( "1 Track",  "%n Tracks",  songCount.toInt() )
1334
                    << i18n( "1 Artist", "%n Artists", artistCount.toInt() )
1345
                    << i18n( "1 Artist", "%n Artists", artistCount.toInt() )
1335
                    << i18n( "1 Album",  "%n Albums",  albumCount.toInt() )
1346
                    << i18n( "1 Album",  "%n Albums",  albumCount.toInt() )
Lines 1743-1749 Link Here
1743
    const QString albumUrl   = lastFmInfo->albumUrl();
1754
    const QString albumUrl   = lastFmInfo->albumUrl();
1744
    const QString artistUrl  = lastFmInfo->artistUrl();
1755
    const QString artistUrl  = lastFmInfo->artistUrl();
1745
    const QString titleUrl   = lastFmInfo->titleUrl();
1756
    const QString titleUrl   = lastFmInfo->titleUrl();
1746
    const QString lastfmIcon = "file://" + locate( "data","amarok/images/lastfm.png" );
1747
1757
1748
    const QString coverImage = ContextBrowser::getEncodedImage( lastFmInfo->imageUrl() );
1758
    const QString coverImage = ContextBrowser::getEncodedImage( lastFmInfo->imageUrl() );
1749
1759
Lines 1818-1824 Link Here
1818
            << escapeHTMLAttr( currentTrack.album() )//10
1828
            << escapeHTMLAttr( currentTrack.album() )//10
1819
            << escapeHTMLAttr( userpage ) //11
1829
            << escapeHTMLAttr( userpage ) //11
1820
            << escapeHTMLAttr( userpage ) //12
1830
            << escapeHTMLAttr( userpage ) //12
1821
            << escapeHTMLAttr( lastfmIcon ) //13
1831
            << escapeHTMLAttr( m_lastfmIcon ) //13
1822
            << escapeHTML( i18n( "Skip" ) ) //14
1832
            << escapeHTML( i18n( "Skip" ) ) //14
1823
            << escapeHTMLAttr( skipIcon ) //15
1833
            << escapeHTMLAttr( skipIcon ) //15
1824
            << escapeHTML( i18n( "Love" ) ) //16
1834
            << escapeHTML( i18n( "Love" ) ) //16
Lines 2249-2255 Link Here
2249
                        << escapeHTMLAttr( currentTrack.artist() )
2259
                        << escapeHTMLAttr( currentTrack.artist() )
2250
                        << escapeHTMLAttr( currentTrack.album() )
2260
                        << escapeHTMLAttr( currentTrack.album() )
2251
                        << escapeHTMLAttr( currentTrack.title() )
2261
                        << escapeHTMLAttr( currentTrack.title() )
2252
                        << escapeHTML( locate( "data", "amarok/images/musicbrainz.png" ) ) )
2262
                        << escapeHTML( m_musicBrainIconPath ) )
2253
                : QString ( //no title
2263
                : QString ( //no title
2254
                        "<span id='current_box-header-prettytitle' class='box-header-prettytitle'>%1</span> "
2264
                        "<span id='current_box-header-prettytitle' class='box-header-prettytitle'>%1</span> "
2255
                        "</div>\n"
2265
                        "</div>\n"
Lines 2612-2618 Link Here
2612
    qb.groupBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
2622
    qb.groupBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
2613
    qb.groupBy( QueryBuilder::tabAlbum, QueryBuilder::valID );
2623
    qb.groupBy( QueryBuilder::tabAlbum, QueryBuilder::valID );
2614
    qb.sortByFunction( QueryBuilder::funcMax, QueryBuilder::tabYear, QueryBuilder::valName, true );
2624
    qb.sortByFunction( QueryBuilder::funcMax, QueryBuilder::tabYear, QueryBuilder::valName, true );
2615
    qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
2625
    qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName, true );
2616
    qb.setOptions( QueryBuilder::optNoCompilations );
2626
    qb.setOptions( QueryBuilder::optNoCompilations );
2617
    values = qb.run();
2627
    values = qb.run();
2618
2628
Lines 2775-2781 Link Here
2775
    qb.addReturnValue( QueryBuilder::tabAlbum, QueryBuilder::valID );
2785
    qb.addReturnValue( QueryBuilder::tabAlbum, QueryBuilder::valID );
2776
    qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) );
2786
    qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) );
2777
    qb.sortBy( QueryBuilder::tabYear, QueryBuilder::valName, true );
2787
    qb.sortBy( QueryBuilder::tabYear, QueryBuilder::valName, true );
2778
    qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
2788
    qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName, true );
2779
    qb.setOptions( QueryBuilder::optRemoveDuplicates );
2789
    qb.setOptions( QueryBuilder::optRemoveDuplicates );
2780
    qb.setOptions( QueryBuilder::optOnlyCompilations );
2790
    qb.setOptions( QueryBuilder::optOnlyCompilations );
2781
    values = qb.run();
2791
    values = qb.run();
Lines 3192-3202 Link Here
3192
{
3202
{
3193
    // Embed cover image in html (encoded string), to get around khtml's caching
3203
    // Embed cover image in html (encoded string), to get around khtml's caching
3194
    //debug() << "Encoding imageUrl: " << imageUrl << endl;
3204
    //debug() << "Encoding imageUrl: " << imageUrl << endl;
3195
    const QImage img( imageUrl );
3205
    qApp->lock();
3206
    const QImage img( imageUrl, "PNG" );
3207
    qApp->unlock();
3196
    QByteArray ba;
3208
    QByteArray ba;
3197
    QBuffer buffer( ba );
3209
    QBuffer buffer( ba );
3198
    buffer.open( IO_WriteOnly );
3210
    buffer.open( IO_WriteOnly );
3211
    qApp->lock();
3199
    img.save( &buffer, "PNG" ); // writes image into ba in PNG format
3212
    img.save( &buffer, "PNG" ); // writes image into ba in PNG format
3213
    qApp->unlock();
3200
    const QString coverImage = QString( "data:image/png;base64,%1" ).arg( KCodecs::base64Encode( ba ) );
3214
    const QString coverImage = QString( "data:image/png;base64,%1" ).arg( KCodecs::base64Encode( ba ) );
3201
    //debug() << "Encoded imageUrl: " << coverImage << endl;
3215
    //debug() << "Encoded imageUrl: " << coverImage << endl;
3202
    return coverImage;
3216
    return coverImage;
Lines 3716-3723 Link Here
3716
QString
3730
QString
3717
ContextBrowser::wikiURL( const QString &item )
3731
ContextBrowser::wikiURL( const QString &item )
3718
{
3732
{
3733
    // add any special characters to be replaced here
3734
    QString wStr = QString(item).replace( "/", " " );
3735
3719
    return QString( "http://%1.wikipedia.org/wiki/" ).arg( wikiLocale() )
3736
    return QString( "http://%1.wikipedia.org/wiki/" ).arg( wikiLocale() )
3720
        + KURL::encode_string_no_slash( item, 106 /*utf-8*/ );
3737
        + KURL::encode_string_no_slash( wStr, 106 /*utf-8*/ );
3721
}
3738
}
3722
3739
3723
void
3740
void
Lines 4326-4331 Link Here
4326
    //which can be confusing, and looks less polished/professional
4343
    //which can be confusing, and looks less polished/professional
4327
    //This can be changed if it slows things down too much...
4344
    //This can be changed if it slows things down too much...
4328
    if( m_browseLabels || ( currentTrack.isFile() && ( currentTrack.url().path() == path || AmarokConfig::useRatings() ) ) )
4345
    if( m_browseLabels || ( currentTrack.isFile() && ( currentTrack.url().path() == path || AmarokConfig::useRatings() ) ) )
4346
        m_dirtyCurrentTrackPage = true; // will be reloaded when viewed (much faster)
4347
     
4348
    if( currentPage() == m_contextTab )
4329
        refreshCurrentTrackPage();
4349
        refreshCurrentTrackPage();
4330
}
4350
}
4331
4351
(-)amarok/src/dynamicmode.cpp (-1 / +2 lines)
Lines 380-386 Link Here
380
DEBUG_BLOCK
380
DEBUG_BLOCK
381
    KURL::List retrieval;
381
    KURL::List retrieval;
382
382
383
    if( m_cachedItemSet.count() <= trackCount )
383
    // always rebuild with suggested mode since the artists will be changing
384
    if( m_cachedItemSet.count() <= trackCount || appendType() == SUGGESTION )
384
        rebuildCachedItemSet();
385
        rebuildCachedItemSet();
385
386
386
    for( uint i=0; i < trackCount; i++ )
387
    for( uint i=0; i < trackCount; i++ )
(-)amarok/src/enginecontroller.cpp (-7 / +15 lines)
Lines 244-256 Link Here
244
    if( engine() != EngineController::instance()->m_voidEngine )
244
    if( engine() != EngineController::instance()->m_voidEngine )
245
    {
245
    {
246
        //we special case this as otherwise users hate us
246
        //we special case this as otherwise users hate us
247
        if ( !valid && ext.lower() == "mp3" && !installDistroCodec(AmarokConfig::soundSystem()) )
247
        if ( !valid && ext.lower() == "mp3"){
248
            Amarok::StatusBar::instance()->longMessageThreadSafe(
248
            QCustomEvent * e = new QCustomEvent( 2000 );
249
                    i18n( "<p>The %1 claims it <b>cannot</b> play MP3 files."
249
            QApplication::postEvent( Amarok::StatusBar::instance(), e );
250
                        "<p>You may want to choose a different engine from the <i>Configure Dialog</i>, or examine "
250
	}
251
                        "the installation of the multimedia-framework that the current engine uses. "
252
                        "<p>You may find useful information in the <i>FAQ</i> section of the <i>Amarok HandBook</i>." )
253
                    .arg( AmarokConfig::soundSystem() ), KDE::StatusBar::Error );
254
251
255
        // Cache this result for the next lookup
252
        // Cache this result for the next lookup
256
        if ( !ext.isEmpty() )
253
        if ( !ext.isEmpty() )
Lines 260-265 Link Here
260
    return valid;
257
    return valid;
261
}
258
}
262
259
260
void EngineController::unplayableNotification() {
261
262
    if( !installDistroCodec(AmarokConfig::soundSystem()))
263
        Amarok::StatusBar::instance()->longMessageThreadSafe(
264
                  i18n( "<p>The %1 claims it <b>cannot</b> play MP3 files."
265
                        "<p>You may want to choose a different engine from the <i>Configure Dialog</i>, or examine "
266
                        "the installation of the multimedia-framework that the current engine uses. "
267
                        "<p>You may find useful information in the <i>FAQ</i> section of the <i>Amarok HandBook</i>." )
268
                    .arg( AmarokConfig::soundSystem() ), KDE::StatusBar::Error );
269
}
270
263
bool EngineController::installDistroCodec( const QString& engine /*Filetype type*/)
271
bool EngineController::installDistroCodec( const QString& engine /*Filetype type*/)
264
{
272
{
265
    KService::Ptr service = KTrader::self()->query( "Amarok/CodecInstall"
273
    KService::Ptr service = KTrader::self()->query( "Amarok/CodecInstall"
(-)amarok/src/enginecontroller.h (+1 lines)
Lines 52-57 Link Here
52
    uint                     trackPosition() const;
52
    uint                     trackPosition() const;
53
53
54
    EngineBase* loadEngine();
54
    EngineBase* loadEngine();
55
    void unplayableNotification();
55
56
56
    uint trackLength() const { return m_bundle.length() * 1000; }
57
    uint trackLength() const { return m_bundle.length() * 1000; }
57
    const MetaBundle &bundle() const;
58
    const MetaBundle &bundle() const;
(-)amarok/src/mountpointmanager.cpp (+1 lines)
Lines 233-238 Link Here
233
MountPointManager::getAbsolutePath( const int deviceId, const QString& relativePath ) const
233
MountPointManager::getAbsolutePath( const int deviceId, const QString& relativePath ) const
234
{
234
{
235
    KURL rpath;
235
    KURL rpath;
236
    rpath.setProtocol("file");
236
    rpath.setPath( relativePath );
237
    rpath.setPath( relativePath );
237
    KURL url;
238
    KURL url;
238
    getAbsolutePath( deviceId, rpath, url );
239
    getAbsolutePath( deviceId, rpath, url );
(-)amarok/src/statusbar/statusBarBase.cpp (-3 / +8 lines)
Lines 25-30 Link Here
25
#include "squeezedtextlabel.h"
25
#include "squeezedtextlabel.h"
26
#include "statusBarBase.h"
26
#include "statusBarBase.h"
27
#include "threadmanager.h"
27
#include "threadmanager.h"
28
#include "enginecontroller.h"
28
29
29
#include <kio/job.h>
30
#include <kio/job.h>
30
#include <kiconloader.h>
31
#include <kiconloader.h>
Lines 343-351 Link Here
343
void
344
void
344
StatusBar::customEvent( QCustomEvent *e )
345
StatusBar::customEvent( QCustomEvent *e )
345
{
346
{
346
    QString *s = static_cast<QString*>( e->data() );
347
    if(e->type() == 1000 ){ 
347
    longMessage( *s );
348
      QString *s = static_cast<QString*>( e->data() );
348
    delete s;
349
      longMessage( *s );
350
      delete s;
351
    }else if(e->type() == 2000 ){
352
      EngineController::instance()->unplayableNotification();
353
    }
349
}
354
}
350
355
351
356

Return to bug 201284