diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index 3a2ab78e2..c6268a8ba 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -495,7 +495,6 @@ target_link_libraries( tomahawklib ${LIBECHONEST_LIBRARY} ${QT_QTUITOOLS_LIBRARY} ${QT_LIBRARIES} - ${QT_QTUITOOLS_LIBRARY} # We really need to link twice against it for windows, maybe QTBUG-20498 is related ${OS_SPECIFIC_LINK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${LINK_LIBRARIES} diff --git a/src/libtomahawk/playlist/dynamic/database/DatabaseGenerator.cpp b/src/libtomahawk/playlist/dynamic/database/DatabaseGenerator.cpp index 1a71a3c5b..0baf8f0be 100644 --- a/src/libtomahawk/playlist/dynamic/database/DatabaseGenerator.cpp +++ b/src/libtomahawk/playlist/dynamic/database/DatabaseGenerator.cpp @@ -25,18 +25,21 @@ using namespace Tomahawk; + GeneratorInterface* DatabaseFactory::create() { return new DatabaseGenerator(); } + dyncontrol_ptr DatabaseFactory::createControl ( const QString& controlType ) { return dyncontrol_ptr( new DatabaseControl( controlType, typeSelectors() ) ); } + dyncontrol_ptr DatabaseFactory::createControl ( const QString& sql, DatabaseCommand_GenericSelect::QueryType type, const QString& summary ) { @@ -62,11 +65,12 @@ DatabaseGenerator::DatabaseGenerator ( QObject* parent ) // m_logo.load( RESPATH "images ) } + DatabaseGenerator::~DatabaseGenerator() { - } + QPixmap DatabaseGenerator::logo() { @@ -77,15 +81,15 @@ DatabaseGenerator::logo() void DatabaseGenerator::dynamicFetched() { - } + void DatabaseGenerator::dynamicStarted() { - } + void DatabaseGenerator::generate( int number ) { @@ -136,6 +140,7 @@ DatabaseGenerator::generate( int number ) } + void DatabaseGenerator::tracksGenerated ( const QList< query_ptr >& tracks ) { @@ -150,6 +155,7 @@ DatabaseGenerator::createControl( const QString& type ) return m_controls.last(); } + dyncontrol_ptr DatabaseGenerator::createControl ( const QString& sql, DatabaseCommand_GenericSelect::QueryType type, const QString& summary ) { @@ -160,10 +166,11 @@ DatabaseGenerator::createControl ( const QString& sql, DatabaseCommand_GenericSe void -DatabaseGenerator::fetchNext( int rating ) +DatabaseGenerator::fetchNext( int /* rating */ ) { } + QString DatabaseGenerator::sentenceSummary() { @@ -174,8 +181,8 @@ DatabaseGenerator::sentenceSummary() return QString(); } + void DatabaseGenerator::startOnDemand() { - } diff --git a/src/libtomahawk/playlist/treemodel.cpp b/src/libtomahawk/playlist/treemodel.cpp index 7e48523f5..56d8c2540 100644 --- a/src/libtomahawk/playlist/treemodel.cpp +++ b/src/libtomahawk/playlist/treemodel.cpp @@ -521,7 +521,6 @@ TreeModel::onAlbumsAdded( const QList& albums, const QVaria if ( parent.isValid() ) crows.second -= 1; - qDebug() << crows.first << crows.second; if ( !parent.isValid() || crows.second > 0 ) emit beginInsertRows( parent, crows.first, crows.second ); @@ -551,7 +550,6 @@ TreeModel::onAlbumsAdded( const QList& albums, const QVaria else emit dataChanged( albumitem->index, albumitem->index.sibling( albumitem->index.row(), columnCount( QModelIndex() ) - 1 ) ); - qDebug() << rowCount( parent ); emit loadingFinished(); } @@ -568,14 +566,16 @@ TreeModel::onTracksAdded( const QList& tracks, const QVaria QModelIndex parent = index( rows.first().toUInt(), 0, index( rows.at( 1 ).toUInt(), 0, QModelIndex() ) ); TreeModelItem* parentItem = itemFromIndex( parent ); - // the -1 is because we fake a rowCount of 1 to trigger Qt calling fetchMore() - int c = rowCount( parent ) - 1; QPair< int, int > crows; + int c = rowCount( parent ); crows.first = c; crows.second = c + tracks.count() - 1; - if ( crows.second > 0 ) - emit beginInsertRows( parent, crows.first + 1, crows.second ); + if ( parent.isValid() ) + crows.second -= 1; + + if ( !parent.isValid() || crows.second > 0 ) + emit beginInsertRows( parent, crows.first, crows.second ); TreeModelItem* item = 0; foreach( const query_ptr& query, tracks ) @@ -587,7 +587,7 @@ TreeModel::onTracksAdded( const QList& tracks, const QVaria connect( item, SIGNAL( dataChanged() ), SLOT( onDataChanged() ) ); } - if ( crows.second > 0 ) + if ( !parent.isValid() || crows.second > 0 ) emit endInsertRows(); emit dataChanged( item->index.sibling( 0, 0 ), item->index.sibling( item->index.row(), columnCount( QModelIndex() ) - 1 ) ); diff --git a/src/libtomahawk/viewmanager.cpp b/src/libtomahawk/viewmanager.cpp index 1be1c6a1e..6d990ebf3 100644 --- a/src/libtomahawk/viewmanager.cpp +++ b/src/libtomahawk/viewmanager.cpp @@ -80,13 +80,6 @@ ViewManager::ViewManager( QObject* parent ) m_infobar = new InfoBar(); m_stack = new QStackedWidget(); -#ifdef Q_OS_MAC - QFrame* line = new QFrame(); - line->setFrameStyle( QFrame::HLine ); - line->setStyleSheet( "border: 1px solid gray;" ); - line->setMaximumHeight( 1 ); -#endif - m_splitter = new AnimatedSplitter(); m_splitter->setOrientation( Qt::Vertical ); m_splitter->setChildrenCollapsible( false ); @@ -103,9 +96,6 @@ ViewManager::ViewManager( QObject* parent ) m_widget->layout()->addWidget( m_infobar ); m_widget->layout()->addWidget( m_topbar ); -#ifdef Q_OS_MAC - m_widget->layout()->addWidget( line ); -#endif m_widget->layout()->addWidget( m_splitter ); m_superCollectionView = new ArtistView(); diff --git a/src/libtomahawk/widgets/welcomewidget.cpp b/src/libtomahawk/widgets/welcomewidget.cpp index 1316069d2..fe1efb762 100644 --- a/src/libtomahawk/widgets/welcomewidget.cpp +++ b/src/libtomahawk/widgets/welcomewidget.cpp @@ -264,7 +264,7 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, QRect rectText = option.rect.adjusted( 66, 20, -100, -8 ); #ifdef Q_OS_MAC rectText.adjust( 0, 1, 0, 0 ); -#elif Q_OS_WIN +#elif defined Q_OS_WIN rectText.adjust( 0, 2, 0, 0 ); #endif diff --git a/src/tomahawkapp.cpp b/src/tomahawkapp.cpp index be2a680eb..a578f1b81 100644 --- a/src/tomahawkapp.cpp +++ b/src/tomahawkapp.cpp @@ -20,6 +20,8 @@ #include "config.h" +#include + #include #include #include @@ -110,8 +112,6 @@ using namespace Tomahawk; TomahawkApp::TomahawkApp( int& argc, char *argv[] ) : TOMAHAWK_APPLICATION( argc, argv ) { - qDebug() << "TomahawkApp thread:" << thread(); - setOrganizationName( QLatin1String( TOMAHAWK_ORGANIZATION_NAME ) ); setOrganizationDomain( QLatin1String( TOMAHAWK_ORGANIZATION_DOMAIN ) ); setApplicationName( QLatin1String( TOMAHAWK_APPLICATION_NAME ) ); @@ -130,6 +130,7 @@ TomahawkApp::init() ::exit(0); } + qDebug() << "TomahawkApp thread:" << thread(); Logger::setupLogfile(); qsrand( QTime( 0, 0, 0 ).secsTo( QTime::currentTime() ) ); @@ -303,21 +304,25 @@ TomahawkApp::instance() return (TomahawkApp*)TOMAHAWK_APPLICATION::instance(); } + void TomahawkApp::printHelp() { - std::cout << QString( "usage: " + arguments().at( 0 ) + " [options] [url]\n" ).toAscii().data(); - std::cout << QString( "options are:\n" ).toAscii().data(); - std::cout << QString( " --help Show this help\n" ).toAscii().data(); - std::cout << QString( " --http Initialize HTTP server\n" ).toAscii().data(); - std::cout << QString( " --filescan Scan for files on startup\n" ).toAscii().data(); - std::cout << QString( " --testdb Use a test database instead of real collection\n" ).toAscii().data(); - std::cout << QString( " --noupnp Disable UPNP\n" ).toAscii().data(); - std::cout << QString( " --nosip Disable SIP\n" ).toAscii().data(); - std::cout << QString( "\nurl is a tomahawk:// command or alternatively a url that Tomahawk can recognize.\n" ).toAscii().data(); - std::cout << QString( "For more documentation, see http://wiki.tomahawk-player.org/mediawiki/index.php/Tomahawk://_Links\n" ).toAscii().data(); + #define echo( X ) std::cout << QString( X ).toAscii().data() + + echo( "Usage: " + arguments().at( 0 ) + " [options] [url]\n" ); + echo( "Options are:\n" ); + echo( " --help Show this help\n" ); + echo( " --http Initialize HTTP server\n" ); + echo( " --filescan Scan for files on startup\n" ); + echo( " --testdb Use a test database instead of real collection\n" ); + echo( " --noupnp Disable UPNP\n" ); + echo( " --nosip Disable SIP\n" ); + echo( "\nurl is a tomahawk:// command or alternatively a url that Tomahawk can recognize.\n" ); + echo( "For more documentation, see http://wiki.tomahawk-player.org/mediawiki/index.php/Tomahawk://_Links\n" ); } + #ifndef TOMAHAWK_HEADLESS AudioControls* TomahawkApp::audioControls() diff --git a/src/tomahawkwindow.cpp b/src/tomahawkwindow.cpp index 13dba067d..bd17a5830 100644 --- a/src/tomahawkwindow.cpp +++ b/src/tomahawkwindow.cpp @@ -177,10 +177,8 @@ TomahawkWindow::applyPlatformTweaks() #endif #ifdef Q_OS_MAC - ui->hline1->setMaximumHeight( 0 ); - ui->hline2->setMaximumHeight( 0 ); - ui->hline1->hide(); - ui->hline2->hide(); + delete ui->hline1; + delete ui->hline2; #else ui->hline1->setStyleSheet( "border: 1px solid gray;" ); ui->hline2->setStyleSheet( "border: 1px solid gray;" ); @@ -213,7 +211,10 @@ TomahawkWindow::setupSideBar() sidebarWidget->setContentsMargins( 0, 0, 0, 0 ); sidebarWidget->layout()->setContentsMargins( 0, 0, 0, 0 ); sidebarWidget->layout()->setMargin( 0 ); + +#ifndef Q_OS_MAC sidebarWidget->layout()->setSpacing( 0 ); +#endif ui->splitter->addWidget( sidebarWidget ); ui->splitter->addWidget( ViewManager::instance()->widget() ); diff --git a/src/tomahawkwindow.ui b/src/tomahawkwindow.ui index c9fde85c0..57f53bbbc 100644 --- a/src/tomahawkwindow.ui +++ b/src/tomahawkwindow.ui @@ -67,7 +67,7 @@ 0 0 1000 - 20 + 22