From 67507362d5fecb9ea901a64a4667907a949cd1dd Mon Sep 17 00:00:00 2001 From: Craig Drummond Date: Fri, 26 Jun 2015 21:18:25 +0100 Subject: [PATCH] Always build support for Dynamic, Online, and Streams --- CMakeLists.txt | 76 +++++++++++++-------------------- ChangeLog | 1 + INSTALL | 14 ------ config.h.cmake | 3 -- context/contextwidget.cpp | 6 --- context/contextwidget.h | 4 -- gui/cachesettings.cpp | 8 ---- gui/covers.cpp | 33 +------------- gui/currentcover.cpp | 8 +--- gui/interfacesettings.cpp | 20 --------- gui/main.cpp | 4 -- gui/mainwindow.cpp | 45 ------------------- gui/mainwindow.h | 12 +----- gui/preferencesdialog.cpp | 6 --- gui/preferencesdialog.h | 4 -- http/httpserver.cpp | 4 -- models/streamsmodel.cpp | 4 +- models/streamsmodel.h | 5 ++- mpd-interface/mpdconnection.cpp | 10 ++--- mpd-interface/mpdconnection.h | 4 +- mpd-interface/mpdparseutils.cpp | 11 ++--- mpd-interface/mpdparseutils.h | 2 +- mpd-interface/song.cpp | 6 +-- widgets/coverwidget.cpp | 8 +--- widgets/icons.cpp | 9 ---- widgets/icons.h | 4 -- 26 files changed, 55 insertions(+), 256 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7320b398..c7248510f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,9 +55,6 @@ option(ENABLE_MPG123 "Enable mpg123 libraries (required for replaygain calculati option(ENABLE_PROXY_CONFIG "Enable proxy config in settings dialog" OFF) option(ENABLE_EXTERNAL_TAGS "Enable usage of external app for reading/writing tags" ON) option(ENABLE_HTTP_SERVER "Enable internal HTTP server to play non-MPD files" ON) -option(ENABLE_DYNAMIC "Enable support for dynamic playlists" ON) -option(ENABLE_STREAMS "Enable support for streams tab (to save favourite streams, and search for others)" ON) -option(ENABLE_ONLINE_SERVICES "Enable support for online services (Jamendo, Magnatune, SoundCloud, and Podcasts)" ON) if (NOT WIN32 AND NOT APPLE AND NOT ENABLE_UBUNTU) option(ENABLE_SIMPLE_MPD_SUPPORT "Enable support for simple (Cantata controlled) MPD" ON) endif (NOT WIN32 AND NOT APPLE AND NOT ENABLE_UBUNTU) @@ -110,9 +107,6 @@ endif (NOT APPLE AND NOT WIN32 AND NOT ENABLE_UBUNTU AND NOT ENABLE_KDE_SUPPORT) if (ENABLE_UBUNTU) set(ENABLE_QT5 ON) - set(ENABLE_DYNAMIC OFF) - set(ENABLE_STREAMS OFF) - set(ENABLE_ONLINE_SERVICES OFF) set(ENABLE_TAGLIB OFF) set(ENABLE_TAGLIB_EXTRAS OFF) set(ENABLE_FFMPEG OFF) @@ -444,7 +438,16 @@ set(CANTATA_SRCS ${CANTATA_CORE_SRCS} ${CANTATA_SRCS} context/lyricsettings.cpp context/ultimatelyricsprovider.cpp context/ultimatelyrics.cpp context/lyricsdialog.cpp context/contextwidget.cpp context/view.cpp context/artistview.cpp context/albumview.cpp context/songview.cpp context/contextengine.cpp context/wikipediaengine.cpp context/wikipediasettings.cpp context/othersettings.cpp context/contextsettings.cpp context/togglelist.cpp - context/lastfmengine.cpp context/metaengine.cpp + context/lastfmengine.cpp context/metaengine.cpp context/onlineview.cpp + streams/streamspage.cpp streams/digitallyimportedsettings.cpp streams/streamssettings.cpp streams/streamdialog.cpp streams/tar.cpp + streams/streamproviderlistdialog.cpp + models/streamsproxymodel.cpp models/streamsearchmodel.cpp models/digitallyimported.cpp + dynamic/dynamic.cpp dynamic/dynamicproxymodel.cpp dynamic/dynamicpage.cpp dynamic/dynamicruledialog.cpp dynamic/dynamicrulesdialog.cpp + online/onlineservicespage.cpp online/onlinedbservice.cpp online/jamendoservice.cpp online/onlinedbwidget.cpp online/onlineservice.cpp + online/jamendosettingsdialog.cpp online/magnatuneservice.cpp online/magnatunesettingsdialog.cpp online/soundcloudservice.cpp + online/soundcloudwidget.cpp online/podcastservice.cpp online/rssparser.cpp online/opmlparser.cpp online/podcastsearchdialog.cpp + online/podcastsettingsdialog.cpp online/podcastwidget.cpp + db/onlinedb.cpp scrobbling/scrobbler.cpp scrobbling/pausabletimer.cpp scrobbling/scrobblingsettings.cpp scrobbling/scrobblingstatus.cpp scrobbling/scrobblinglove.cpp) set(CANTATA_MOC_HDRS ${CANTATA_CORE_MOC_HDRS} ${CANTATA_MOC_HDRS} @@ -459,11 +462,21 @@ set(CANTATA_MOC_HDRS ${CANTATA_CORE_MOC_HDRS} ${CANTATA_MOC_HDRS} context/togglelist.h context/ultimatelyrics.h context/ultimatelyricsprovider.h context/lyricsdialog.h context/contextwidget.h context/artistview.h context/albumview.h context/songview.h context/view.h context/contextengine.h context/wikipediaengine.h context/wikipediasettings.h context/othersettings.h context/lastfmengine.h context/metaengine.h + streams/streamspage.h streams/digitallyimportedsettings.h streams/streamssettings.h + streams/streamdialog.h models/streamsmodel.h streams/streamproviderlistdialog.h + models/digitallyimported.h models/streamsearchmodel.h + online/onlineservicespage.h online/onlinedbservice.h online/onlinedbwidget.h online/magnatunesettingsdialog.h + online/soundcloudservice.h online/soundcloudwidget.h online/podcastservice.h online/podcastsearchdialog.h + online/podcastsettingsdialog.h online/podcastwidget.h + db/onlinedb.h + dynamic/dynamic.h dynamic/dynamicruledialog.h dynamic/dynamicpage.h dynamic/dynamicrulesdialog.h scrobbling/scrobbler.h scrobbling/scrobblingsettings.h scrobbling/scrobblingstatus.h scrobbling/scrobblinglove.h) set(CANTATA_UIS ${CANTATA_UIS} gui/initialsettingswizard.ui gui/mainwindow.ui gui/filesettings.ui gui/interfacesettings.ui gui/playbacksettings.ui gui/serversettings.ui gui/coverdialog.ui context/togglelist.ui context/othersettings.ui + streams/digitallyimportedsettings.ui streams/streamssettings.ui + dynamic/dynamicrule.ui dynamic/dynamicrules.ui widgets/itemview.ui scrobbling/scrobblingsettings.ui) if (ENABLE_SIMPLE_MPD_SUPPORT) @@ -479,47 +492,14 @@ else (ENABLE_UBUNTU) add_subdirectory(icons) endif (ENABLE_UBUNTU) -if (ENABLE_DYNAMIC) - set(CANTATA_SRCS ${CANTATA_SRCS} dynamic/dynamic.cpp dynamic/dynamicproxymodel.cpp dynamic/dynamicpage.cpp - dynamic/dynamicruledialog.cpp dynamic/dynamicrulesdialog.cpp) - set(CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} dynamic/dynamic.h dynamic/dynamicruledialog.h dynamic/dynamicpage.h - dynamic/dynamicrulesdialog.h) - set(CANTATA_UIS ${CANTATA_UIS} dynamic/dynamicrule.ui dynamic/dynamicrules.ui) - if (WIN32) - # Not installed for windows - script uses sym-links... - elseif (APPLE) - install(PROGRAMS dynamic/cantata-dynamic DESTINATION ${MACOSX_BUNDLE_RESOURCES}/scripts/) - elseif (NOT ENABLE_UBUNTU) - install(PROGRAMS dynamic/cantata-dynamic DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/scripts) - endif (WIN32) -endif (ENABLE_DYNAMIC) - -if (ENABLE_STREAMS) - set(CANTATA_SRCS ${CANTATA_SRCS} streams/streamspage.cpp streams/digitallyimportedsettings.cpp streams/streamssettings.cpp - streams/streamdialog.cpp streams/tar.cpp models/streamsproxymodel.cpp models/streamsearchmodel.cpp models/digitallyimported.cpp - streams/streamproviderlistdialog.cpp) - set(CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} streams/streamspage.h streams/digitallyimportedsettings.h streams/streamssettings.h - streams/streamdialog.h models/streamsmodel.h models/digitallyimported.h models/streamsearchmodel.h - streams/streamproviderlistdialog.h) - set(CANTATA_UIS ${CANTATA_UIS} streams/digitallyimportedsettings.ui streams/streamssettings.ui) - add_subdirectory(streams/icons) -endif (ENABLE_STREAMS) - -if (ENABLE_ONLINE_SERVICES) - set(CANTATA_SRCS ${CANTATA_SRCS} online/onlineservicespage.cpp online/onlinedbservice.cpp online/jamendoservice.cpp - online/onlinedbwidget.cpp online/onlineservice.cpp online/jamendosettingsdialog.cpp online/magnatuneservice.cpp - online/magnatunesettingsdialog.cpp online/soundcloudservice.cpp online/soundcloudwidget.cpp - online/podcastservice.cpp online/rssparser.cpp online/opmlparser.cpp online/podcastsearchdialog.cpp - online/podcastsettingsdialog.cpp online/podcastwidget.cpp - db/onlinedb.cpp - context/onlineview.cpp) - set(CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} online/onlineservicespage.h online/onlinedbservice.h online/onlinedbwidget.h - db/onlinedb.h online/magnatunesettingsdialog.h online/soundcloudservice.h online/soundcloudwidget.h - online/podcastservice.h online/podcastsearchdialog.h online/podcastsettingsdialog.h online/podcastwidget.h - ) - add_subdirectory(online/icons) -endif (ENABLE_ONLINE_SERVICES) +if (WIN32) + # Not installed for windows - script uses sym-links... +elseif (APPLE) + install(PROGRAMS dynamic/cantata-dynamic DESTINATION ${MACOSX_BUNDLE_RESOURCES}/scripts/) +elseif (NOT ENABLE_UBUNTU) + install(PROGRAMS dynamic/cantata-dynamic DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/scripts) +endif (WIN32) if (ENABLE_HTTP_SERVER) set(CANTATA_SRCS ${CANTATA_SRCS} http/httpserversettings.cpp http/httpsocket.cpp) @@ -824,6 +804,8 @@ endif (NOT ENABLE_UBUNTU) add_subdirectory(support) add_subdirectory(3rdparty/qtiocompressor) +add_subdirectory(streams/icons) +add_subdirectory(online/icons) target_link_libraries(cantata support-core qtiocompressor ${CANTATA_LIBS} ${QTLIBS} ${ZLIB_LIBRARIES}) # enable warnings diff --git a/ChangeLog b/ChangeLog index 959374def..b0e1baf7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ 6. Place Streams view within Internet. 7. Place stored playlists and dynamic playlists within Playlists. 8. Remove option for non-mono sidebar icons. + 9. Always build with Dynamic, Online, and Streams support. ..... 1. If connected to MPD>=0.19 using address 127.0.0.1 or localhost, then pass diff --git a/INSTALL b/INSTALL index 94b5ba39b..e149096ee 100644 --- a/INSTALL +++ b/INSTALL @@ -80,20 +80,6 @@ The following options may be passed to CMake: Enable usage of internal HTTP server for non-MPD file playback. Default: ON - -DENABLE_DYNAMIC=ON - Enable support for dynamic playlists. - Default: ON - - -DENABLE_STREAMS=ON - Enable support for streams tab (saving favourite streams, listing - streams from providers, etc) - Default: ON - - -DENABLE_ONLINE_SERVICES=ON - Enable support for online services (Jamendo, Magnatune, SoundCloud, and - Podcasts) - Default: ON - -DENABLE_TOUCH_SUPPORT=ON Enable support for making Cantata more touch-friendly. Currently only really works under Windows. diff --git a/config.h.cmake b/config.h.cmake index 3e08a4217..6323da807 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -15,9 +15,6 @@ #cmakedefine ENABLE_DEVICES_SUPPORT 1 #cmakedefine ENABLE_REMOTE_DEVICES 1 -#cmakedefine ENABLE_ONLINE_SERVICES 1 -#cmakedefine ENABLE_STREAMS 1 -#cmakedefine ENABLE_DYNAMIC 1 #cmakedefine COMPLEX_TAGLIB_FILENAME 1 #cmakedefine TAGLIB_FOUND 1 #cmakedefine TAGLIB_EXTRAS_FOUND 1 diff --git a/context/contextwidget.cpp b/context/contextwidget.cpp index 1e99555da..fb519f200 100644 --- a/context/contextwidget.cpp +++ b/context/contextwidget.cpp @@ -25,9 +25,7 @@ #include "artistview.h" #include "albumview.h" #include "songview.h" -#ifdef ENABLE_ONLINE_SERVICES #include "onlineview.h" -#endif #include "mpd-interface/song.h" #include "support/utils.h" #include "gui/covers.h" @@ -248,9 +246,7 @@ ContextWidget::ContextWidget(QWidget *parent) , fadeValue(1.0) , isWide(false) , stack(0) - #ifdef ENABLE_ONLINE_SERVICES , onlineContext(0) - #endif , splitter(0) , viewSelector(0) { @@ -623,7 +619,6 @@ void ContextWidget::update(const Song &s) cancel(); } - #ifdef ENABLE_ONLINE_SERVICES if (Song::OnlineSvrTrack==sng.type) { if (!onlineContext) { QWidget *onlinePage=new QWidget(mainStack); @@ -644,7 +639,6 @@ void ContextWidget::update(const Song &s) return; } mainStack->setCurrentIndex(0); - #endif artist->update(sng); album->update(sng); song->update(sng); diff --git a/context/contextwidget.h b/context/contextwidget.h index ac99b4806..c825c4893 100644 --- a/context/contextwidget.h +++ b/context/contextwidget.h @@ -45,9 +45,7 @@ class QImage; class QToolButton; class QButtonGroup; class QWheelEvent; -#ifdef ENABLE_ONLINE_SERVICES class OnlineView; -#endif class ViewSelector : public QWidget { @@ -171,9 +169,7 @@ private: QStackedWidget *mainStack; QStackedWidget *stack; QWidget *standardContext; - #ifdef ENABLE_ONLINE_SERVICES OnlineView *onlineContext; - #endif ThinSplitter *splitter; ViewSelector *viewSelector; #ifndef SCALE_CONTEXT_BGND diff --git a/gui/cachesettings.cpp b/gui/cachesettings.cpp index e75f455b0..63a5873e6 100644 --- a/gui/cachesettings.cpp +++ b/gui/cachesettings.cpp @@ -35,12 +35,8 @@ #include "support/thread.h" #include "settings.h" #include "widgets/basicitemdelegate.h" -#ifdef ENABLE_STREAMS #include "models/streamsmodel.h" -#endif -#ifdef ENABLE_ONLINE_SERVICES____TODO #include "online/podcastsearchdialog.h" -#endif #include "support/squeezedtextlabel.h" #include "scrobbling/scrobbler.h" #include @@ -272,12 +268,8 @@ CacheSettings::CacheSettings(QWidget *parent) << "*"+ArtistView::constSimilarInfoExt << "*.json.gz" << "*.jpg" << "*.png", tree); new CacheItem(i18n("Album Information"), Utils::cacheDir(AlbumView::constCacheDir, false), QStringList() << "*"+AlbumView::constInfoExt << "*.jpg" << "*.png", tree); new CacheItem(i18n("Track Information"), Utils::cacheDir(SongView::constCacheDir, false), QStringList() << "*"+AlbumView::constInfoExt, tree); - #ifdef ENABLE_STREAMS new CacheItem(i18n("Stream Listings"), Utils::cacheDir(StreamsModel::constSubDir, false), QStringList() << "*"+StreamsModel::constCacheExt, tree); - #endif - #ifdef ENABLE_ONLINE_SERVICES____TODO new CacheItem(i18n("Podcast Directories"), Utils::cacheDir(PodcastSearchDialog::constCacheDir, false), QStringList() << "*"+PodcastSearchDialog::constExt, tree); - #endif new CacheItem(i18n("Wikipedia Languages"), Utils::cacheDir(WikipediaSettings::constSubDir, false), QStringList() << "*.xml.gz", tree); new CacheItem(i18n("Scrobble Tracks"), Utils::cacheDir(Scrobbler::constCacheDir, false), QStringList() << "*.xml.gz", tree); diff --git a/gui/covers.cpp b/gui/covers.cpp index 741e1aebf..9bcabf468 100644 --- a/gui/covers.cpp +++ b/gui/covers.cpp @@ -30,9 +30,7 @@ #include "config.h" #include "devices/deviceoptions.h" #include "support/thread.h" -#ifdef ENABLE_ONLINE_SERVICES #include "online/onlineservice.h" -#endif #ifdef ENABLE_DEVICES_SUPPORT #include "devices/device.h" #include "models/devicesmodel.h" @@ -181,15 +179,9 @@ static QImage loadImage(const QString &fileName) static inline bool isOnlineServiceImage(const Song &s) { - #ifdef ENABLE_ONLINE_SERVICES return OnlineService::showLogoAsCover(s); - #else - Q_UNUSED(s) - return false; - #endif } -#ifdef ENABLE_ONLINE_SERVICES static Covers::Image serviceImage(const Song &s) { Covers::Image img; @@ -202,7 +194,6 @@ static Covers::Image serviceImage(const Song &s) } return img; } -#endif static inline QString albumKey(const Song &s) { @@ -212,11 +203,9 @@ static inline QString albumKey(const Song &s) if (s.isStandardStream()) { return QLatin1String("-stream-"); } - #ifdef ENABLE_ONLINE_SERVICES if (isOnlineServiceImage(s)) { return s.onlineService(); } - #endif return "{"+s.albumArtist()+"}{"+s.albumId()+"}"; } @@ -243,12 +232,9 @@ static inline QString cacheKey(const Song &song, int size) return QLatin1String("single")+QString::number(size); } else if (song.isStandardStream()) { return QLatin1String("str")+QString::number(size); - } - #ifdef ENABLE_ONLINE_SERVICES - else if (isOnlineServiceImage(song)) { + } else if (isOnlineServiceImage(song)) { return song.onlineService()+QString::number(size); } - #endif return songKey(song)+QString::number(size); } @@ -580,7 +566,6 @@ void CoverDownloader::stop() void CoverDownloader::download(const Song &song) { DBUG << song.file << song.artist << song.albumartist << song.album; - #ifdef ENABLE_ONLINE_SERVICES if (song.isFromOnlineService()) { QString serviceName=song.onlineService(); QString imageUrl=song.extraField(Song::OnlineImageUrl); @@ -597,7 +582,6 @@ void CoverDownloader::download(const Song &song) } return; } - #endif if (jobs.end()!=findJob(Job(song, QString()))) { return; @@ -818,7 +802,6 @@ void CoverDownloader::jobFinished() void CoverDownloader::onlineJobFinished() { - #ifdef ENABLE_ONLINE_SERVICES NetworkJob *reply=qobject_cast(sender()); if (!reply) { @@ -862,7 +845,6 @@ void CoverDownloader::onlineJobFinished() } emit cover(job.song, img, fileName); } - #endif } void CoverDownloader::failed(const Job &job) @@ -1215,11 +1197,7 @@ QPixmap * Covers::defaultPix(const Song &song, int size, int origSize) #if QT_VERSION < 0x050100 Q_UNUSED(origSize) #endif - #ifdef ENABLE_ONLINE_SERVICES bool podcast=!song.isArtistImageRequest() && !song.isComposerImageRequest() && song.isFromOnlineService() && OnlineService::isPodcasts(song.onlineService()); - #else - bool podcast=false; - #endif QString key=song.isArtistImageRequest() ? QLatin1String("artist-") : song.isComposerImageRequest() @@ -1279,15 +1257,12 @@ QPixmap * Covers::get(const Song &song, int size, bool urgent) pix=new QPixmap(Icons::self()->albumIcon.pixmap(size, size).scaled(QSize(size, size), Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); } else if (song.isStandardStream()) { pix=new QPixmap(Icons::self()->streamIcon.pixmap(size, size).scaled(QSize(size, size), Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - } - #ifdef ENABLE_ONLINE_SERVICES - else if (isOnlineServiceImage(song)) { + } else if (isOnlineServiceImage(song)) { Covers::Image img=serviceImage(song); if (!img.img.isNull()) { pix=new QPixmap(QPixmap::fromImage(img.img.scaled(QSize(size, size), Qt::IgnoreAspectRatio, Qt::SmoothTransformation))); } } - #endif if (pix) { #if QT_VERSION >= 0x050100 if (size!=origSize) { @@ -1477,7 +1452,6 @@ Covers::Image Covers::findImage(const Song &song, bool emitResult) Covers::Image Covers::locateImage(const Song &song) { DBUG_CLASS("Covers") << song.file << song.artist << song.albumartist << song.album << song.type; - #ifdef ENABLE_ONLINE_SERVICES if (song.isFromOnlineService()) { QString id=song.onlineService(); Covers::Image img; @@ -1507,7 +1481,6 @@ Covers::Image Covers::locateImage(const Song &song) DBUG_CLASS("Covers") << "Failed to locate online image for" << id; return Image(); } - #endif #ifdef ENABLE_DEVICES_SUPPORT if (song.isFromDevice()) { Device *dev=DevicesModel::self()->device(song.deviceId()); @@ -1755,14 +1728,12 @@ Covers::Image Covers::requestImage(const Song &song, bool urgent) { DBUG << song.file << song.artist << song.albumartist << song.album << song.composer() << song.isArtistImageRequest() << song.isComposerImageRequest(); - #ifdef ENABLE_ONLINE_SERVICES if (urgent && song.isFromOnlineService()) { Covers::Image img=serviceImage(song); if (!img.img.isNull()) { return img; } } - #endif #ifdef ENABLE_DEVICES_SUPPORT if (song.isFromDevice()) { Device *dev=DevicesModel::self()->device(song.deviceId()); diff --git a/gui/currentcover.cpp b/gui/currentcover.cpp index 838cc8992..6a80447ae 100644 --- a/gui/currentcover.cpp +++ b/gui/currentcover.cpp @@ -27,9 +27,7 @@ #include "widgets/icons.h" #include "support/utils.h" #include "support/globalstatic.h" -#ifdef ENABLE_ONLINE_SERVICES #include "online/onlineservice.h" -#endif #include #if !defined Q_OS_WIN && !defined Q_OS_MAC @@ -181,11 +179,7 @@ void CurrentCover::update(const Song &s) if (s.albumArtist()!=current.albumArtist() || s.album!=current.album || s.isStream()!=current.isStream() || s.onlineService()!=current.onlineService()) { current=s; - if ((!s.albumArtist().isEmpty() && !s.album.isEmpty() && !current.isStandardStream()) - #ifdef ENABLE_ONLINE_SERVICES - || OnlineService::showLogoAsCover(s) - #endif - ) { + if ((!s.albumArtist().isEmpty() && !s.album.isEmpty() && !current.isStandardStream()) || OnlineService::showLogoAsCover(s)) { Covers::Image cImg=Covers::self()->requestImage(s, true); valid=!cImg.img.isNull(); if (valid) { diff --git a/gui/interfacesettings.cpp b/gui/interfacesettings.cpp index 59936b644..8a0614deb 100644 --- a/gui/interfacesettings.cpp +++ b/gui/interfacesettings.cpp @@ -172,22 +172,10 @@ InterfaceSettings::InterfaceSettings(QWidget *p) addView(i18n("Library"), QLatin1String("LibraryPage")); addView(i18n("Folders"), QLatin1String("FolderPage")); addView(i18n("Playlists"), QLatin1String("PlaylistsPage")); - #ifdef ENABLE_DYNAMIC addView(i18n("Dynamic Playlists"), QLatin1String("DynamicPage")); - #endif - #ifdef ENABLE_STREAMS addViewTypes(streamsView, standardViews); - #else - REMOVE(streamsView) - REMOVE(streamsViewLabel) - #endif - #ifdef ENABLE_ONLINE_SERVICES addViewTypes(onlineView, standardViews); addView(i18n("Internet - Streams, Jamendo, Maganatune, SoundCloud, and Podcasts"), QLatin1String("OnlineServicesPage")); - #else - REMOVE(onlineView) - REMOVE(onlineViewLabel) - #endif #ifdef ENABLE_DEVICES_SUPPORT addViewTypes(devicesView, standardViews); addView(i18n("Devices - UMS, MTP (e.g. Android), and AudioCDs"), QLatin1String("DevicesPage")); @@ -303,12 +291,8 @@ void InterfaceSettings::load() selectEntry(folderView, Settings::self()->folderView()); selectEntry(playlistsView, Settings::self()->playlistsView()); playListsStartClosed->setChecked(Settings::self()->playListsStartClosed()); - #ifdef ENABLE_STREAMS selectEntry(streamsView, Settings::self()->streamsView()); - #endif - #ifdef ENABLE_ONLINE_SERVICES selectEntry(onlineView, Settings::self()->onlineView()); - #endif composerGenres->setText(QStringList(Settings::self()->composerGenres().toList()).join(QString(Song::constGenreSep))); singleTracksFolder->setText(Settings::self()->singleTracksFolder()); #ifdef ENABLE_DEVICES_SUPPORT @@ -397,12 +381,8 @@ void InterfaceSettings::save() Settings::self()->saveFolderView(getValue(folderView)); Settings::self()->savePlaylistsView(getValue(playlistsView)); Settings::self()->savePlayListsStartClosed(playListsStartClosed->isChecked()); - #ifdef ENABLE_STREAMS Settings::self()->saveStreamsView(getValue(streamsView)); - #endif - #ifdef ENABLE_ONLINE_SERVICES Settings::self()->saveOnlineView(getValue(onlineView)); - #endif Settings::self()->saveComposerGenres(composerGenres->text().trimmed().split(Song::constGenreSep).toSet()); Settings::self()->saveSingleTracksFolder(singleTracksFolder->text().trimmed()); #ifdef ENABLE_DEVICES_SUPPORT diff --git a/gui/main.cpp b/gui/main.cpp index 7c1e4782c..9bac6f3d3 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -50,9 +50,7 @@ #include "context/wikipediaengine.h" #include "context/lastfmengine.h" #include "context/metaengine.h" -#ifdef ENABLE_DYNAMIC #include "dynamic/dynamic.h" -#endif #ifdef ENABLE_DEVICES_SUPPORT #include "models/devicesmodel.h" #endif @@ -232,11 +230,9 @@ static void installDebugMessageHandler() if (dbg&Dbg_Context_Widget) { ContextWidget::enableDebug(); } - #ifdef ENABLE_DYNAMIC if (dbg&Dbg_Dynamic) { Dynamic::enableDebug(); } - #endif if (dbg&Dbg_StreamFetching) { StreamFetcher::enableDebug(); } diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index b7bc2fd13..e3c429e0e 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -48,9 +48,7 @@ #include "models/mpdlibrarymodel.h" #include "librarypage.h" #include "folderpage.h" -#ifdef ENABLE_STREAMS #include "streams/streamdialog.h" -#endif #include "searchpage.h" #include "support/gtkstyle.h" #ifdef ENABLE_DEVICES_SUPPORT @@ -62,9 +60,7 @@ #include "devices/audiocddevice.h" #endif #endif -#ifdef ENABLE_ONLINE_SERVICES #include "online/onlineservicespage.h" -#endif #include "http/httpserver.h" #ifdef TAGLIB_FOUND #include "tags/trackorganiser.h" @@ -95,9 +91,7 @@ #include "mac/powermanagement.h" #endif #endif -#ifdef ENABLE_DYNAMIC #include "dynamic/dynamic.h" -#endif #include "support/messagewidget.h" #include "widgets/groupedview.h" #include "widgets/actionitemdelegate.h" @@ -392,13 +386,10 @@ MainWindow::MainWindow(QWidget *parent) tabWidget->addTab(playlistsPage, TAB_ACTION(playlistsTabAction), !hiddenPages.contains(playlistsPage->metaObject()->className())); connect(playlistsTabAction, SIGNAL(triggered()), this, SLOT(showPlaylistsTab())); setPlaylistsEnabled(!hiddenPages.contains(playlistsPage->metaObject()->className())); - #ifdef ENABLE_DYNAMIC connect(Dynamic::self(), SIGNAL(error(const QString &)), SLOT(showError(const QString &))); connect(Dynamic::self(), SIGNAL(running(bool)), dynamicLabel, SLOT(setVisible(bool))); connect(Dynamic::self(), SIGNAL(running(bool)), this, SLOT(controlDynamicButton())); stopDynamicButton->setDefaultAction(Dynamic::self()->stopAct()); - #endif - #ifdef ENABLE_ONLINE_SERVICES onlinePage = new OnlineServicesPage(this); addAction(onlineTabAction = ActionCollection::get()->createAction("showonlinetab", i18n("Internet"), Icons::self()->onlineIcon)); onlineTabAction->setShortcut(Qt::ControlModifier+Qt::ShiftModifier+nextKey(sidebarPageShortcutKey)); @@ -407,7 +398,6 @@ MainWindow::MainWindow(QWidget *parent) connect(onlineTabAction, SIGNAL(triggered()), this, SLOT(showOnlineTab())); connect(onlinePage, SIGNAL(addToDevice(const QString &, const QString &, const QList &)), SLOT(copyToDevice(const QString &, const QString &, const QList &))); connect(onlinePage, SIGNAL(error(const QString &)), this, SLOT(showError(const QString &))); - #endif #ifdef ENABLE_DEVICES_SUPPORT devicesPage = new DevicesPage(this); addAction(devicesTabAction = ActionCollection::get()->createAction("showdevicestab", i18n("Devices"), Icons::self()->devicesIcon)); @@ -945,9 +935,7 @@ MainWindow::~MainWindow() playQueue->saveConfig(); // playlistsPage->saveConfig(); context->saveConfig(); - #ifdef ENABLE_STREAMS StreamsModel::self()->save(); - #endif searchPage->saveConfig(); nowPlaying->saveConfig(); Settings::self()->saveForceSingleClick(TreeView::getForceSingleClick()); @@ -956,11 +944,9 @@ MainWindow::~MainWindow() ((isHidden() && Settings::SS_ShowMainWindow!=startupState) || (Settings::SS_HideMainWindow==startupState))); Settings::self()->save(); disconnect(MPDConnection::self(), 0, 0, 0); - #ifdef ENABLE_DYNAMIC if (Settings::self()->stopOnExit()) { Dynamic::self()->stop(); } - #endif if (Settings::self()->stopOnExit()) { emit stop(); Utils::sleep(); // Allow time for stop to be sent... @@ -1111,11 +1097,9 @@ void MainWindow::connectToMpd(const MPDConnectionDetails &details) PlaylistsModel::self()->clear(); playQueueModel.clear(); searchPage->clear(); - #ifdef ENABLE_DYNAMIC if (!MPDConnection::self()->getDetails().isEmpty() && details!=MPDConnection::self()->getDetails()) { Dynamic::self()->stop(); } - #endif showInformation(i18n("Connecting to %1", details.description())); outputsAction->setVisible(false); if (CS_Init!=connectedState) { @@ -1188,14 +1172,12 @@ void MainWindow::showAboutDialog() bool MainWindow::canClose() { - #ifdef ENABLE_ONLINE_SERVICES if (onlinePage->isDownloading() && MessageBox::No==MessageBox::warningYesNo(this, i18n("A Podcast is currently being downloaded\n\nQuiting now will abort the download."), QString(), GuiItem(i18n("Abort download and quit")), GuiItem("Do not quit just yet"))) { return false; } onlinePage->cancelAll(); - #endif return true; } @@ -1414,10 +1396,8 @@ void MainWindow::controlConnectionsMenu(bool enable) void MainWindow::controlDynamicButton() { - #ifdef ENABLE_DYNAMIC stopDynamicButton->setVisible(Dynamic::self()->isRunning()); playQueueModel.enableUndo(!Dynamic::self()->isRunning()); - #endif } void MainWindow::setRating() @@ -1443,9 +1423,7 @@ void MainWindow::readSettings() Song::setComposerGenres(Settings::self()->composerGenres()); libraryPage->setView(Settings::self()->libraryView()); playlistsPage->setView(Settings::self()->playlistsView()); - #ifdef ENABLE_ONLINE_SERVICES onlinePage->setView(Settings::self()->onlineView()); - #endif folderPage->setView(Settings::self()->folderView()); #ifdef ENABLE_DEVICES_SUPPORT devicesPage->setView(Settings::self()->devicesView()); @@ -1894,9 +1872,7 @@ void MainWindow::promptClearPlayQueue() void MainWindow::clearPlayQueue() { if (dynamicLabel->isVisible()) { - #ifdef ENABLE_DYNAMIC Dynamic::self()->stop(true); - #endif } else { playQueueModel.removeAll(); } @@ -2015,7 +1991,6 @@ void MainWindow::addToExistingStoredPlaylist(const QString &name, bool pq) void MainWindow::addStreamToPlayQueue() { - #ifdef ENABLE_STREAMS StreamDialog dlg(this, true); if (QDialog::Accepted==dlg.exec()) { @@ -2026,16 +2001,6 @@ void MainWindow::addStreamToPlayQueue() } playQueueModel.addItems(QStringList() << StreamsModel::modifyUrl(url), false, 0); } - #else - QString url = InputDialog::getText(i18n("Stream URL"), i18n("Enter URL of stream:"), QString(), 0, this).trimmed(); - if (!url.isEmpty()) { - if (!MPDConnection::self()->urlHandlers().contains(QUrl(url).scheme())) { - MessageBox::error(this, i18n("Invalid, or unsupported, URL!")); - } else { - playQueueModel.addItems(QStringList() << StreamsModel::modifyUrl(url), false, 0); - } - } - #endif } void MainWindow::removeItems() @@ -2108,9 +2073,7 @@ void MainWindow::currentTabChanged(int index) case PAGE_LIBRARY: currentPage=libraryPage; break; case PAGE_FOLDERS: folderPage->load(); currentPage=folderPage; break; case PAGE_PLAYLISTS: currentPage=playlistsPage; break; - #ifdef ENABLE_ONLINE_SERVICES case PAGE_ONLINE: currentPage=onlinePage; break; - #endif #ifdef ENABLE_DEVICES_SUPPORT case PAGE_DEVICES: currentPage=devicesPage; break; #endif @@ -2162,11 +2125,9 @@ void MainWindow::tabToggled(int index) case PAGE_PLAYLISTS: setPlaylistsEnabled(tabWidget->isEnabled(index)); break; - #ifdef ENABLE_ONLINE_SERVICES case PAGE_ONLINE: onlinePage->setEnabled(onlinePage->isEnabled()); break; - #endif #ifdef ENABLE_DEVICES_SUPPORT case PAGE_DEVICES: DevicesModel::self()->setEnabled(!DevicesModel::self()->isEnabled()); @@ -2218,11 +2179,7 @@ void MainWindow::locateAlbum(const QString &artist, const QString &album) void MainWindow::dynamicStatus(const QString &message) { - #ifdef ENABLE_DYNAMIC Dynamic::self()->helperMessage(message); - #else - Q_UNUSED(message) - #endif } void MainWindow::setCollection(const QString &collection) @@ -2466,9 +2423,7 @@ void MainWindow::updateActionToolTips() tabWidget->setToolTip(PAGE_LIBRARY, libraryTabAction->toolTip()); tabWidget->setToolTip(PAGE_FOLDERS, foldersTabAction->toolTip()); tabWidget->setToolTip(PAGE_PLAYLISTS, playlistsTabAction->toolTip()); - #ifdef ENABLE_ONLINE_SERVICES tabWidget->setToolTip(PAGE_ONLINE, onlineTabAction->toolTip()); - #endif #ifdef ENABLE_DEVICES_SUPPORT tabWidget->setToolTip(PAGE_DEVICES, devicesTabAction->toolTip()); #endif diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 832d5537c..30af82995 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -51,9 +51,7 @@ class Page; class LibraryPage; class FolderPage; class PlaylistsPage; -#ifdef ENABLE_ONLINE_SERVICES class OnlineServicesPage; -#endif #ifdef ENABLE_DEVICES_SUPPORT class DevicesPage; #endif @@ -104,9 +102,7 @@ public: PAGE_LIBRARY, PAGE_FOLDERS, PAGE_PLAYLISTS, - #ifdef ENABLE_ONLINE_SERVICES PAGE_ONLINE, - #endif #ifdef ENABLE_DEVICES_SUPPORT PAGE_DEVICES, #endif @@ -214,11 +210,7 @@ public Q_SLOTS: void showLibraryTab() { showTab(PAGE_LIBRARY); } void showFoldersTab() { showTab(PAGE_FOLDERS); } void showPlaylistsTab() { showTab(PAGE_PLAYLISTS); } - void showOnlineTab() { - #ifdef ENABLE_ONLINE_SERVICES - showTab(PAGE_ONLINE); - #endif - } + void showOnlineTab() { showTab(PAGE_ONLINE); } void showContextTab() { showTab(PAGE_CONTEXT); } void showDevicesTab() { #ifdef ENABLE_DEVICES_SUPPORT @@ -343,10 +335,8 @@ private: FolderPage *folderPage; Action *playlistsTabAction; PlaylistsPage *playlistsPage; - #ifdef ENABLE_ONLINE_SERVICES Action *onlineTabAction; OnlineServicesPage *onlinePage; - #endif QWidget *contextPage; #ifdef ENABLE_DEVICES_SUPPORT Action *devicesTabAction; diff --git a/gui/preferencesdialog.cpp b/gui/preferencesdialog.cpp index 26b26d128..c01ed21f9 100644 --- a/gui/preferencesdialog.cpp +++ b/gui/preferencesdialog.cpp @@ -25,9 +25,7 @@ #include "settings.h" #include "widgets/icons.h" #include "interfacesettings.h" -#ifdef ENABLE_STREAMS #include "streams/streamssettings.h" -#endif #include "serversettings.h" #include "playbacksettings.h" #include "filesettings.h" @@ -82,11 +80,9 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) addPage(QLatin1String("playback"), playback, i18n("Playback"), Icon("media-playback-start"), i18n("Playback Settings")); addPage(QLatin1String("files"), files, i18n("Files"), Icons::self()->filesIcon, i18n("File Settings")); addPage(QLatin1String("interface"), interface, i18n("Interface"), Icon("preferences-other"), i18n("Interface Settings")); - #ifdef ENABLE_STREAMS streams = new StreamsSettings(0); addPage(QLatin1String("streams"), streams, i18n("Streams"), Icons::self()->radioStreamIcon, i18n("Streams Settings")); streams->load(); - #endif addPage(QLatin1String("context"), context, i18n("Context"), Icons::self()->contextIcon, i18n("Context View Settings")); addPage(QLatin1String("scrobbling"), scrobbling, i18n("Scrobbling"), Icons::self()->lastFmIcon, i18n("Scrobbling Settings")); #ifdef ENABLE_HTTP_SERVER @@ -155,9 +151,7 @@ void PreferencesDialog::writeSettings() playback->save(); files->save(); interface->save(); - #ifdef ENABLE_STREAMS streams->save(); - #endif #ifdef ENABLE_HTTP_SERVER if (http) { http->save(); diff --git a/gui/preferencesdialog.h b/gui/preferencesdialog.h index 88c80f48b..842320542 100644 --- a/gui/preferencesdialog.h +++ b/gui/preferencesdialog.h @@ -36,9 +36,7 @@ class ServerSettings; class PlaybackSettings; class FileSettings; class InterfaceSettings; -#ifdef ENABLE_STREAMS class StreamsSettings; -#endif class ContextSettings; class HttpServerSettings; struct MPDConnectionDetails; @@ -80,9 +78,7 @@ private: PlaybackSettings *playback; FileSettings *files; InterfaceSettings *interface; - #ifdef ENABLE_STREAMS StreamsSettings *streams; - #endif ContextSettings *context; #ifdef ENABLE_HTTP_SERVER HttpServerSettings *http; diff --git a/http/httpserver.cpp b/http/httpserver.cpp index caa459257..7d47bbf3f 100644 --- a/http/httpserver.cpp +++ b/http/httpserver.cpp @@ -185,11 +185,9 @@ QByteArray HttpServer::encodeUrl(const Song &s) if (s.track) { query.addQueryItem("track", QString::number(s.track)); } - #ifdef ENABLE_ONLINE_SERVICES if (s.isFromOnlineService()) { query.addQueryItem("onlineservice", s.onlineService()); } - #endif query.addQueryItem("id", QString::number(s.id)); query.addQueryItem("cantata", "song"); #if QT_VERSION >= 0x050000 @@ -281,11 +279,9 @@ Song HttpServer::decodeUrl(const QUrl &url) const if (q.hasQueryItem("id")) { s.id=q.queryItemValue("id").toInt(); } - #ifdef ENABLE_ONLINE_SERVICES if (q.hasQueryItem("onlineservice")) { s.setIsFromOnlineService(q.queryItemValue("onlineservice")); } - #endif s.file=url.path(); s.type=Song::CantataStream; #ifdef Q_OS_WIN diff --git a/models/streamsmodel.cpp b/models/streamsmodel.cpp index 6eb7155fa..48d0b66fe 100644 --- a/models/streamsmodel.cpp +++ b/models/streamsmodel.cpp @@ -26,7 +26,7 @@ #include "mpd-interface/mpdparseutils.h" #include -#ifdef ENABLE_STREAMS +#ifndef CANTATA_WEB #include "widgets/icons.h" #include "network/networkaccessmanager.h" #include "support/localize.h" @@ -1909,7 +1909,7 @@ QModelIndex StreamsModel::categoryIndex(const CategoryItem *cat) const return -1==row ? QModelIndex() : createIndex(row, 0, (void *)cat); } -#endif // ENABLE_STREAMS +#endif // ifndef CANTATA_WEB const QString StreamsModel::constPrefix=QLatin1String("cantata-stream-"); diff --git a/models/streamsmodel.h b/models/streamsmodel.h index e44cc7ed5..934e3f8ba 100644 --- a/models/streamsmodel.h +++ b/models/streamsmodel.h @@ -27,7 +27,8 @@ #include "config.h" #include -#ifdef ENABLE_STREAMS + +#ifndef CANTATA_WEB #include "actionmodel.h" #include "mpd-interface/stream.h" #include "mpd-interface/playlist.h" @@ -355,5 +356,5 @@ namespace StreamsModel extern bool validProtocol(const QString &file); } -#endif // ENABLE_STREAMS +#endif // ifndef CANTATA_WEB #endif diff --git a/mpd-interface/mpdconnection.cpp b/mpd-interface/mpdconnection.cpp index 1fe58e591..724332736 100644 --- a/mpd-interface/mpdconnection.cpp +++ b/mpd-interface/mpdconnection.cpp @@ -85,7 +85,7 @@ static const QByteArray constIdleOutputValue("output"); static const QByteArray constIdleStickerValue("sticker"); static const QByteArray constIdleSubscriptionValue("subscription"); static const QByteArray constIdleMessageValue("message"); -#ifdef ENABLE_DYNAMIC +#ifndef CANTATA_WEB static const QByteArray constDynamicIn("cantata-dynamic-in"); static const QByteArray constDynamicOut("cantata-dynamic-out"); #endif @@ -370,7 +370,7 @@ MPDConnection::ConnectionReturn MPDConnection::connectToMPD(MpdSocket &socket, b } if (enableIdle) { - #ifdef ENABLE_DYNAMIC + #ifndef CANTATA_WEB dynamicId.clear(); setupRemoteDynamic(); #endif @@ -1449,7 +1449,7 @@ void MPDConnection::parseIdleReturn(const QByteArray &data) } else if (constIdleStickerValue==value) { emit stickerDbChanged(); } - #ifdef ENABLE_DYNAMIC + #ifndef CANTATA_WEB else if (constIdleSubscriptionValue==value) { //if (dynamicId.isEmpty()) { setupRemoteDynamic(); @@ -1775,7 +1775,7 @@ void MPDConnection::sendClientMessage(const QString &channel, const QString &msg void MPDConnection::sendDynamicMessage(const QStringList &msg) { - #ifdef ENABLE_DYNAMIC + #ifndef CANTATA_WEB // Check whether cantata-dynamic is still alive, by seeing if its channel is still open... if (1==msg.count() && QLatin1String("ping")==msg.at(0)) { Response response=sendCommand("channels"); @@ -1889,7 +1889,7 @@ bool MPDConnection::listDirInfo(const QString &dir) } } -#ifdef ENABLE_DYNAMIC +#ifndef CANTATA_WEB bool MPDConnection::checkRemoteDynamicSupport() { if (ver>=CANTATA_MAKE_VERSION(0,17,0)) { diff --git a/mpd-interface/mpdconnection.h b/mpd-interface/mpdconnection.h index 58bee979b..bca966fcc 100644 --- a/mpd-interface/mpdconnection.h +++ b/mpd-interface/mpdconnection.h @@ -403,7 +403,7 @@ private: bool doMoveInPlaylist(const QString &name, const QList &items, quint32 pos, quint32 size); void toggleStopAfterCurrent(bool afterCurrent); bool listDirInfo(const QString &dir); - #ifdef ENABLE_DYNAMIC + #ifndef CANTATA_WEB bool checkRemoteDynamicSupport(); bool subscribe(const QByteArray &channel); void setupRemoteDynamic(); @@ -432,7 +432,7 @@ private: MpdSocket sock; MpdSocket idleSocket; QTimer *connTimer; - #ifdef ENABLE_DYNAMIC + #ifndef CANTATA_WEB QByteArray dynamicId; #endif diff --git a/mpd-interface/mpdparseutils.cpp b/mpd-interface/mpdparseutils.cpp index b95132c05..261f50122 100644 --- a/mpd-interface/mpdparseutils.cpp +++ b/mpd-interface/mpdparseutils.cpp @@ -33,6 +33,7 @@ #include "models/dirviewitemroot.h" #include "models/dirviewitemdir.h" #include "models/dirviewitemfile.h" +#include "online/onlineservice.h" #endif #include "mpdparseutils.h" #include "mpdstatus.h" @@ -47,10 +48,6 @@ #include "support/localize.h" #include "cuefile.h" #include "mpdconnection.h" -#ifdef ENABLE_ONLINE_SERVICES -#include "online/onlineservice.h" -//#include "online/podcastservice.h" -#endif #include static bool debugEnabled=false; @@ -114,7 +111,7 @@ static const QByteArray constStatusBitrateKey("bitrate: "); static const QByteArray constStatusAudioKey("audio: "); static const QByteArray constStatusUpdatingDbKey("updating_db: "); static const QByteArray constStatusErrorKey("error: "); -#ifdef ENABLE_DYNAMIC +#ifndef CANTATA_WEB static const QByteArray constChannel("channel: "); static const QByteArray constMessage("message: "); #endif @@ -384,7 +381,7 @@ Song MPDParseUtils::parseSong(const QList &lines, Location location) } } } else { - #ifdef ENABLE_ONLINE_SERVICES + #ifndef CANTATA_WEB if (OnlineService::decode(song)) { modifiedFile=true; } @@ -510,7 +507,7 @@ QStringList MPDParseUtils::parseList(const QByteArray &data, const QByteArray &k return items; } -#ifdef ENABLE_DYNAMIC +#ifndef CANTATA_WEB MPDParseUtils::MessageMap MPDParseUtils::parseMessages(const QByteArray &data) { MPDParseUtils::MessageMap messages; diff --git a/mpd-interface/mpdparseutils.h b/mpd-interface/mpdparseutils.h index 8cde19ef1..66d058e17 100644 --- a/mpd-interface/mpdparseutils.h +++ b/mpd-interface/mpdparseutils.h @@ -69,7 +69,7 @@ namespace MPDParseUtils extern QList parseSongs(const QByteArray &data, Location location); extern QList parseChanges(const QByteArray &data); extern QStringList parseList(const QByteArray &data, const QByteArray &key); - #ifdef ENABLE_DYNAMIC + #ifndef CANTATA_WEB typedef QMap MessageMap; extern MessageMap parseMessages(const QByteArray &data); #endif diff --git a/mpd-interface/song.cpp b/mpd-interface/song.cpp index 96d8d144f..71504fcfb 100644 --- a/mpd-interface/song.cpp +++ b/mpd-interface/song.cpp @@ -28,7 +28,7 @@ #include "config.h" #include "song.h" #include "support/localize.h" -#if !defined CANTATA_NO_UI_FUNCTIONS && defined ENABLE_ONLINE_SERVICES____TODO +#if !defined CANTATA_NO_UI_FUNCTIONS && !defined CANTATA_WEB #include "online/onlineservice.h" #endif #include @@ -483,7 +483,7 @@ QString Song::artistSong() const QString Song::trackAndTitleStr(bool showArtistIfDifferent) const { - #if !defined CANTATA_NO_UI_FUNCTIONS && defined ENABLE_ONLINE_SERVICES____TODO + #if !defined CANTATA_NO_UI_FUNCTIONS && !defined CANTATA_WEB if ((OnlineSvrTrack==type || Song::CantataStream) && OnlineService::showLogoAsCover(*this)) { return artistSong(); } @@ -645,7 +645,7 @@ bool Song::capitalise() QString Song::albumKey() const { - #if !defined CANTATA_NO_UI_FUNCTIONS && defined ENABLE_ONLINE_SERVICES____TODO + #if !defined CANTATA_NO_UI_FUNCTIONS && !defined CANTATA_WEB if ((OnlineSvrTrack==type || Song::CantataStream) && OnlineService::showLogoAsCover(*this)) { return onlineService(); } diff --git a/widgets/coverwidget.cpp b/widgets/coverwidget.cpp index 591bee4eb..cb8779457 100644 --- a/widgets/coverwidget.cpp +++ b/widgets/coverwidget.cpp @@ -30,9 +30,7 @@ #include "support/localize.h" #include "support/gtkstyle.h" #include "support/utils.h" -#ifdef ENABLE_ONLINE_SERVICES #include "online/onlineservice.h" -#endif #ifdef Q_OS_MAC #include "support/osxstyle.h" #endif @@ -60,11 +58,7 @@ public: switch(event->type()) { case QEvent::ToolTip: { const Song ¤t=CurrentCover::self()->song(); - if (current.isEmpty() || (current.isStream() && !current.isCantataStream() && !current.isCdda()) - #ifdef ENABLE_ONLINE_SERVICES - || OnlineService::showLogoAsCover(current) - #endif - ) { + if (current.isEmpty() || (current.isStream() && !current.isCantataStream() && !current.isCdda()) || OnlineService::showLogoAsCover(current)) { setToolTip(QString()); break; } diff --git a/widgets/icons.cpp b/widgets/icons.cpp index 40534270d..1f4034bb7 100644 --- a/widgets/icons.cpp +++ b/widgets/icons.cpp @@ -373,10 +373,7 @@ Icons::Icons() #else menuIcon=createMenuIcon(stdColor); #endif - - #ifdef ENABLE_STREAMS streamCategoryIcon=Icon(QLatin1String("oxygen")==Icon::currentTheme().toLower() ? "inode-directory" : "folder-music"); - #endif QString iconFile=QString(CANTATA_SYS_ICONS_DIR+"stream.png"); if (QFile::exists(iconFile)) { @@ -441,11 +438,9 @@ Icons::Icons() speakerIcon=Icon("gnome-volume-control"); } } - #ifdef ENABLE_DYNAMIC if (dynamicRuleIcon.isNull()) { dynamicRuleIcon=Icon("text-x-generic"); } - #endif if (playlistIcon.isNull()) { playlistIcon=Icon("audio-x-mp3-playlist"); if (playlistIcon.isNull()) { @@ -467,11 +462,9 @@ Icons::Icons() #endif // Q_OS_WIN && Q_OS_MAC #endif // ENABLE_KDE_SUPPORT - #ifdef ENABLE_STREAMS if (streamCategoryIcon.isNull()) { streamCategoryIcon=folderIcon; } - #endif } void Icons::initSidebarIcons() @@ -487,9 +480,7 @@ void Icons::initSidebarIcons() libraryIcon=loadSidebarIcon(QLatin1String("library"), textCol, highlightedTexCol); foldersIcon=loadSidebarIcon(QLatin1String("folders"), textCol, highlightedTexCol); playlistsIcon=loadSidebarIcon(QLatin1String("playlists"), textCol, highlightedTexCol); - #ifdef ENABLE_ONLINE_SERVICES onlineIcon=loadSidebarIcon(QLatin1String("online"), textCol, highlightedTexCol); - #endif infoSidebarIcon=loadSidebarIcon(QLatin1String("info"), textCol, highlightedTexCol); #ifdef ENABLE_DEVICES_SUPPORT devicesIcon=loadSidebarIcon(QLatin1String("devices"), textCol, highlightedTexCol); diff --git a/widgets/icons.h b/widgets/icons.h index 4f979488a..58b28226d 100644 --- a/widgets/icons.h +++ b/widgets/icons.h @@ -53,9 +53,7 @@ public: Icon consumeIcon; Icon repeatIcon; Icon shuffleIcon; - #ifdef ENABLE_STREAMS Icon streamCategoryIcon; - #endif Icon radioStreamIcon; Icon addRadioStreamIcon; Icon streamIcon; @@ -75,9 +73,7 @@ public: Icon libraryIcon; Icon foldersIcon; Icon playlistsIcon; - #ifdef ENABLE_ONLINE_SERVICES Icon onlineIcon; - #endif Icon contextIcon; Icon searchTabIcon; Icon infoIcon;