diff --git a/CMakeLists.txt b/CMakeLists.txt index db2924374..50aab733f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -623,7 +623,6 @@ else (TAGLIB_FOUND) endif (NOT PHONON_FOUND) message(" - Tag Editor (taglib required)") message(" - Track Organizer (taglib required)") - message(" - Commandline support (taglib required)") if (NOT WIN32 AND NOT APPLE) message(" - UMS device sync (taglib required)") message(" - MTP device sync (taglib and libmtp required)") diff --git a/gui/application.cpp b/gui/application.cpp index f1c8d26fd..e87a72dfe 100644 --- a/gui/application.cpp +++ b/gui/application.cpp @@ -95,7 +95,6 @@ int Application::newInstance() { } } - #ifdef TAGLIB_FOUND KCmdLineArgs *args(KCmdLineArgs::parsedArgs()); QStringList urls; for (int i = 0; i < args->count(); ++i) { @@ -104,7 +103,6 @@ int Application::newInstance() { if (!urls.isEmpty()) { w->load(urls); } - #endif KStartupInfo::appStarted(startupId()); in=false; return 0; @@ -121,10 +119,7 @@ void Application::mwDestroyed(QObject *obj) Application::Application(int &argc, char **argv) : QtSingleApplication(argc, argv) { - #if defined TAGLIB_FOUND connect(this, SIGNAL(messageReceived(const QString &)), SLOT(message(const QString &))); - #endif - connect(this, SIGNAL(reconnect()), MPDConnection::self(), SLOT(reconnect())); } @@ -159,14 +154,13 @@ bool Application::winEventFilter(MSG *msg, long *result) bool Application::start() { if (isRunning()) { - #ifdef TAGLIB_FOUND QStringList args(arguments()); if (args.count()>1) { args.takeAt(0); sendMessage(args.join("\n")); - } else - #endif + } else { sendMessage(QString()); + } return false; } @@ -176,20 +170,15 @@ bool Application::start() void Application::message(const QString &msg) { - #if defined TAGLIB_FOUND if (!msg.isEmpty()) { load(msg.split("\n")); } - #else - Q_UNUSED(msg) - #endif MainWindow *mw=qobject_cast(activationWindow()); if (mw) { mw->restoreWindow(); } } -#if defined TAGLIB_FOUND void Application::loadFiles() { QStringList args(arguments()); @@ -216,16 +205,12 @@ void Application::load(const QStringList &files) } } } -#endif // TAGLIB_FOUND #elif defined Q_OS_MAC Application::Application(int &argc, char **argv) : QApplication(argc, argv) { - #if defined TAGLIB_FOUND connect(this, SIGNAL(messageReceived(const QString &)), SLOT(message(const QString &))); - #endif - connect(this, SIGNAL(reconnect()), MPDConnection::self(), SLOT(reconnect())); } @@ -241,7 +226,6 @@ bool Application::start() return true; } -#if defined TAGLIB_FOUND void Application::loadFiles() { QStringList args(arguments()); @@ -268,7 +252,6 @@ void Application::load(const QStringList &files) } } } -#endif // TAGLIB_FOUND #else // Q_OS_WIN || Q_OS_MAC #include @@ -317,7 +300,6 @@ void Application::setupIconTheme() void Application::loadFiles() { - #ifdef TAGLIB_FOUND QStringList args(arguments()); if (args.count()>1) { args.takeAt(0); @@ -327,7 +309,6 @@ void Application::loadFiles() m.setArguments(a); QDBusConnection::sessionBus().send(m); } - #endif } #endif diff --git a/gui/application.h b/gui/application.h index 903b11778..5e21baa65 100644 --- a/gui/application.h +++ b/gui/application.h @@ -60,14 +60,10 @@ public: bool winEventFilter(MSG *msg, long *result); bool start(); - #if defined TAGLIB_FOUND void loadFiles(); - #endif // TAGLIB_FOUND private: - #if defined TAGLIB_FOUND void load(const QStringList &files); - #endif private Q_SLOTS: void message(const QString &m); @@ -84,15 +80,11 @@ public: virtual ~Application() { } bool start(); - #if defined TAGLIB_FOUND void loadFiles(); - #endif // TAGLIB_FOUND void setupIconTheme(); private: - #if defined TAGLIB_FOUND void load(const QStringList &files); - #endif }; #else #include diff --git a/gui/main.cpp b/gui/main.cpp index 21d45bbd9..55c6f514e 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -53,9 +53,7 @@ #include "backdropcreator.h" #include "dynamic.h" #include "streamfetcher.h" -#ifdef TAGLIB_FOUND #include "httpserver.h" -#endif #include #include @@ -251,11 +249,9 @@ int main(int argc, char *argv[]) if (dbg&Dbg_StreamFetching) { StreamFetcher::enableDebug(); } - #ifdef TAGLIB_FOUND if (dbg&Dbg_HttpServer) { HttpServer::enableDebug(); } - #endif if (dbg&Dbg_All) { #if QT_VERSION < 0x050000 qInstallMsgHandler(cantataQtMsgHandler); @@ -275,9 +271,7 @@ int main(int argc, char *argv[]) #if !defined Q_OS_MAC app.setActivationWindow(&mw); #endif // !defined Q_OS_MAC - #ifdef TAGLIB_FOUND app.loadFiles(); - #endif // TAGLIB_FOUND if (!Settings::self()->startHidden()) { mw.show(); } diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 902fced0e..d7bcb400d 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -906,7 +906,6 @@ void MainWindow::initSizes() void MainWindow::load(const QStringList &urls) { - #ifdef TAGLIB_FOUND QStringList useable; bool haveHttp=HttpServer::self()->isAlive(); @@ -927,9 +926,6 @@ void MainWindow::load(const QStringList &urls) if (useable.count()) { playQueueModel.addItems(useable, playQueueModel.rowCount(), false, 0); } - #else - Q_UNUSED(urls) - #endif } void MainWindow::songLoaded() diff --git a/http/httpserver.cpp b/http/httpserver.cpp index 86b8aba7d..d36c2db64 100644 --- a/http/httpserver.cpp +++ b/http/httpserver.cpp @@ -186,9 +186,9 @@ QByteArray HttpServer::encodeUrl(const Song &s) const return url.toEncoded(); } -#ifdef TAGLIB_FOUND QByteArray HttpServer::encodeUrl(const QString &file) const { + Song s; #ifdef Q_OS_WIN QString f=fixWindowsPath(file); DBUG << "file" << f << "orig" << file; @@ -200,16 +200,19 @@ QByteArray HttpServer::encodeUrl(const QString &file) const DBUG << "converted to share-path" << f; } } - Song s=Tags::read(f); + #ifdef TAGLIB_FOUND + s=Tags::read(f); + #endif s.file=f; #else DBUG << "file" << file; - Song s=Tags::read(file); + #ifdef TAGLIB_FOUND + s=Tags::read(file); + #endif s.file=file; #endif return encodeUrl(s); } -#endif Song HttpServer::decodeUrl(const QString &url) const { diff --git a/http/httpserver.h b/http/httpserver.h index b83cabb57..231898eac 100644 --- a/http/httpserver.h +++ b/http/httpserver.h @@ -50,9 +50,7 @@ public: QString address() const; bool isOurs(const QString &url) const; QByteArray encodeUrl(const Song &s) const; - #ifdef TAGLIB_FOUND QByteArray encodeUrl(const QString &file) const; - #endif Song decodeUrl(const QUrl &url) const; Song decodeUrl(const QString &file) const; diff --git a/models/playqueuemodel.cpp b/models/playqueuemodel.cpp index 984b00d5f..8f90ddd0b 100644 --- a/models/playqueuemodel.cpp +++ b/models/playqueuemodel.cpp @@ -42,9 +42,7 @@ #include "mpdstatus.h" #include "streamfetcher.h" #include "streamsmodel.h" -#ifdef TAGLIB_FOUND #include "httpserver.h" -#endif #include "settings.h" #include "icon.h" #include "config.h" @@ -56,7 +54,6 @@ const QLatin1String PlayQueueModel::constMoveMimeType("cantata/move"); const QLatin1String PlayQueueModel::constFileNameMimeType("cantata/filename"); const QLatin1String PlayQueueModel::constUriMimeType("text/uri-list"); -#ifdef TAGLIB_FOUND static bool checkExtension(const QString &file) { static QSet constExtensions=QSet() @@ -69,7 +66,6 @@ static bool checkExtension(const QString &file) int pos=file.lastIndexOf('.'); return pos>1 ? constExtensions.contains(file.mid(pos+1).toLower()) : false; } -#endif void PlayQueueModel::encode(QMimeData &mimeData, const QString &mime, const QStringList &values) { @@ -441,11 +437,9 @@ QStringList PlayQueueModel::mimeTypes() const QStringList types; types << constMoveMimeType; types << constFileNameMimeType; - #ifdef TAGLIB_FOUND if (HttpServer::self()->isAlive()) { types << constUriMimeType; } - #endif return types; } @@ -521,9 +515,7 @@ bool PlayQueueModel::dropMimeData(const QMimeData *data, //Act on moves from the music library and dir view addItems(decode(*data, constFileNameMimeType), row, false, 0); return true; - } - #ifdef TAGLIB_FOUND - else if(data->hasFormat(constUriMimeType)/* && MPDConnection::self()->getDetails().isLocal()*/) { + } else if(data->hasFormat(constUriMimeType)/* && MPDConnection::self()->getDetails().isLocal()*/) { QStringList orig=decode(*data, constUriMimeType); QStringList useable; bool haveHttp=HttpServer::self()->isAlive(); @@ -545,7 +537,6 @@ bool PlayQueueModel::dropMimeData(const QMimeData *data, return true; } } - #endif return false; }