From 57a36491eef4f6d9360b2572d3ef57753d3491b8 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Wed, 30 Jun 2021 16:26:07 +0200 Subject: [PATCH] Remove mpris.cpp and mpris.h --- src/CMakeLists.txt | 4 ++-- src/core/mpris.cpp | 35 ------------------------------- src/core/mpris.h | 51 ---------------------------------------------- src/main.cpp | 6 +++--- 4 files changed, 5 insertions(+), 91 deletions(-) delete mode 100644 src/core/mpris.cpp delete mode 100644 src/core/mpris.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 31cfd457..f01a2ce7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -608,8 +608,8 @@ if(UNIX AND HAVE_DBUS) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dbus) optional_source(HAVE_DBUS - SOURCES core/mpris.cpp core/mpris2.cpp - HEADERS core/mpris.h core/mpris2.h + SOURCES core/mpris2.cpp + HEADERS core/mpris2.h ) optional_source(HAVE_UDISKS2 SOURCES device/udisks2lister.cpp diff --git a/src/core/mpris.cpp b/src/core/mpris.cpp deleted file mode 100644 index 5161a327..00000000 --- a/src/core/mpris.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Strawberry Music Player - * This file was part of Clementine. - * Copyright 2010, David Sansome - * Copyright 2018-2021, Jonas Kvinge - * - * Strawberry is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Strawberry is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Strawberry. If not, see . - * - */ - -#include "config.h" - -#include - -#include "mpris.h" -#include "mpris2.h" - -namespace mpris { - -Mpris::Mpris(Application *app, QObject *parent) : QObject(parent), mpris2_(new mpris::Mpris2(app, this)) { - QObject::connect(mpris2_, &Mpris2::RaiseMainWindow, this, &Mpris::RaiseMainWindow); -} - -} // namespace mpris diff --git a/src/core/mpris.h b/src/core/mpris.h deleted file mode 100644 index 197ae2bf..00000000 --- a/src/core/mpris.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Strawberry Music Player - * This file was part of Clementine. - * Copyright 2010, David Sansome - * Copyright 2018-2021, Jonas Kvinge - * - * Strawberry is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Strawberry is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Strawberry. If not, see . - * - */ - -#ifndef MPRIS_H -#define MPRIS_H - -#include "config.h" - -#include -#include - -class Application; - -namespace mpris { - -class Mpris2; - -class Mpris : public QObject { - Q_OBJECT - - public: - explicit Mpris(Application *app, QObject *parent = nullptr); - - signals: - void RaiseMainWindow(); - - private: - Mpris2 *mpris2_; -}; - -} // namespace mpris - -#endif // MPRIS_H diff --git a/src/main.cpp b/src/main.cpp index 7a617be4..0a357afc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -83,7 +83,7 @@ #endif // HAVE_QTSPARKLE #ifdef HAVE_DBUS -# include "core/mpris.h" +# include "core/mpris2.h" #endif #include "core/utilities.h" #include "core/metatypes.h" @@ -293,7 +293,7 @@ int main(int argc, char *argv[]) { #endif #ifdef HAVE_DBUS - mpris::Mpris mpris(&app); + mpris::Mpris2 mpris2(&app); #endif // Window @@ -304,7 +304,7 @@ int main(int argc, char *argv[]) { #endif // Q_OS_MACOS #ifdef HAVE_DBUS - QObject::connect(&mpris, &mpris::Mpris::RaiseMainWindow, &w, &MainWindow::Raise); + QObject::connect(&mpris2, &mpris::Mpris2::RaiseMainWindow, &w, &MainWindow::Raise); #endif QObject::connect(&a, &SingleApplication::receivedMessage, &w, QOverload::of(&MainWindow::CommandlineOptionsReceived));