From a6cb6a92e68d72fee4776c0587d3097ecba47489 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Sat, 7 Jul 2018 21:40:23 +0200 Subject: [PATCH] Remove obsolete QT_VERSION_CHECKs --- src/accounts/xmpp/XmppInfoPlugin.cpp | 5 - src/accounts/xmpp/sip/XmppSip.cpp | 26 ----- .../generic/echonest/EchonestPlugin.cpp | 4 - .../generic/echonest/EchonestPlugin.h | 4 - .../linux/fdonotify/FdoNotifyPlugin.cpp | 9 -- src/infoplugins/linux/mpris/MprisPlugin.h | 6 - src/libtomahawk/ActionCollection.cpp | 5 - src/libtomahawk/Album.h | 5 - .../EchonestCatalogSynchronizer.cpp | 5 - src/libtomahawk/EchonestCatalogSynchronizer.h | 4 - src/libtomahawk/LatchManager.cpp | 5 - src/libtomahawk/Playlist.h | 5 - src/libtomahawk/TomahawkPlugin.h | 16 +-- src/libtomahawk/TomahawkSettings.cpp | 18 +-- src/libtomahawk/Track.cpp | 8 -- .../accounts/CredentialsManager.cpp | 6 +- .../accounts/lastfm/LastFmConfig.cpp | 7 -- .../accounts/lastfm/LastFmInfoPlugin.cpp | 5 - .../accounts/lastfm/LastFmInfoPlugin.h | 6 - src/libtomahawk/audio/AudioOutput.cpp | 2 - src/libtomahawk/database/Database.cpp | 5 - .../database/DatabaseCommand_ArtistStats.cpp | 5 - .../DatabaseCommand_DeleteDynamicPlaylist.cpp | 4 - .../DatabaseCommand_DeleteInboxEntry.cpp | 5 - .../database/DatabaseCommand_GenericSelect.h | 5 - .../DatabaseCommand_ModifyInboxEntry.cpp | 5 - .../DatabaseCommand_NetworkCharts.cpp | 5 - .../database/DatabaseCommand_TrackStats.cpp | 4 - src/libtomahawk/jobview/InboxJobItem.cpp | 5 - .../jobview/TransferStatusItem.cpp | 6 - src/libtomahawk/network/QTcpSocketExtra.cpp | 4 - src/libtomahawk/network/Servent.cpp | 4 - src/libtomahawk/network/Servent.h | 4 - .../playlist/TrackItemDelegate.cpp | 5 - src/libtomahawk/playlist/TrackView.cpp | 6 - src/libtomahawk/playlist/ViewHeader.cpp | 5 - .../dynamic/echonest/EchonestControl.h | 4 - .../dynamic/echonest/EchonestGenerator.h | 6 - .../dynamic/echonest/EchonestSteerer.cpp | 4 - .../resolvers/ExternalResolverGui.cpp | 2 - src/libtomahawk/thirdparty/Qocoa/qocoa_mac.h | 6 - .../thirdparty/Qocoa/qsearchfield_mac.mm | 4 - src/libtomahawk/utils/ItunesParser.cpp | 5 - src/libtomahawk/utils/Json.cpp | 31 +---- src/libtomahawk/utils/Logger.cpp | 12 -- src/libtomahawk/utils/NetworkReply.h | 4 - src/libtomahawk/utils/SharedTimeLine.cpp | 10 -- src/libtomahawk/utils/TomahawkUtils.cpp | 108 +++--------------- src/libtomahawk/utils/TomahawkUtilsGui.cpp | 42 +------ src/libtomahawk/widgets/OverlayWidget.cpp | 5 - src/tests/TestServent.h | 4 - src/tomahawk/Scrobbler.h | 5 - src/tomahawk/TomahawkApp.cpp | 4 - src/tomahawk/TomahawkApp.h | 4 - src/tomahawk/TomahawkWindow.cpp | 6 +- src/tomahawk/main.cpp | 8 -- src/tomahawk/sourcetree/SourceTreeView.cpp | 4 - .../sourcetree/items/SourceTreeItem.cpp | 5 - src/tools/database-reader/fuzzysearch.cpp | 5 - src/tools/database-reader/listartists.cpp | 4 - .../qxt/qxtweb-standalone/core/qxtmetatype.h | 4 - .../qxtweb-standalone/web/qxtwebcontent.cpp | 6 - 62 files changed, 34 insertions(+), 496 deletions(-) diff --git a/src/accounts/xmpp/XmppInfoPlugin.cpp b/src/accounts/xmpp/XmppInfoPlugin.cpp index 881a486a9..885091517 100644 --- a/src/accounts/xmpp/XmppInfoPlugin.cpp +++ b/src/accounts/xmpp/XmppInfoPlugin.cpp @@ -25,11 +25,6 @@ #include "utils/Logger.h" #include "TomahawkSettings.h" -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "Source.h" -#endif - // remove now playing status after PAUSE_TIMEOUT seconds static const int PAUSE_TIMEOUT = 10; diff --git a/src/accounts/xmpp/sip/XmppSip.cpp b/src/accounts/xmpp/sip/XmppSip.cpp index 2361dd932..ed704ce7e 100644 --- a/src/accounts/xmpp/sip/XmppSip.cpp +++ b/src/accounts/xmpp/sip/XmppSip.cpp @@ -66,29 +66,6 @@ using namespace Accounts; #define TOMAHAWK_CAP_NODE_NAME QLatin1String( "http://tomahawk-player.org/" ) -#if QT_VERSION <= QT_VERSION_CHECK( 5, 0, 0 ) -void -JreenMessageHandler( QtMsgType type, const char *msg ) -{ - switch ( type ) - { - case QtDebugMsg: - tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ":" << "Debug:" << msg; - break; - case QtWarningMsg: - tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ":" << "Warning:" << msg; - break; - case QtCriticalMsg: - tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ":" << "Critical:" << msg; - break; - case QtFatalMsg: - tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ":" << "Fatal:" << msg; - abort(); - } -} -#endif - - XmppSipPlugin::XmppSipPlugin( Account* account ) : SipPlugin( account ) , m_state( Account::Disconnected ) @@ -96,9 +73,6 @@ XmppSipPlugin::XmppSipPlugin( Account* account ) , m_xmlConsole( nullptr ) , m_pubSubManager( nullptr ) { -#if QT_VERSION <= QT_VERSION_CHECK( 5, 0, 0 ) - Jreen::Logger::addHandler( JreenMessageHandler ); -#endif m_currentUsername = readUsername(); m_currentServer = readServer(); diff --git a/src/infoplugins/generic/echonest/EchonestPlugin.cpp b/src/infoplugins/generic/echonest/EchonestPlugin.cpp index da9a0fca3..e5a5e7cbe 100644 --- a/src/infoplugins/generic/echonest/EchonestPlugin.cpp +++ b/src/infoplugins/generic/echonest/EchonestPlugin.cpp @@ -23,11 +23,7 @@ #include "utils/Logger.h" #include "utils/NetworkAccessManager.h" -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include -#else -#include -#endif #include diff --git a/src/infoplugins/generic/echonest/EchonestPlugin.h b/src/infoplugins/generic/echonest/EchonestPlugin.h index 40edd0c24..7072f9699 100644 --- a/src/infoplugins/generic/echonest/EchonestPlugin.h +++ b/src/infoplugins/generic/echonest/EchonestPlugin.h @@ -25,11 +25,7 @@ #include "infosystem/InfoSystem.h" #include "infosystem/InfoSystemWorker.h" -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include -#else -#include -#endif #include diff --git a/src/infoplugins/linux/fdonotify/FdoNotifyPlugin.cpp b/src/infoplugins/linux/fdonotify/FdoNotifyPlugin.cpp index 0c98fe06a..9e3014991 100644 --- a/src/infoplugins/linux/fdonotify/FdoNotifyPlugin.cpp +++ b/src/infoplugins/linux/fdonotify/FdoNotifyPlugin.cpp @@ -55,11 +55,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - // QTextDocument provides Qt::escape() - #include -#endif - namespace Tomahawk { @@ -67,11 +62,7 @@ namespace InfoSystem { QString escapeHtml( const QString& str ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) return str.toHtmlEscaped(); -#else - return Qt::escape( str ); -#endif } FdoNotifyPlugin::FdoNotifyPlugin() diff --git a/src/infoplugins/linux/mpris/MprisPlugin.h b/src/infoplugins/linux/mpris/MprisPlugin.h index 13cf210b8..29f3155d7 100644 --- a/src/infoplugins/linux/mpris/MprisPlugin.h +++ b/src/infoplugins/linux/mpris/MprisPlugin.h @@ -27,12 +27,6 @@ #include "../../InfoPluginDllMacro.h" -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "PlaylistInterface.h" -#endif - - #include #include #include diff --git a/src/libtomahawk/ActionCollection.cpp b/src/libtomahawk/ActionCollection.cpp index 00747c0cb..820d9c781 100644 --- a/src/libtomahawk/ActionCollection.cpp +++ b/src/libtomahawk/ActionCollection.cpp @@ -30,11 +30,6 @@ #include -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "Query.h" -#endif - ActionCollection* ActionCollection::s_instance = 0; ActionCollection* ActionCollection::instance() diff --git a/src/libtomahawk/Album.h b/src/libtomahawk/Album.h index be09bbb35..fbe5274dd 100644 --- a/src/libtomahawk/Album.h +++ b/src/libtomahawk/Album.h @@ -25,11 +25,6 @@ #include #include -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "collection/Collection.h" -#endif - #include "infosystem/InfoSystem.h" #include "DllMacro.h" #include "Typedefs.h" diff --git a/src/libtomahawk/EchonestCatalogSynchronizer.cpp b/src/libtomahawk/EchonestCatalogSynchronizer.cpp index afd015370..b9c1ac6fe 100644 --- a/src/libtomahawk/EchonestCatalogSynchronizer.cpp +++ b/src/libtomahawk/EchonestCatalogSynchronizer.cpp @@ -34,13 +34,8 @@ #include "TomahawkSettings.h" #include "Track.h" -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include #include -#else -#include -#include -#endif using namespace Tomahawk; diff --git a/src/libtomahawk/EchonestCatalogSynchronizer.h b/src/libtomahawk/EchonestCatalogSynchronizer.h index 0e7a5ac11..0730e2413 100644 --- a/src/libtomahawk/EchonestCatalogSynchronizer.h +++ b/src/libtomahawk/EchonestCatalogSynchronizer.h @@ -22,11 +22,7 @@ #include "DllMacro.h" #include "Query.h" -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include -#else -#include -#endif #include #include diff --git a/src/libtomahawk/LatchManager.cpp b/src/libtomahawk/LatchManager.cpp index 83f5b506d..5275477e3 100644 --- a/src/libtomahawk/LatchManager.cpp +++ b/src/libtomahawk/LatchManager.cpp @@ -29,11 +29,6 @@ #include -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "Result.h" -#endif - using namespace Tomahawk; diff --git a/src/libtomahawk/Playlist.h b/src/libtomahawk/Playlist.h index 9e4d13b7d..4bc2cae4c 100644 --- a/src/libtomahawk/Playlist.h +++ b/src/libtomahawk/Playlist.h @@ -289,9 +289,4 @@ private: Q_DECLARE_METATYPE( QSharedPointer< Tomahawk::Playlist > ) -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - // Qt5 automatically generated this Metatype - Q_DECLARE_METATYPE( QList< QSharedPointer< Tomahawk::Query > > ) -#endif - #endif // PLAYLIST_H diff --git a/src/libtomahawk/TomahawkPlugin.h b/src/libtomahawk/TomahawkPlugin.h index 06c869cff..de018647c 100644 --- a/src/libtomahawk/TomahawkPlugin.h +++ b/src/libtomahawk/TomahawkPlugin.h @@ -1,13 +1,9 @@ #include -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) - #if defined(Q_EXPORT_PLUGIN) - #undef Q_EXPORT_PLUGIN - #undef Q_EXPORT_PLUGIN2 - #endif +#if defined(Q_EXPORT_PLUGIN) + #undef Q_EXPORT_PLUGIN + #undef Q_EXPORT_PLUGIN2 +#endif - #define Q_EXPORT_PLUGIN(a) - #define Q_EXPORT_PLUGIN2(a, b) -#else - # define Q_PLUGIN_METADATA(a) -#endif \ No newline at end of file +#define Q_EXPORT_PLUGIN(a) +#define Q_EXPORT_PLUGIN2(a, b) diff --git a/src/libtomahawk/TomahawkSettings.cpp b/src/libtomahawk/TomahawkSettings.cpp index 43db6bf69..f1d47f619 100644 --- a/src/libtomahawk/TomahawkSettings.cpp +++ b/src/libtomahawk/TomahawkSettings.cpp @@ -34,14 +34,8 @@ #include "PlaylistInterface.h" #include "Source.h" -#if QT_VERSION < QT_VERSION_CHECK(5,0,0) - #include - #include -#else - #include - #include -#endif - +#include +#include #include using namespace Tomahawk; @@ -733,11 +727,7 @@ TomahawkSettings::genericCacheVersion() const QString TomahawkSettings::storageCacheLocation() const { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) return QStandardPaths::writableLocation( QStandardPaths::CacheLocation ); -#else - return QDesktopServices::storageLocation( QDesktopServices::CacheLocation ); -#endif } @@ -746,11 +736,7 @@ TomahawkSettings::scannerPaths() const { QString musicLocation; -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) musicLocation = QStandardPaths::writableLocation( QStandardPaths::MusicLocation ); -#else - musicLocation = QDesktopServices::storageLocation( QDesktopServices::MusicLocation ); -#endif return value( "scanner/paths", musicLocation ).toStringList(); } diff --git a/src/libtomahawk/Track.cpp b/src/libtomahawk/Track.cpp index 51a7596da..2d10e6e9d 100644 --- a/src/libtomahawk/Track.cpp +++ b/src/libtomahawk/Track.cpp @@ -213,19 +213,11 @@ Track::init() Q_D( Track ); updateSortNames(); -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) QObject::connect( d->trackData.data(), &TrackData::attributesLoaded, this, &Track::attributesLoaded ); QObject::connect( d->trackData.data(), &TrackData::socialActionsLoaded, this, &Track::socialActionsLoaded ); QObject::connect( d->trackData.data(), &TrackData::statsLoaded, this, &Track::statsLoaded ); QObject::connect( d->trackData.data(), &TrackData::similarTracksLoaded, this, &Track::similarTracksLoaded ); QObject::connect( d->trackData.data(), &TrackData::lyricsLoaded, this, &Track::lyricsLoaded ); -#else - connect( d->trackData.data(), SIGNAL( attributesLoaded() ), SIGNAL( attributesLoaded() ) ); - connect( d->trackData.data(), SIGNAL( socialActionsLoaded() ), SIGNAL( socialActionsLoaded() ) ); - connect( d->trackData.data(), SIGNAL( statsLoaded() ), SIGNAL( statsLoaded() ) ); - connect( d->trackData.data(), SIGNAL( similarTracksLoaded() ), SIGNAL( similarTracksLoaded() ) ); - connect( d->trackData.data(), SIGNAL( lyricsLoaded() ), SIGNAL( lyricsLoaded() ) ); -#endif } diff --git a/src/libtomahawk/accounts/CredentialsManager.cpp b/src/libtomahawk/accounts/CredentialsManager.cpp index 578bbc8ec..606bb254b 100644 --- a/src/libtomahawk/accounts/CredentialsManager.cpp +++ b/src/libtomahawk/accounts/CredentialsManager.cpp @@ -23,11 +23,7 @@ #ifdef Q_OS_MAC #include "TomahawkSettings.h" #else - #if QT_VERSION < QT_VERSION_CHECK(5,0,0) - #include - #else - #include - #endif + #include #include "utils/Json.h" #endif diff --git a/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp b/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp index 85b747be8..fc8d57d40 100644 --- a/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp +++ b/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp @@ -29,17 +29,10 @@ #include "utils/Closure.h" #include "utils/NetworkAccessManager.h" -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include #include #include #include -#else -#include -#include -#include -#include -#endif using namespace Tomahawk::Accounts; diff --git a/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp b/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp index 277a62e17..ea7443bcf 100644 --- a/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp +++ b/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp @@ -34,13 +34,8 @@ #include "TomahawkSettings.h" #include "utils/NetworkAccessManager.h" -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include #include -#else -#include -#include -#endif using namespace Tomahawk::Accounts; using namespace Tomahawk::InfoSystem; diff --git a/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h b/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h index 0eb3b0749..90d9ed5da 100644 --- a/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h +++ b/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h @@ -24,15 +24,9 @@ #include "infosystem/InfoSystemWorker.h" #include "DllMacro.h" -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include #include #include -#else -#include -#include -#include -#endif #include diff --git a/src/libtomahawk/audio/AudioOutput.cpp b/src/libtomahawk/audio/AudioOutput.cpp index 6d93fd9ac..141560339 100644 --- a/src/libtomahawk/audio/AudioOutput.cpp +++ b/src/libtomahawk/audio/AudioOutput.cpp @@ -164,7 +164,6 @@ AudioOutput::AudioOutput( QObject* parent ) setCurrentSource( new MediaStream( &m_silenceFile, true ) ); libvlc_media_player_play( m_vlcPlayer ); - #if QT_VERSION >= QT_VERSION_CHECK(5,4,0) // if the silence file did not play for 15 secs, we pretend the AudioOutput is initialized, to allow proper error reporting QTimer::singleShot( 15000, [&]() { @@ -173,7 +172,6 @@ AudioOutput::AudioOutput( QObject* parent ) emit initialized(); } } ); - #endif } diff --git a/src/libtomahawk/database/Database.cpp b/src/libtomahawk/database/Database.cpp index e005a3895..628f44841 100644 --- a/src/libtomahawk/database/Database.cpp +++ b/src/libtomahawk/database/Database.cpp @@ -43,11 +43,6 @@ #include "DatabaseCommand_SetCollectionAttributes.h" #include "DatabaseCommand_SetTrackAttributes.h" -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "collection/Collection.h" -#endif - #define DEFAULT_WORKER_THREADS 4 #define MAX_WORKER_THREADS 16 diff --git a/src/libtomahawk/database/DatabaseCommand_ArtistStats.cpp b/src/libtomahawk/database/DatabaseCommand_ArtistStats.cpp index 31a3c56f6..fac5508b6 100644 --- a/src/libtomahawk/database/DatabaseCommand_ArtistStats.cpp +++ b/src/libtomahawk/database/DatabaseCommand_ArtistStats.cpp @@ -25,11 +25,6 @@ #include "PlaylistEntry.h" #include "SourceList.h" -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "collection/Collection.h" -#endif - using namespace Tomahawk; diff --git a/src/libtomahawk/database/DatabaseCommand_DeleteDynamicPlaylist.cpp b/src/libtomahawk/database/DatabaseCommand_DeleteDynamicPlaylist.cpp index 5dfb17440..fa0db5fae 100644 --- a/src/libtomahawk/database/DatabaseCommand_DeleteDynamicPlaylist.cpp +++ b/src/libtomahawk/database/DatabaseCommand_DeleteDynamicPlaylist.cpp @@ -24,10 +24,6 @@ #include -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "collection/Collection.h" -#endif using namespace Tomahawk; diff --git a/src/libtomahawk/database/DatabaseCommand_DeleteInboxEntry.cpp b/src/libtomahawk/database/DatabaseCommand_DeleteInboxEntry.cpp index 3bf57c83a..8ba735fff 100644 --- a/src/libtomahawk/database/DatabaseCommand_DeleteInboxEntry.cpp +++ b/src/libtomahawk/database/DatabaseCommand_DeleteInboxEntry.cpp @@ -21,11 +21,6 @@ #include "Query.h" #include "Track.h" -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "Source.h" -#endif - namespace Tomahawk { diff --git a/src/libtomahawk/database/DatabaseCommand_GenericSelect.h b/src/libtomahawk/database/DatabaseCommand_GenericSelect.h index d3a15af0d..4bd7e5f62 100644 --- a/src/libtomahawk/database/DatabaseCommand_GenericSelect.h +++ b/src/libtomahawk/database/DatabaseCommand_GenericSelect.h @@ -87,9 +87,4 @@ private: } -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - // Qt5 automatically generated this Metatype - Q_DECLARE_METATYPE(QList) -#endif - #endif // DATABASECOMMAND_GENERICSELECT_H diff --git a/src/libtomahawk/database/DatabaseCommand_ModifyInboxEntry.cpp b/src/libtomahawk/database/DatabaseCommand_ModifyInboxEntry.cpp index bb07d0127..ed33ec303 100644 --- a/src/libtomahawk/database/DatabaseCommand_ModifyInboxEntry.cpp +++ b/src/libtomahawk/database/DatabaseCommand_ModifyInboxEntry.cpp @@ -21,11 +21,6 @@ #include "Query.h" #include "Track.h" -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "Source.h" -#endif - namespace Tomahawk { diff --git a/src/libtomahawk/database/DatabaseCommand_NetworkCharts.cpp b/src/libtomahawk/database/DatabaseCommand_NetworkCharts.cpp index b59ecb883..ee6c43741 100644 --- a/src/libtomahawk/database/DatabaseCommand_NetworkCharts.cpp +++ b/src/libtomahawk/database/DatabaseCommand_NetworkCharts.cpp @@ -22,11 +22,6 @@ #include "DatabaseImpl.h" #include "TomahawkSqlQuery.h" -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "Source.h" -#endif - namespace Tomahawk { diff --git a/src/libtomahawk/database/DatabaseCommand_TrackStats.cpp b/src/libtomahawk/database/DatabaseCommand_TrackStats.cpp index d5dccde30..603207c40 100644 --- a/src/libtomahawk/database/DatabaseCommand_TrackStats.cpp +++ b/src/libtomahawk/database/DatabaseCommand_TrackStats.cpp @@ -25,10 +25,6 @@ #include "PlaylistEntry.h" #include "SourceList.h" -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "collection/Collection.h" -#endif using namespace Tomahawk; diff --git a/src/libtomahawk/jobview/InboxJobItem.cpp b/src/libtomahawk/jobview/InboxJobItem.cpp index b6f5b5a18..ed6231492 100644 --- a/src/libtomahawk/jobview/InboxJobItem.cpp +++ b/src/libtomahawk/jobview/InboxJobItem.cpp @@ -29,11 +29,6 @@ #include -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "Source.h" -#endif - InboxJobItem::InboxJobItem( Side side, diff --git a/src/libtomahawk/jobview/TransferStatusItem.cpp b/src/libtomahawk/jobview/TransferStatusItem.cpp index 8ffc20dac..8ab409e76 100644 --- a/src/libtomahawk/jobview/TransferStatusItem.cpp +++ b/src/libtomahawk/jobview/TransferStatusItem.cpp @@ -31,12 +31,6 @@ #include "Track.h" -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "collection/Collection.h" -#endif - - TransferStatusItem::TransferStatusItem( TransferStatusManager* p, StreamConnection* sc ) : m_parent( p ) , m_stream( QPointer< StreamConnection >( sc ) ) diff --git a/src/libtomahawk/network/QTcpSocketExtra.cpp b/src/libtomahawk/network/QTcpSocketExtra.cpp index 6b8906db0..4c1a51e5f 100644 --- a/src/libtomahawk/network/QTcpSocketExtra.cpp +++ b/src/libtomahawk/network/QTcpSocketExtra.cpp @@ -23,10 +23,6 @@ #include "utils/Logger.h" -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "Msg.h" -#endif - void QTcpSocketExtra::connectToHost( const QHostAddress& host, quint16 port, OpenMode openMode ) { diff --git a/src/libtomahawk/network/Servent.cpp b/src/libtomahawk/network/Servent.cpp index f0591862e..aebdb8dbc 100644 --- a/src/libtomahawk/network/Servent.cpp +++ b/src/libtomahawk/network/Servent.cpp @@ -576,11 +576,7 @@ Servent::handleSipInfo( const Tomahawk::peerinfo_ptr& peerInfo ) void -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) Servent::incomingConnection( qintptr sd ) -#else -Servent::incomingConnection( int sd ) -#endif { Q_ASSERT( this->thread() == QThread::currentThread() ); diff --git a/src/libtomahawk/network/Servent.h b/src/libtomahawk/network/Servent.h index 299cba390..97c44bc6f 100644 --- a/src/libtomahawk/network/Servent.h +++ b/src/libtomahawk/network/Servent.h @@ -157,11 +157,7 @@ signals: void ready(); protected: -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) void incomingConnection( qintptr sd ) Q_DECL_OVERRIDE; -#else - void incomingConnection( int sd ) Q_DECL_OVERRIDE; -#endif public slots: void setExternalAddress( QHostAddress ha, unsigned int port ); diff --git a/src/libtomahawk/playlist/TrackItemDelegate.cpp b/src/libtomahawk/playlist/TrackItemDelegate.cpp index ad9b03182..0d0db3686 100644 --- a/src/libtomahawk/playlist/TrackItemDelegate.cpp +++ b/src/libtomahawk/playlist/TrackItemDelegate.cpp @@ -40,11 +40,6 @@ #include "utils/TomahawkUtilsGui.h" #include "utils/Logger.h" -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "utils/PixmapDelegateFader.h" -#endif - using namespace Tomahawk; diff --git a/src/libtomahawk/playlist/TrackView.cpp b/src/libtomahawk/playlist/TrackView.cpp index 73c8132ba..4d0b26e2e 100644 --- a/src/libtomahawk/playlist/TrackView.cpp +++ b/src/libtomahawk/playlist/TrackView.cpp @@ -36,12 +36,6 @@ #include "utils/Logger.h" #include "InboxModel.h" -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "collection/Collection.h" - #include "utils/PixmapDelegateFader.h" -#endif - #include #include #include diff --git a/src/libtomahawk/playlist/ViewHeader.cpp b/src/libtomahawk/playlist/ViewHeader.cpp index 59b93cfef..a3be36099 100644 --- a/src/libtomahawk/playlist/ViewHeader.cpp +++ b/src/libtomahawk/playlist/ViewHeader.cpp @@ -35,13 +35,8 @@ ViewHeader::ViewHeader( QAbstractItemView* parent ) { m_menu->setFont( TomahawkUtils::systemFont() ); -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) setSectionResizeMode( QHeaderView::Interactive ); setSectionsMovable( true ); -#else - setResizeMode( QHeaderView::Interactive ); - setMovable( true ); -#endif setMinimumSectionSize( 60 ); setDefaultAlignment( Qt::AlignLeft ); setStretchLastSection( true ); diff --git a/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.h b/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.h index 5704f35f6..0446a8e0f 100644 --- a/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.h +++ b/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.h @@ -24,11 +24,7 @@ #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include -#else -#include -#endif namespace Tomahawk { diff --git a/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.h b/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.h index 9bc71bb93..b434e27f8 100644 --- a/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.h +++ b/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.h @@ -28,14 +28,8 @@ #include "DllMacro.h" - -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include #include -#else -#include -#include -#endif namespace Tomahawk { diff --git a/src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.cpp b/src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.cpp index 960aadb36..5baaaea5b 100644 --- a/src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.cpp +++ b/src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.cpp @@ -24,11 +24,7 @@ #include "utils/TomahawkUtils.h" #include "utils/Logger.h" -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include -#else -#include -#endif #include #include diff --git a/src/libtomahawk/resolvers/ExternalResolverGui.cpp b/src/libtomahawk/resolvers/ExternalResolverGui.cpp index c8821a1d4..da8d41783 100644 --- a/src/libtomahawk/resolvers/ExternalResolverGui.cpp +++ b/src/libtomahawk/resolvers/ExternalResolverGui.cpp @@ -95,11 +95,9 @@ Tomahawk::ExternalResolverGui::setupClickHandlerOnUrlButtons( QObject* widget ) QPushButton* button = qobject_cast< QPushButton* >( widget ); Q_ASSERT( button ); - #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) connect( button, &QPushButton::clicked, [=]() { QDesktopServices::openUrl( widget->property( "url" ).toUrl() ); }); - #endif } // and recurse diff --git a/src/libtomahawk/thirdparty/Qocoa/qocoa_mac.h b/src/libtomahawk/thirdparty/Qocoa/qocoa_mac.h index 7d3e0d7af..3ec9ccf41 100644 --- a/src/libtomahawk/thirdparty/Qocoa/qocoa_mac.h +++ b/src/libtomahawk/thirdparty/Qocoa/qocoa_mac.h @@ -29,9 +29,7 @@ THE SOFTWARE. #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include -#endif static inline NSString* fromQString(const QString &string) { @@ -49,11 +47,7 @@ static inline QString toQString(NSString *string) static inline NSImage* fromQPixmap(const QPixmap &pixmap) { -#if QT_VERSION < QT_VERSION_CHECK(5,0,0) - CGImageRef cgImage = pixmap.toMacCGImageRef(); -#else CGImageRef cgImage = QtMac::toCGImageRef(pixmap); -#endif return [[[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize] autorelease]; } diff --git a/src/libtomahawk/thirdparty/Qocoa/qsearchfield_mac.mm b/src/libtomahawk/thirdparty/Qocoa/qsearchfield_mac.mm index 563961cec..c5cb0f6fa 100644 --- a/src/libtomahawk/thirdparty/Qocoa/qsearchfield_mac.mm +++ b/src/libtomahawk/thirdparty/Qocoa/qsearchfield_mac.mm @@ -192,11 +192,7 @@ void QSearchField::setMenu(QMenu *menu) if (!pimpl) return; -#if QT_VERSION < QT_VERSION_CHECK(5,0,0) - NSMenu *nsMenu = menu->macMenu(); -#else NSMenu *nsMenu = menu->toNSMenu(); -#endif [[pimpl->nsSearchField cell] setSearchMenuTemplate:nsMenu]; } diff --git a/src/libtomahawk/utils/ItunesParser.cpp b/src/libtomahawk/utils/ItunesParser.cpp index 1c09d530b..53e9059a3 100644 --- a/src/libtomahawk/utils/ItunesParser.cpp +++ b/src/libtomahawk/utils/ItunesParser.cpp @@ -36,11 +36,6 @@ #include #include -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "Playlist.h" -#endif - using namespace Tomahawk; diff --git a/src/libtomahawk/utils/Json.cpp b/src/libtomahawk/utils/Json.cpp index ba92fed3f..5b6f113b1 100644 --- a/src/libtomahawk/utils/Json.cpp +++ b/src/libtomahawk/utils/Json.cpp @@ -18,16 +18,9 @@ #include "Json.h" -// Qt version specific includes -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) - #include - #include - #include -#else - #include - #include - #include -#endif +#include +#include +#include namespace TomahawkUtils { @@ -35,7 +28,6 @@ namespace TomahawkUtils QVariantMap qobject2qvariant( const QObject* object ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) QVariantMap map; if ( object == NULL ) { @@ -52,16 +44,12 @@ qobject2qvariant( const QObject* object ) } } return map; -#else - return QJson::QObjectHelper::qobject2qvariant( object ); -#endif } void qvariant2qobject( const QVariantMap& variant, QObject* object ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) for ( QVariantMap::const_iterator iter = variant.begin(); iter != variant.end(); ++iter ) { QVariant property = object->property( iter.key().toLatin1() ); @@ -78,16 +66,12 @@ qvariant2qobject( const QVariantMap& variant, QObject* object ) } } } -#else - QJson::QObjectHelper::qvariant2qobject( variant, object ); -#endif } QVariant parseJson( const QByteArray& jsonData, bool* ok ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) QJsonParseError error; QJsonDocument doc = QJsonDocument::fromJson( jsonData, &error ); if ( ok != NULL ) @@ -95,17 +79,12 @@ parseJson( const QByteArray& jsonData, bool* ok ) *ok = ( error.error == QJsonParseError::NoError ); } return doc.toVariant(); -#else - QJson::Parser p; - return p.parse( jsonData, ok ); -#endif } QByteArray toJson( const QVariant &variant, bool* ok ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) QVariant _variant = variant; if ( variant.type() == QVariant::Hash ) { @@ -127,10 +106,6 @@ toJson( const QVariant &variant, bool* ok ) *ok = !doc.isNull(); } return doc.toJson( QJsonDocument::Compact ); -#else - QJson::Serializer serializer; - return serializer.serialize( variant, ok ); -#endif } } diff --git a/src/libtomahawk/utils/Logger.cpp b/src/libtomahawk/utils/Logger.cpp index d57646127..7e6904ee3 100644 --- a/src/libtomahawk/utils/Logger.cpp +++ b/src/libtomahawk/utils/Logger.cpp @@ -128,20 +128,12 @@ log( const char *msg, unsigned int debugLevel, bool toDisk = true ) void -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) TomahawkLogHandler( QtMsgType type, const QMessageLogContext& context, const QString& msg ) -#else -TomahawkLogHandler( QtMsgType type, const char* msg ) -#endif { static QMutex s_mutex; -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) QByteArray ba = msg.toUtf8(); const char* message = ba.constData(); -#else - const char* message = msg; -#endif QMutexLocker locker( &s_mutex ); switch( type ) @@ -196,11 +188,7 @@ setupLogfile( QFile& f ) logStream.open( f.fileName().toStdString().c_str() ); #endif -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) qInstallMessageHandler( TomahawkLogHandler ); -#else - qInstallMsgHandler( TomahawkLogHandler ); -#endif } } diff --git a/src/libtomahawk/utils/NetworkReply.h b/src/libtomahawk/utils/NetworkReply.h index 083556aa8..8fc8c811d 100644 --- a/src/libtomahawk/utils/NetworkReply.h +++ b/src/libtomahawk/utils/NetworkReply.h @@ -69,8 +69,4 @@ private: QUrl m_url; }; -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - Q_DECLARE_METATYPE( NetworkReply* ) -#endif - #endif // NETWORKREPLY_H diff --git a/src/libtomahawk/utils/SharedTimeLine.cpp b/src/libtomahawk/utils/SharedTimeLine.cpp index ab370b616..f1467acc9 100644 --- a/src/libtomahawk/utils/SharedTimeLine.cpp +++ b/src/libtomahawk/utils/SharedTimeLine.cpp @@ -40,7 +40,6 @@ SharedTimeLine::SharedTimeLine() void SharedTimeLine::connectNotify( const QMetaMethod& signal ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) if ( signal == QMetaMethod::fromSignal( &SharedTimeLine::frameChanged ) ) { m_refcount++; @@ -49,10 +48,6 @@ SharedTimeLine::connectNotify( const QMetaMethod& signal ) m_timeline.start(); } } -#else - Q_UNUSED( signal ); - Q_ASSERT( false ); -#endif } void @@ -72,7 +67,6 @@ SharedTimeLine::connectNotify( const char* signal ) void SharedTimeLine::disconnectNotify( const QMetaMethod& signal ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) if ( signal == QMetaMethod::fromSignal( &SharedTimeLine::frameChanged ) ) { m_refcount--; @@ -82,10 +76,6 @@ SharedTimeLine::disconnectNotify( const QMetaMethod& signal ) deleteLater(); } } -#else - Q_UNUSED( signal ); - Q_ASSERT( false ); -#endif } diff --git a/src/libtomahawk/utils/TomahawkUtils.cpp b/src/libtomahawk/utils/TomahawkUtils.cpp index 0baa27c37..77526cd9b 100644 --- a/src/libtomahawk/utils/TomahawkUtils.cpp +++ b/src/libtomahawk/utils/TomahawkUtils.cpp @@ -32,20 +32,11 @@ #include "Track.h" #ifdef LIBLASTFM_FOUND - #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) - #include - #else - #include - #endif +#include #endif -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include #include -#else -#include -#include -#endif // We need this for the version info (if available) #include @@ -62,10 +53,7 @@ #include #include -// Qt version specific includes -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) - #include -#endif +#include #ifdef Q_OS_WIN #include @@ -545,35 +533,7 @@ mergePlaylistChanges( const QList< Tomahawk::query_ptr >& orig, const QList< Tom bool removeDirectory( const QString& dir ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) return QDir( dir ).removeRecursively(); -#else - const QDir aDir( dir ); - - tLog() << "Deleting DIR:" << dir; - bool has_err = false; - if ( aDir.exists() ) - { - foreach ( const QFileInfo& entry, aDir.entryInfoList( QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files | QDir::NoSymLinks ) ) - { - QString path = entry.absoluteFilePath(); - if ( entry.isDir() ) - { - has_err = !removeDirectory( path ) || has_err; - } - else if ( !QFile::remove( path ) ) - { - has_err = true; - } - } - if ( !aDir.rmdir( aDir.absolutePath() ) ) - { - has_err = true; - } - } - - return !has_err; -#endif } @@ -676,40 +636,32 @@ public: { }; - #if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - QString translate( const char * context, const char * sourceText, const char * disambiguation = 0 ) const Q_DECL_OVERRIDE + QString translate( const char * context, const char * sourceText, const char * disambiguation = 0, int n = -1) const Q_DECL_OVERRIDE { - QString translation = QTranslator::translate( context, sourceText, disambiguation ); - #else - QString translate( const char * context, const char * sourceText, const char * disambiguation = 0, int n = -1) const Q_DECL_OVERRIDE + QString translation = QTranslator::translate( context, sourceText, disambiguation, n ); + + if( translation.isEmpty() ) { - QString translation = QTranslator::translate( context, sourceText, disambiguation, n ); - #endif - if( translation.isEmpty() ) - { - translation = QString::fromUtf8( sourceText ); - } - - // // lowercase all strings not on whats new page ... - // // TODO: rather scan disambiguation for nolowercase, but too lazy for that right now - // if( strcmp( context, "WhatsNewWidget_0_8" ) ) - // { - // translation = translation.toLower(); - // } - - return translation.replace( "%applicationName", TOMAHAWK_APPLICATION_NAME, Qt::CaseInsensitive ); + translation = QString::fromUtf8( sourceText ); } + + // // lowercase all strings not on whats new page ... + // // TODO: rather scan disambiguation for nolowercase, but too lazy for that right now + // if( strcmp( context, "WhatsNewWidget_0_8" ) ) + // { + // translation = translation.toLower(); + // } + + return translation.replace( "%applicationName", TOMAHAWK_APPLICATION_NAME, Qt::CaseInsensitive ); + } }; void installTranslator( QObject* parent ) { -#if QT_VERSION >= 0x040800 QString locale = QLocale::system().uiLanguages().first().replace( "-", "_" ); -#else - QString locale = QLocale::system().name(); -#endif + if ( locale == "C" ) locale = "en"; @@ -970,57 +922,37 @@ compareVersionStrings( const QString& first, const QString& second ) void urlAddQueryItem( QUrl& url, const QString& key, const QString& value ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) QUrlQuery urlQuery( url ); urlQuery.addQueryItem( key, value ); url.setQuery( urlQuery ); -#else - url.addQueryItem( key, value ); -#endif } QString urlQueryItemValue( const QUrl& url, const QString& key ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) return QUrlQuery( url ).queryItemValue( key ).replace( "+", " " ); -#else - return url.queryItemValue( key ).replace( "+", " " ); -#endif } bool urlHasQueryItem( const QUrl& url, const QString& key ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) return QUrlQuery( url ).hasQueryItem( key ); -#else - return url.hasQueryItem( key ); -#endif } QList > urlQueryItems( const QUrl& url ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) return QUrlQuery( url ).queryItems(); -#else - return url.queryItems(); -#endif } void urlSetQuery( QUrl& url, const QString& query ) { -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) url.setQuery( query ); -#else - url.setEncodedQuery( query.toLocal8Bit() ); -#endif } @@ -1046,11 +978,7 @@ QByteArray encodedQuery( const QUrl& url ) { QByteArray data; -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) data = url.query(QUrl::FullyEncoded).toUtf8(); -#else - data = url.encodedQuery(); -#endif // QUrl doesn't encode : or ; which it should, as well as some other things, so be safer here in general. data.replace( "'", "%27" ); data.replace( ".", "%2E" ); diff --git a/src/libtomahawk/utils/TomahawkUtilsGui.cpp b/src/libtomahawk/utils/TomahawkUtilsGui.cpp index f4b5231b1..4a0fa03b9 100644 --- a/src/libtomahawk/utils/TomahawkUtilsGui.cpp +++ b/src/libtomahawk/utils/TomahawkUtilsGui.cpp @@ -40,16 +40,9 @@ #include #include -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) - #include - #ifdef HAVE_X11 - #include - #endif -#else - #ifdef Q_WS_X11 - #include - #include - #endif +#include +#ifdef HAVE_X11 + #include #endif #ifdef Q_OS_WIN @@ -324,34 +317,6 @@ bringToFront() } } #else -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - { - QWidget* widget = tomahawkWindow(); - if ( !widget ) - return; - - widget->show(); - widget->activateWindow(); - widget->raise(); - - WId wid = widget->winId(); - NETWM::init(); - - XEvent e; - e.xclient.type = ClientMessage; - e.xclient.message_type = NETWM::NET_ACTIVE_WINDOW; - e.xclient.display = QX11Info::display(); - e.xclient.window = wid; - e.xclient.format = 32; - e.xclient.data.l[0] = 2; - e.xclient.data.l[1] = QX11Info::appTime(); - e.xclient.data.l[2] = 0; - e.xclient.data.l[3] = 0l; - e.xclient.data.l[4] = 0l; - - XSendEvent( QX11Info::display(), RootWindow( QX11Info::display(), DefaultScreen( QX11Info::display() ) ), False, SubstructureRedirectMask | SubstructureNotifyMask, &e ); - } -#else // Qt5 { QWidget* widget = tomahawkWindow(); if ( !widget ) @@ -371,7 +336,6 @@ bringToFront() #endif } #endif -#endif } #endif diff --git a/src/libtomahawk/widgets/OverlayWidget.cpp b/src/libtomahawk/widgets/OverlayWidget.cpp index fe55b98fe..9da73adc6 100644 --- a/src/libtomahawk/widgets/OverlayWidget.cpp +++ b/src/libtomahawk/widgets/OverlayWidget.cpp @@ -26,11 +26,6 @@ #include #include -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "Source.h" -#endif - #define CORNER_ROUNDNESS 8.0 #define FADING_DURATION 500 diff --git a/src/tests/TestServent.h b/src/tests/TestServent.h index d72838d5f..0207af279 100644 --- a/src/tests/TestServent.h +++ b/src/tests/TestServent.h @@ -54,11 +54,7 @@ private: *servent = new Servent(); QVERIFY( *servent != NULL ); -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) QHostAddress anyAddress = QHostAddress::Any; -#else - QHostAddress anyAddress = QHostAddress::AnyIPv6; -#endif // TODO: Use a random free port for tests // With (upnp == false) and (mode == diff --git a/src/tomahawk/Scrobbler.h b/src/tomahawk/Scrobbler.h index 01c26959c..2bc6e5ddb 100644 --- a/src/tomahawk/Scrobbler.h +++ b/src/tomahawk/Scrobbler.h @@ -23,12 +23,7 @@ #include "Result.h" #include "infosystem/InfoSystem.h" - -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include -#else -#include -#endif #include /** diff --git a/src/tomahawk/TomahawkApp.cpp b/src/tomahawk/TomahawkApp.cpp index 367e722e8..03f7b3ec1 100644 --- a/src/tomahawk/TomahawkApp.cpp +++ b/src/tomahawk/TomahawkApp.cpp @@ -551,11 +551,7 @@ TomahawkApp::initServent() const QString externalHostname = TomahawkSettings::instance()->externalHostname(); int externalPort = TomahawkSettings::instance()->externalPort(); bool autodetectIp = TomahawkSettings::instance()->autoDetectExternalIp(); -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) if ( !Servent::instance()->startListening( QHostAddress::Any, upnp, port, mode, defaultPort, autodetectIp, externalHostname, externalPort ) ) -#else - if ( !Servent::instance()->startListening( QHostAddress::AnyIPv6, upnp, port, mode, defaultPort, autodetectIp, externalHostname, externalPort ) ) -#endif { tLog() << "Failed to start listening with servent"; exit( 1 ); diff --git a/src/tomahawk/TomahawkApp.h b/src/tomahawk/TomahawkApp.h index 953140bd4..4f445286e 100644 --- a/src/tomahawk/TomahawkApp.h +++ b/src/tomahawk/TomahawkApp.h @@ -64,11 +64,7 @@ namespace Tomahawk } #ifdef LIBLASTFM_FOUND - #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include - #else - #include - #endif #include "Scrobbler.h" #endif diff --git a/src/tomahawk/TomahawkWindow.cpp b/src/tomahawk/TomahawkWindow.cpp index a3936f221..feeb16f18 100644 --- a/src/tomahawk/TomahawkWindow.cpp +++ b/src/tomahawk/TomahawkWindow.cpp @@ -91,11 +91,7 @@ #if defined( Q_OS_WIN ) #if defined ( QTSPARKLE_FOUND ) - #if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include - #else - #include - #endif + #include #endif #include #endif diff --git a/src/tomahawk/main.cpp b/src/tomahawk/main.cpp index c7d05d434..67d7d9df7 100644 --- a/src/tomahawk/main.cpp +++ b/src/tomahawk/main.cpp @@ -45,10 +45,6 @@ #include "libcrashreporter-handler/Handler.h" #endif -#if QT_VERSION < QT_VERSION_CHECK( 4, 8, 0 ) - #include -#endif - #include #include @@ -178,11 +174,7 @@ main( int argc, char *argv[] ) #endif // Q_OS_MAC #endif //Q_OS_WIN - #if QT_VERSION < QT_VERSION_CHECK( 4, 8, 0 ) - XInitThreads(); - #else QCoreApplication::setAttribute( Qt::AA_X11InitThreads ); - #endif TomahawkApp a( argc, argv ); diff --git a/src/tomahawk/sourcetree/SourceTreeView.cpp b/src/tomahawk/sourcetree/SourceTreeView.cpp index 905405825..cc7c693e2 100644 --- a/src/tomahawk/sourcetree/SourceTreeView.cpp +++ b/src/tomahawk/sourcetree/SourceTreeView.cpp @@ -138,11 +138,7 @@ SourceTreeView::SourceTreeView( QWidget* parent ) setModel( m_proxyModel ); header()->setStretchLastSection( false ); -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) header()->setSectionResizeMode( 0, QHeaderView::Stretch ); -#else - header()->setResizeMode( 0, QHeaderView::Stretch ); -#endif connect( this, SIGNAL( expanded( QModelIndex ) ), SLOT( onItemExpanded( QModelIndex ) ) ); connect( selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), SLOT( onSelectionChanged() ) ); diff --git a/src/tomahawk/sourcetree/items/SourceTreeItem.cpp b/src/tomahawk/sourcetree/items/SourceTreeItem.cpp index b97a13f5e..1857d22b4 100644 --- a/src/tomahawk/sourcetree/items/SourceTreeItem.cpp +++ b/src/tomahawk/sourcetree/items/SourceTreeItem.cpp @@ -21,11 +21,6 @@ #include "audio/AudioEngine.h" #include "utils/Logger.h" -// Forward Declarations breaking QSharedPointer -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - #include "Query.h" -#endif - using namespace Tomahawk; diff --git a/src/tools/database-reader/fuzzysearch.cpp b/src/tools/database-reader/fuzzysearch.cpp index 12672ebea..9c9dd9d44 100644 --- a/src/tools/database-reader/fuzzysearch.cpp +++ b/src/tools/database-reader/fuzzysearch.cpp @@ -97,8 +97,3 @@ int main( int argc, char* argv[] ) thread.wait(); } -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - Q_DECLARE_METATYPE( QList< Tomahawk::result_ptr > ) - Q_DECLARE_METATYPE( Tomahawk::QID ) -#endif - diff --git a/src/tools/database-reader/listartists.cpp b/src/tools/database-reader/listartists.cpp index 6a2f8013b..72f6934d3 100644 --- a/src/tools/database-reader/listartists.cpp +++ b/src/tools/database-reader/listartists.cpp @@ -76,7 +76,3 @@ int main( int argc, char* argv[] ) // Wait until the dbcmd was executed. thread.wait(); } - -#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) - Q_DECLARE_METATYPE( QList< Tomahawk::artist_ptr > ) -#endif diff --git a/thirdparty/qxt/qxtweb-standalone/core/qxtmetatype.h b/thirdparty/qxt/qxtweb-standalone/core/qxtmetatype.h index cd30fa048..2d1439411 100644 --- a/thirdparty/qxt/qxtweb-standalone/core/qxtmetatype.h +++ b/thirdparty/qxt/qxtweb-standalone/core/qxtmetatype.h @@ -38,11 +38,7 @@ #include #include -#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) #define qxtcreate create -#else -#define qxtcreate construct -#endif template class /*QXT_CORE_EXPORT*/ QxtMetaType diff --git a/thirdparty/qxt/qxtweb-standalone/web/qxtwebcontent.cpp b/thirdparty/qxt/qxtweb-standalone/web/qxtwebcontent.cpp index 8e9abed49..c94366647 100644 --- a/thirdparty/qxt/qxtweb-standalone/web/qxtwebcontent.cpp +++ b/thirdparty/qxt/qxtweb-standalone/web/qxtwebcontent.cpp @@ -52,9 +52,7 @@ QxtWeb uses QxtWebContent as an abstraction for streaming data. #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include -#endif #ifndef QXT_DOXYGEN_RUN class QxtWebContentPrivate : public QxtPrivate @@ -273,11 +271,7 @@ typedef QPair QxtQueryItem; QHash QxtWebContent::parseUrlEncodedQuery(const QString& data) { QHash rv; -#if QT_VERSION < QT_VERSION_CHECK(5,0,0) - QUrl post("/?" + data); -#else QUrlQuery post("/?" + data); -#endif foreach(const QxtQueryItem& item, post.queryItems()) { rv.insertMulti(item.first, item.second);