Commit 0614e9c7 authored by Luigi Toscano's avatar Luigi Toscano

Use ecm_qt_declare_logging_category and clean includes

- define the logging categories using the specific ECM macro;
- remove the kdebug.h includes.
parent f3004651
...@@ -16,6 +16,7 @@ include(KDECMakeSettings NO_POLICY_SCOPE) ...@@ -16,6 +16,7 @@ include(KDECMakeSettings NO_POLICY_SCOPE)
include(FeatureSummary) include(FeatureSummary)
include(ECMInstallIcons) include(ECMInstallIcons)
include(ECMAddAppIcon) include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Gui Svg Network Test Widgets) find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Gui Svg Network Test Widgets)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Completion GlobalAccel find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Completion GlobalAccel
...@@ -25,7 +26,7 @@ find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE) ...@@ -25,7 +26,7 @@ find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE)
find_package(Taglib 1.6 REQUIRED) find_package(Taglib 1.6 REQUIRED)
include_directories( ${PHONON_INCLUDES} ${KDE4_INCLUDES} ${QT_INCLUDES} ) include_directories(${CMAKE_BINARY_DIR} ${PHONON_INCLUDES} ${KDE4_INCLUDES} ${QT_INCLUDES} )
add_subdirectory( doc ) add_subdirectory( doc )
add_subdirectory( tests ) add_subdirectory( tests )
...@@ -91,7 +92,6 @@ set(juk_SRCS ${tunepimp_SRCS} ...@@ -91,7 +92,6 @@ set(juk_SRCS ${tunepimp_SRCS}
webimagefetcher.cpp webimagefetcher.cpp
historyplaylist.cpp historyplaylist.cpp
juk.cpp juk.cpp
juk_debug.cpp
keydialog.cpp keydialog.cpp
lyricswidget.cpp lyricswidget.cpp
main.cpp main.cpp
...@@ -132,6 +132,9 @@ set(juk_SRCS ${tunepimp_SRCS} ...@@ -132,6 +132,9 @@ set(juk_SRCS ${tunepimp_SRCS}
ktrm.cpp ktrm.cpp
viewmode.cpp ) viewmode.cpp )
ecm_qt_declare_logging_category(juk_SRCS HEADER juk_debug.h
IDENTIFIER JUK_LOG CATEGORY_NAME org.kde.juk)
qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.collection.xml qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.collection.xml
dbuscollectionproxy.h DBusCollectionProxy ) dbuscollectionproxy.h DBusCollectionProxy )
qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.player.xml playermanager.h PlayerManager) qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.player.xml playermanager.h PlayerManager)
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "actioncollection.h" #include "actioncollection.h"
#include <kactioncollection.h> #include <kactioncollection.h>
#include <kdebug.h>
#include "juk.h" #include "juk.h"
#include "juk_debug.h" #include "juk_debug.h"
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kconfig.h> #include <kconfig.h>
#include <klocale.h> #include <klocale.h>
#include <kdebug.h>
#include <ktoggleaction.h> #include <ktoggleaction.h>
#include <kglobal.h> #include <kglobal.h>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include <klocale.h> #include <klocale.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kdebug.h>
#include <kmenu.h> #include <kmenu.h>
#include <kconfig.h> #include <kconfig.h>
#include <kconfiggroup.h> #include <kconfiggroup.h>
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <kglobal.h> #include <kglobal.h>
#include <kapplication.h> #include <kapplication.h>
#include <kdebug.h>
#include <QRegExp> #include <QRegExp>
#include <QLabel> #include <QLabel>
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <QByteArray> #include <QByteArray>
#include <QMap> #include <QMap>
#include <kdebug.h>
#include <ktemporaryfile.h> #include <ktemporaryfile.h>
#include <kdemacros.h> #include <kdemacros.h>
#include <kurl.h> #include <kurl.h>
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "coverproxy.h" #include "coverproxy.h"
#include <kdebug.h>
#include <kio/job.h> #include <kio/job.h>
#include "covermanager.h" #include "covermanager.h"
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <QtDBus/QDBusConnection> #include <QtDBus/QDBusConnection>
#include <KTemporaryFile> #include <KTemporaryFile>
#include <kdebug.h>
#include "collectionadaptor.h" #include "collectionadaptor.h"
#include "playlistcollection.h" #include "playlistcollection.h"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <kfiledialog.h> #include <kfiledialog.h>
#include <klocale.h> #include <klocale.h>
#include <kdebug.h> #include "juk_debug.h"
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// public methods // public methods
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include "filehandle.h" #include "filehandle.h"
#include <kdebug.h>
#include <QFileInfo> #include <QFileInfo>
#include <limits.h> #include <limits.h>
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <algorithm> #include <algorithm>
#include <kdebug.h>
#include <kurl.h> #include <kurl.h>
#include <kurlrequester.h> #include <kurlrequester.h>
#include <kiconloader.h> #include <kiconloader.h>
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
#include "filerenameroptions.h" #include "filerenameroptions.h"
#include <klocale.h> #include <klocale.h>
#include <kdebug.h>
#include <knuminput.h> #include <knuminput.h>
#include "juk_debug.h"
FileRenamerTagOptions::FileRenamerTagOptions(QWidget *parent, FileRenamerTagOptions::FileRenamerTagOptions(QWidget *parent,
const TagRenamerOptions &options) : const TagRenamerOptions &options) :
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
#include <klocale.h> #include <klocale.h>
#include <kglobal.h> #include <kglobal.h>
#include <kdebug.h>
#include "juk_debug.h"
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// HistoryPlayList public members // HistoryPlayList public members
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "juk.h" #include "juk.h"
#include <kstatusbar.h> #include <kstatusbar.h>
#include <kdebug.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <kactioncollection.h> #include <kactioncollection.h>
......
/* This file is part of the KDE project
Copyright (C) 2015 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "juk_debug.h"
Q_LOGGING_CATEGORY(JUK_LOG, "org.kde.juk")
/* This file is part of the KDE project
Copyright (C) 2015 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef JUK_DEBUG_H
#define JUK_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(JUK_LOG)
#endif
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <kprotocolmanager.h> #include <kprotocolmanager.h>
#include <kurl.h> #include <kurl.h>
#include <kdebug.h>
#include <kio/job.h> #include <kio/job.h>
#include <QCoreApplication> #include <QCoreApplication>
...@@ -46,6 +45,8 @@ ...@@ -46,6 +45,8 @@
#include <fixx11h.h> #include <fixx11h.h>
#endif #endif
#include "juk_debug.h"
class KTRMLookup; class KTRMLookup;
extern "C" extern "C"
......
...@@ -23,14 +23,13 @@ ...@@ -23,14 +23,13 @@
#include <KActionCollection> #include <KActionCollection>
#include <KToggleAction> #include <KToggleAction>
#include <KConfigGroup> #include <KConfigGroup>
#include <QDebug>
#include "juk_debug.h"
#include <QIcon> #include <QIcon>
#include <kglobal.h> #include <kglobal.h>
#include "lyricswidget.h" #include "lyricswidget.h"
#include "tag.h" #include "tag.h"
#include "actioncollection.h" #include "actioncollection.h"
#include "juk_debug.h"
LyricsWidget::LyricsWidget(QWidget* parent): QTextBrowser(parent), LyricsWidget::LyricsWidget(QWidget* parent): QTextBrowser(parent),
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "mediafiles.h" #include "mediafiles.h"
#include <kfiledialog.h> #include <kfiledialog.h>
#include <kdebug.h>
#include <klocale.h> #include <klocale.h>
#include <kurl.h> #include <kurl.h>
#include <kio/netaccess.h> #include <kio/netaccess.h>
...@@ -26,8 +25,6 @@ ...@@ -26,8 +25,6 @@
#include <QWidget> #include <QWidget>
#include <QtCore/QFile> #include <QtCore/QFile>
#include "juk_debug.h"
#include <taglib.h> #include <taglib.h>
#include <taglib_config.h> #include <taglib_config.h>
#include <tag.h> #include <tag.h>
...@@ -51,6 +48,8 @@ ...@@ -51,6 +48,8 @@
#include <mp4file.h> #include <mp4file.h>
#endif #endif
#include "juk_debug.h"
namespace MediaFiles { namespace MediaFiles {
static QStringList savedMimeTypes; static QStringList savedMimeTypes;
......
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
#include "tag.h" #include "tag.h"
#include "collectionlist.h" #include "collectionlist.h"
#include "tagtransactionmanager.h" #include "tagtransactionmanager.h"
#include "juk_debug.h"
#include <kxmlguiwindow.h> #include <kxmlguiwindow.h>
#include <kstatusbar.h> #include <kstatusbar.h>
#include <klocale.h> #include <klocale.h>
#include <kdebug.h>
#include <QList> #include <QList>
#include <QFileInfo> #include <QFileInfo>
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <kiconloader.h> #include <kiconloader.h>
#include <klocale.h> #include <klocale.h>
#include <kdebug.h>
#include <krandom.h> #include <krandom.h>
#include <kglobalsettings.h> #include <kglobalsettings.h>
#include <kio/netaccess.h> #include <kio/netaccess.h>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "playermanager.h" #include "playermanager.h"
#include <kdebug.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <klocale.h> #include <klocale.h>
#include <kactioncollection.h> #include <kactioncollection.h>
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <kiconloader.h> #include <kiconloader.h>
#include <klineedit.h> #include <klineedit.h>
#include <klocale.h> #include <klocale.h>
#include <kdebug.h>
#include <kfiledialog.h> #include <kfiledialog.h>
#include <kglobalsettings.h> #include <kglobalsettings.h>
#include <kurl.h> #include <kurl.h>
...@@ -1168,7 +1167,7 @@ QMimeData* Playlist::mimeData(const QList<QTreeWidgetItem *> items) const ...@@ -1168,7 +1167,7 @@ QMimeData* Playlist::mimeData(const QList<QTreeWidgetItem *> items) const
bool Playlist::dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action) bool Playlist::dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action)
{ {
qDebug() << index; qCDebug(JUK_LOG) << index;
return true; return true;
} }
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#define PLAYLIST_H #define PLAYLIST_H
#include <kglobalsettings.h> #include <kglobalsettings.h>
#include <kdebug.h>
#include <QVector> #include <QVector>
#include <QEvent> #include <QEvent>
...@@ -32,6 +31,7 @@ ...@@ -32,6 +31,7 @@
#include "tagguesser.h" #include "tagguesser.h"
#include "playlistinterface.h" #include "playlistinterface.h"
#include "filehandle.h" #include "filehandle.h"
#include "juk_debug.h"
class KMenu; class KMenu;
class KActionMenu; class KActionMenu;
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <kmenu.h> #include <kmenu.h>
#include <QAction> #include <QAction>
#include <kactioncollection.h> #include <kactioncollection.h>
#include <kdebug.h>
#include <ktoggleaction.h> #include <ktoggleaction.h>
#include <kselectaction.h> #include <kselectaction.h>
#include <kconfiggroup.h> #include <kconfiggroup.h>
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "playlistitem.h" #include "playlistitem.h"
#include <config-juk.h> #include <config-juk.h>
#include <kdebug.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <QPixmap> #include <QPixmap>
...@@ -30,6 +29,7 @@ ...@@ -30,6 +29,7 @@
#include "coverinfo.h" #include "coverinfo.h"
#include "covermanager.h" #include "covermanager.h"
#include "tagtransactionmanager.h" #include "tagtransactionmanager.h"
#include "juk_debug.h"
PlaylistItemList PlaylistItem::m_playingItems; // static PlaylistItemList PlaylistItem::m_playingItems; // static
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#ifndef JUK_PLAYLISTITEM_H #ifndef JUK_PLAYLISTITEM_H
#define JUK_PLAYLISTITEM_H #define JUK_PLAYLISTITEM_H
#include <kdebug.h>
#include <QExplicitlySharedDataPointer> #include <QExplicitlySharedDataPointer>
#include <QVector> #include <QVector>
#include <QPixmap> #include <QPixmap>
...@@ -27,6 +25,7 @@ ...@@ -27,6 +25,7 @@
#include "tagguesser.h" #include "tagguesser.h"
#include "filehandle.h" #include "filehandle.h"
#include "juk_debug.h"
class Playlist; class Playlist;
class PlaylistItem; class PlaylistItem;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "collectionlist.h" #include "collectionlist.h"
#include "juk-exception.h" #include "juk-exception.h"
#include <kdebug.h> #include "juk_debug.h"
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// public methods // public methods
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <QAction> #include <QAction>
#include <kglobal.h> #include <kglobal.h>
#include <kactioncollection.h> #include <kactioncollection.h>
#include <kdebug.h>
#include <ktoggleaction.h> #include <ktoggleaction.h>
#include <kconfiggroup.h> #include <kconfiggroup.h>
#include <kacceleratormanager.h> #include <kacceleratormanager.h>
......
...@@ -17,9 +17,8 @@ ...@@ -17,9 +17,8 @@
#include "scrobbleconfigdlg.h" #include "scrobbleconfigdlg.h"
#include "scrobbler.h" #include "scrobbler.h"
#include <QDebug>
#include "juk_debug.h" #include "juk_debug.h"
#include <KLineEdit> #include <KLineEdit>
#include <QPushButton> #include <QPushButton>
#include <KLocalizedString> #include <KLocalizedString>
...@@ -31,7 +30,6 @@ ...@@ -31,7 +30,6 @@
#include <QFormLayout> #include <QFormLayout>
ScrobbleConfigDlg::ScrobbleConfigDlg(QWidget* parent, Qt::WindowFlags f) ScrobbleConfigDlg::ScrobbleConfigDlg(QWidget* parent, Qt::WindowFlags f)
: KDialog(parent, f) : KDialog(parent, f)
, m_wallet(0) , m_wallet(0)
......
...@@ -27,11 +27,10 @@ ...@@ -27,11 +27,10 @@
#include <kglobal.h> #include <kglobal.h>
#include <kconfiggroup.h> #include <kconfiggroup.h>
#include <QDebug>
#include "juk_debug.h"
#include <KSharedConfig> #include <KSharedConfig>
#include "tag.h" #include "tag.h"
#include "juk_debug.h"
Scrobbler::Scrobbler(QObject* parent) Scrobbler::Scrobbler(QObject* parent)
: QObject(parent) : QObject(parent)
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#include "searchplaylist.h" #include "searchplaylist.h"
#include "juk-exception.h" #include "juk-exception.h"
#include <kdebug.h>
#include <QHash> #include <QHash>
#include "playlistitem.h" #include "playlistitem.h"
......
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
#include "collectionlist.h" #include "collectionlist.h"
#include "actioncollection.h" #include "actioncollection.h"
#include "searchadaptor.h" #include "searchadaptor.h"
#include "juk_debug.h"
#include <klocale.h> #include <klocale.h>
#include <klineedit.h> #include <klineedit.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kcombobox.h> #include <kcombobox.h>
#include <kdebug.h>
#include <QAction> #include <QAction>
#include <QLabel> #include <QLabel>
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <klocale.h> #include <klocale.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kactioncollection.h> #include <kactioncollection.h>
#include <kdebug.h>
#include <QMouseEvent> #include <QMouseEvent>
#include <QWheelEvent> #include <QWheelEvent>
...@@ -31,6 +30,7 @@ ...@@ -31,6 +30,7 @@
#include "slider.h" #include "slider.h"
#include "playermanager.h" #include "playermanager.h"
#include "juk.h" #include "juk.h"
#include "juk_debug.h"
TrackPositionAction::TrackPositionAction(const QString &text, QObject *parent) : TrackPositionAction::TrackPositionAction(const QString &text, QObject *parent) :
QAction(text, parent) QAction(text, parent)
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
*/ */
#include "sortedstringlist.h" #include "sortedstringlist.h"
#include "juk_debug.h"
#include <kdebug.h>
class SortedStringList::Node class SortedStringList::Node
{ {
......
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
*/ */
#include "splashscreen.h" #include "splashscreen.h"
#include "juk_debug.h"
#include <kapplication.h> #include <kapplication.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <klocale.h> #include <klocale.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <kdebug.h>
#include <QPixmap> #include <QPixmap>
#include <QLabel> #include <QLabel>
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <kiconloader.h> #include <kiconloader.h>
#include <ksqueezedtextlabel.h> #include <ksqueezedtextlabel.h>
#include <klocale.h> #include <klocale.h>
#include <kdebug.h>
#include <QMouseEvent> #include <QMouseEvent>
#include <QLabel> #include <QLabel>
...@@ -33,6 +32,7 @@ ...@@ -33,6 +32,7 @@
#include "playlistinterface.h" #include "playlistinterface.h"
#include "actioncollection.h" #include "actioncollection.h"
#include "tag.h" #include "tag.h"
#include "juk_debug.h"
using namespace ActionCollection; using namespace ActionCollection;
......
...@@ -17,12 +17,11 @@ ...@@ -17,12 +17,11 @@
*/ */
#include "svghandler.h" #include "svghandler.h"
#include "juk_debug.h"
#include <KColorScheme> #include <KColorScheme>
#include <KColorUtils> #include <KColorUtils>
#include <KStandardDirs> #include <KStandardDirs>
#include <QDebug>
#include "juk_debug.h"
#include <QHash> #include <QHash>
#include <QPainter> #include <QPainter>
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@