diff --git a/include/tomahawk/plugin_includes.h b/include/tomahawk/plugin_includes.h deleted file mode 100644 index f8844e05f..000000000 --- a/include/tomahawk/plugin_includes.h +++ /dev/null @@ -1,31 +0,0 @@ -/* === This file is part of Tomahawk Player - === - * - * Copyright 2010-2011, Christian Muehlhaeuser - * - * Tomahawk is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Tomahawk is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Tomahawk. If not, see . - */ - -#ifndef PLUGIN_INCLUDES_H -#define PLUGIN_INCLUDES_H - -// all the stuff a plugin needs - -#include "tomahawk/resolver.h" -#include "tomahawk/pluginapi.h" -#include "tomahawk/typedefs.h" -#include "tomahawk/tomahawkplugin.h" -#include "tomahawk/collection.h" -#include "tomahawk/source.h" - -#endif // PLUGIN_INCLUDES_H diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 47a058c81..42ea6e0fe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,7 +17,6 @@ SET( CMAKE_VERBOSE_MAKEFILE ON ) SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" ) SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" ) SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" ) -SET( TOMAHAWK_INC_DIR "${CMAKE_SOURCE_DIR}/include/" ) IF( NOT CMAKE_BUILD_TYPE STREQUAL "Release" ) MESSAGE( "Building in debug mode, enabling all debug updates" ) SET( DEBUG_BUILD ON ) @@ -73,8 +72,7 @@ SET( tomahawkSourcesGui ${tomahawkSourcesGui} ) SET( tomahawkHeaders ${tomahawkHeaders} - "${TOMAHAWK_INC_DIR}/tomahawk/tomahawkapp.h" - + tomahawkapp.h web/api_v1.h @@ -128,7 +126,6 @@ SET( tomahawkUI ${tomahawkUI} INCLUDE_DIRECTORIES( . - ${TOMAHAWK_INC_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/thirdparty/liblastfm2/src diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index 8079e17e3..def12ffd7 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -355,7 +355,6 @@ include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/. ${PHONON_INCLUDES} ${CMAKE_BINARY_DIR}/thirdparty/liblastfm2/src - ../../include playlist ${THIRDPARTY_DIR}/libportfwd/include diff --git a/src/libtomahawk/network/servent.cpp b/src/libtomahawk/network/servent.cpp index 447818785..9fefce30e 100644 --- a/src/libtomahawk/network/servent.cpp +++ b/src/libtomahawk/network/servent.cpp @@ -185,6 +185,7 @@ Servent::createConnectionKey( const QString& name, const QString &nodeid, const if( !nodeid.isEmpty() ) cc->setId( nodeid ); cc->setOnceOnly( onceOnly ); + qDebug() << "Creating connection key with name of " << cc->name() << " and id of " << cc->id() << " and key of " << _key << "; key is once only? : " << (onceOnly ? "true" : "false"); registerOffer( _key, cc ); return _key; @@ -439,7 +440,6 @@ void Servent::handoverSocket( Connection* conn, QTcpSocketExtra* sock ) disconnect( sock, SIGNAL( error( QAbstractSocket::SocketError ) ), this, SLOT( socketError( QAbstractSocket::SocketError ) ) ); - sock->_disowned = true; conn->setOutbound( sock->_outbound ); conn->setPeerPort( sock->peerPort() ); diff --git a/src/libtomahawk/playlist.cpp b/src/libtomahawk/playlist.cpp index 17a1622a4..03581a8e4 100644 --- a/src/libtomahawk/playlist.cpp +++ b/src/libtomahawk/playlist.cpp @@ -344,70 +344,67 @@ Playlist::setNewRevision( const QString& rev, foreach( const plentry_ptr& p, m_entries ) entriesmap.insert( p->guid(), p ); + QList entries; + foreach( const QString& id, neworderedguids ) + { + qDebug() << "id:" << id; + qDebug() << "newordered:" << neworderedguids.count() << neworderedguids; + qDebug() << "entriesmap:" << entriesmap.count() << entriesmap; + qDebug() << "addedmap:" << addedmap.count() << addedmap; + qDebug() << "m_entries" << m_entries; - QList entries; - - foreach( const QString& id, neworderedguids ) + if( entriesmap.contains( id ) ) { - //qDebug() << "id:" << id; - //qDebug() << "newordered:" << neworderedguids.count() << neworderedguids; - //qDebug() << "entriesmap:" << entriesmap.count() << entriesmap; - //qDebug() << "addedmap:" << addedmap.count() << addedmap; - //qDebug() << "m_entries" << m_entries; - - if( entriesmap.contains( id ) ) - { - entries.append( entriesmap.value( id ) ); - } - else if( addedmap.contains( id ) ) - { - entries.append( addedmap.value( id ) ); - if( is_newest_rev ) - m_entries.append( addedmap.value( id ) ); - } - else - { - Q_ASSERT( false ); // XXX - } + entries.append( entriesmap.value( id ) ); } - - //qDebug() << Q_FUNC_INFO << rev << entries.length() << applied; - - PlaylistRevision pr; - pr.oldrevisionguid = m_currentrevision; - pr.revisionguid = rev; - - // entries that have been removed: - QSet removedguids = oldorderedguids.toSet().subtract( neworderedguids.toSet() ); - //qDebug() << "Removedguids:" << removedguids << "oldorederedguids" << oldorderedguids << "newog" << neworderedguids; - foreach( QString remid, removedguids ) + else if( addedmap.contains( id ) ) { - // NB: entriesmap will contain old/removed entries only if the removal was done - // in the same session - after a restart, history is not in memory. - if( entriesmap.contains( remid ) ) + entries.append( addedmap.value( id ) ); + if( is_newest_rev ) + m_entries.append( addedmap.value( id ) ); + } + else + { + Q_ASSERT( false ); // XXX + } + } + + //qDebug() << Q_FUNC_INFO << rev << entries.length() << applied; + + PlaylistRevision pr; + pr.oldrevisionguid = m_currentrevision; + pr.revisionguid = rev; + + // entries that have been removed: + QSet removedguids = oldorderedguids.toSet().subtract( neworderedguids.toSet() ); + //qDebug() << "Removedguids:" << removedguids << "oldorederedguids" << oldorderedguids << "newog" << neworderedguids; + foreach( QString remid, removedguids ) + { + // NB: entriesmap will contain old/removed entries only if the removal was done + // in the same session - after a restart, history is not in memory. + if( entriesmap.contains( remid ) ) + { + pr.removed << entriesmap.value( remid ); + if( is_newest_rev ) { - pr.removed << entriesmap.value( remid ); - if( is_newest_rev ) + //qDebug() << "Removing from m_entries" << remid; + for( int k = 0 ; k < m_entries.length(); ++k ) { - //qDebug() << "Removing from m_entries" << remid; - for( int k = 0 ; k < m_entries.length(); ++k ) + if( m_entries.at( k )->guid() == remid ) { - if( m_entries.at( k )->guid() == remid ) - { - //qDebug() << "removed at" << k; - m_entries.removeAt( k ); - break; - } + //qDebug() << "removed at" << k; + m_entries.removeAt( k ); + break; } } } } + } - pr.added = addedmap.values(); + pr.added = addedmap.values(); - - pr.newlist = entries; - return pr; + pr.newlist = entries; + return pr; } diff --git a/src/libtomahawk/sip/SipModel.cpp b/src/libtomahawk/sip/SipModel.cpp index 8ac36cbcb..69c3a8972 100644 --- a/src/libtomahawk/sip/SipModel.cpp +++ b/src/libtomahawk/sip/SipModel.cpp @@ -19,7 +19,6 @@ #include "SipModel.h" #include "tomahawksettings.h" -#include "tomahawk/tomahawkapp.h" #include "sip/SipHandler.h" #include "sip/SipPlugin.h" diff --git a/src/main.cpp b/src/main.cpp index 01ebdcc39..ffaf976f6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,7 +16,7 @@ * along with Tomahawk. If not, see . */ -#include "tomahawk/tomahawkapp.h" +#include "tomahawkapp.h" #include "kdsingleapplicationguard/kdsingleapplicationguard.h" diff --git a/src/musicscanner.cpp b/src/musicscanner.cpp index 862e57245..8472dcade 100644 --- a/src/musicscanner.cpp +++ b/src/musicscanner.cpp @@ -18,7 +18,9 @@ #include "musicscanner.h" -#include "tomahawk/tomahawkapp.h" +#include + +#include "utils/tomahawkutils.h" #include "tomahawksettings.h" #include "sourcelist.h" #include "database/database.h" diff --git a/src/resolverconfigdelegate.cpp b/src/resolverconfigdelegate.cpp index 5d4f00e7d..e6657f7a6 100644 --- a/src/resolverconfigdelegate.cpp +++ b/src/resolverconfigdelegate.cpp @@ -20,7 +20,6 @@ #include "resolverconfigdelegate.h" #include "resolversmodel.h" -#include "tomahawk/tomahawkapp.h" #include #include @@ -28,6 +27,7 @@ #define PADDING 4 #define ICONSIZE 24 + ResolverConfigDelegate::ResolverConfigDelegate( QObject* parent ) : ConfigDelegateBase( parent ) { diff --git a/src/resolversmodel.cpp b/src/resolversmodel.cpp index 845185fe9..25ac3a57f 100644 --- a/src/resolversmodel.cpp +++ b/src/resolversmodel.cpp @@ -16,11 +16,12 @@ * along with Tomahawk. If not, see . */ - #include "resolversmodel.h" + #include + #include -#include +#include ResolversModel::ResolversModel( const QStringList& allResolvers, const QStringList& enabledResolvers, QObject* parent ) diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index 1c836280e..eae96e5e7 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -33,12 +33,12 @@ #endif #include "settingsdialog.h" -#include "ui_proxydialog.h" -#include "tomahawk/tomahawkapp.h" + +#include "tomahawkapp.h" #include "musicscanner.h" #include "tomahawksettings.h" #include "sip/SipHandler.h" -#include +#include "database/database.h" #include "scanmanager.h" #include "resolverconfigdelegate.h" #include "resolversmodel.h" @@ -46,6 +46,7 @@ #include "sip/SipModel.h" #include "sipconfigdelegate.h" +#include "ui_proxydialog.h" #include "ui_stackedsettingsdialog.h" static QString diff --git a/src/sourcetree/items/categoryitems.cpp b/src/sourcetree/items/categoryitems.cpp index da1121631..c5cd7bdc4 100644 --- a/src/sourcetree/items/categoryitems.cpp +++ b/src/sourcetree/items/categoryitems.cpp @@ -16,8 +16,8 @@ #include "categoryitems.h" +#include "tomahawkapp.h" #include "utils/tomahawkutils.h" -#include "tomahawk/tomahawkapp.h" #include "widgets/newplaylistwidget.h" #include "viewmanager.h" #include "viewpage.h" diff --git a/src/sourcetree/sourcesmodel.cpp b/src/sourcetree/sourcesmodel.cpp index e152d29b9..e0d666c08 100644 --- a/src/sourcetree/sourcesmodel.cpp +++ b/src/sourcetree/sourcesmodel.cpp @@ -15,7 +15,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #include "sourcetree/sourcesmodel.h" #include "sourcetree/items/sourcetreeitem.h" @@ -25,7 +24,6 @@ #include "playlist.h" #include "collection.h" #include "source.h" -#include "tomahawk/tomahawkapp.h" #include "viewmanager.h" #include diff --git a/src/sourcetree/sourcetreeview.cpp b/src/sourcetree/sourcetreeview.cpp index 5ff59ead9..887a22f4c 100644 --- a/src/sourcetree/sourcetreeview.cpp +++ b/src/sourcetree/sourcetreeview.cpp @@ -24,9 +24,9 @@ #include "sourcelist.h" #include "sourcetree/items/playlistitems.h" #include "sourcetree/items/collectionitem.h" -#include "tomahawk/tomahawkapp.h" #include +#include #include #include #include diff --git a/src/tomahawkapp.cpp b/src/tomahawkapp.cpp index c0ffad1c2..f0b54967c 100644 --- a/src/tomahawkapp.cpp +++ b/src/tomahawkapp.cpp @@ -16,7 +16,7 @@ * along with Tomahawk. If not, see . */ -#include "tomahawk/tomahawkapp.h" +#include "tomahawkapp.h" #include "config.h" diff --git a/include/tomahawk/tomahawkapp.h b/src/tomahawkapp.h similarity index 100% rename from include/tomahawk/tomahawkapp.h rename to src/tomahawkapp.h diff --git a/src/tomahawktrayicon.cpp b/src/tomahawktrayicon.cpp index e49a813ef..88615f6c3 100644 --- a/src/tomahawktrayicon.cpp +++ b/src/tomahawktrayicon.cpp @@ -20,10 +20,10 @@ #include -#include "tomahawk/tomahawkapp.h" #include "artist.h" #include "audio/audioengine.h" +#include "tomahawkapp.h" #include "tomahawkwindow.h" diff --git a/src/tomahawkwindow.cpp b/src/tomahawkwindow.cpp index 7c464c3bc..5aa211178 100644 --- a/src/tomahawkwindow.cpp +++ b/src/tomahawkwindow.cpp @@ -32,7 +32,6 @@ #include #include -#include "tomahawk/tomahawkapp.h" #include "playlist.h" #include "query.h" #include "artist.h" @@ -275,7 +274,7 @@ TomahawkWindow::setupSignals() connect( ui->actionCreateAutomaticPlaylist, SIGNAL( triggered() ), SLOT( createAutomaticPlaylist() )); connect( ui->actionCreate_New_Station, SIGNAL( triggered() ), SLOT( createStation() )); connect( ui->actionAboutTomahawk, SIGNAL( triggered() ), SLOT( showAboutTomahawk() ) ); - connect( ui->actionExit, SIGNAL( triggered() ), APP, SLOT( quit() ) ); + connect( ui->actionExit, SIGNAL( triggered() ), qApp, SLOT( quit() ) ); #if defined( Q_OS_DARWIN ) connect( ui->actionMinimize, SIGNAL( triggered() ), SLOT( minimize() ) ); connect( ui->actionZoom, SIGNAL( triggered() ), SLOT( maximize() ) ); diff --git a/src/transferview.cpp b/src/transferview.cpp index 3d0e771d1..af8ba3ed2 100644 --- a/src/transferview.cpp +++ b/src/transferview.cpp @@ -21,7 +21,6 @@ #include #include -#include "tomahawk/tomahawkapp.h" #include "artist.h" #include "source.h" #include "network/streamconnection.h"