summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Małek <michalm@jabster.pl>2014-08-03 20:42:51 (GMT)
committerMichał Małek <michalm@jabster.pl>2014-08-03 20:42:51 (GMT)
commit380e90cbd39ecea86a4e384d4ebff4688c88049d (patch)
treeb01210b5ea629ec93c2e2eb1ebd0aea4fdf6e77e
parent1b5cfafba922d3209790eb5bfcc03c80ef2a183e (diff)
First port to KF5 with the help of KDELibs4Support
-rw-r--r--CMakeLists.txt30
-rw-r--r--kcmcddb/CMakeLists.txt8
-rw-r--r--kcmcddb/cddbconfigwidget.cpp10
-rw-r--r--kcmcddb/doc/CMakeLists.txt2
-rw-r--r--kcmcddb/kcmcddb.cpp4
-rw-r--r--kcmcddb/kcmcddb.h2
-rw-r--r--libkcddb/CMakeLists.txt14
-rw-r--r--libkcddb/asynccddbplookup.cpp8
-rw-r--r--libkcddb/asynchttplookup.cpp8
-rw-r--r--libkcddb/asynchttpsubmit.cpp5
-rw-r--r--libkcddb/asyncsmtpsubmit.cpp5
-rw-r--r--libkcddb/cache.cpp10
-rw-r--r--libkcddb/cddb.cpp2
-rw-r--r--libkcddb/cddbplookup.cpp19
-rw-r--r--libkcddb/cdinfo.cpp15
-rw-r--r--libkcddb/cdinfodialog.cpp7
-rw-r--r--libkcddb/cdinfoencodingwidget.cpp1
-rw-r--r--libkcddb/client.cpp12
-rw-r--r--libkcddb/httplookup.cpp4
-rw-r--r--libkcddb/httpsubmit.cpp2
-rw-r--r--libkcddb/kcddb_export.h40
-rw-r--r--libkcddb/logging.cpp22
-rw-r--r--libkcddb/logging.h26
-rw-r--r--libkcddb/lookup.cpp2
-rw-r--r--libkcddb/musicbrainz/asyncmusicbrainzlookup.cpp6
-rw-r--r--libkcddb/musicbrainz/musicbrainzlookup.cpp76
-rw-r--r--libkcddb/sites.cpp4
-rw-r--r--libkcddb/smtpsubmit.cpp4
-rw-r--r--libkcddb/submit.cpp5
-rw-r--r--libkcddb/synccddbplookup.cpp10
-rw-r--r--libkcddb/synchttplookup.cpp8
-rw-r--r--test/CMakeLists.txt33
-rw-r--r--test/asynccddblookuptest.cpp8
-rw-r--r--test/asynchttplookuptest.cpp8
-rw-r--r--test/asynchttpsubmittest.cpp6
-rw-r--r--test/asyncmusicbrainztest.cpp6
-rw-r--r--test/asyncsmtpsubmittest.cpp6
-rw-r--r--test/cachetest.cpp2
-rw-r--r--test/cdinfotest.cpp2
-rw-r--r--test/musicbrainztest-fulldate.cpp6
-rw-r--r--test/musicbrainztest-severaldiscs.cpp6
-rw-r--r--test/musicbrainztest.cpp6
-rw-r--r--test/sitestest.cpp8
-rw-r--r--test/synccddblookuptest.cpp2
-rw-r--r--test/synchttplookuptest.cpp2
-rw-r--r--test/synchttpsubmittest.cpp4
-rw-r--r--test/syncsmtpsubmittest.cpp4
-rw-r--r--test/utf8test.cpp2
48 files changed, 224 insertions, 258 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0a311ea..b11505d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,15 +1,27 @@
project(libkcddb)
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+cmake_minimum_required(VERSION 2.8.12)
+
+find_package(ECM REQUIRED NO_MODULE)
+set(CMAKE_MODULE_PATH "${ECM_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+
+include(KDEInstallDirs)
+include(KDECompilerSettings)
+include(KDECMakeSettings)
+include(FeatureSummary)
+include(GenerateExportHeader)
+
+find_package(Qt5 REQUIRED COMPONENTS Test)
+find_package(KF5 REQUIRED COMPONENTS Config DocTools KDELibs4Support Codecs KIO)
-find_package(KDE4 REQUIRED)
-include(KDE4Defaults)
-include(MacroLibrary)
-include_directories(${KDE4_INCLUDES})
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
-macro_optional_find_package(MusicBrainz5)
-macro_log_feature(MUSICBRAINZ5_FOUND "MusicBrainz5" "A library that provides access to metadata lookup on the MusicBrainz server" "http://www.musicbrainz.org" FALSE "" "Music metadata lookup for KDE multimedia applications through libkcddb. You need version 5.x of libmusicbrainz")
+find_package(MusicBrainz5)
+set_package_properties(MusicBrainz5 PROPERTIES
+ DESCRIPTION "Music metadata lookup for KDE multimedia applications through libkcddb. You need version 5.x of libmusicbrainz"
+ URL "http://www.musicbrainz.org"
+ TYPE OPTIONAL
+ PURPOSE "A library that provides access to metadata lookup on the MusicBrainz server")
if(MUSICBRAINZ5_FOUND)
set(HAVE_MUSICBRAINZ5 1)
@@ -20,10 +32,10 @@ if(MUSICBRAINZ5_FOUND)
musicbrainz/asyncmusicbrainzlookup.cpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
-else(MUSICBRAINZ5_FOUND)
+else()
set(HAVE_MUSICBRAINZ5 0)
set(libmusicbrainz_SRCS)
-endif(MUSICBRAINZ5_FOUND)
+endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-musicbrainz.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-musicbrainz.h )
diff --git a/kcmcddb/CMakeLists.txt b/kcmcddb/CMakeLists.txt
index 6cd7822..5a0d9be 100644
--- a/kcmcddb/CMakeLists.txt
+++ b/kcmcddb/CMakeLists.txt
@@ -6,16 +6,16 @@ add_subdirectory ( doc )
########### next target ###############
set(kcm_cddb_PART_SRCS cddbconfigwidget.cpp kcmcddb.cpp )
-SET_SOURCE_FILES_PROPERTIES(cddbconfigwidget.cpp PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ui_cddbconfigwidget.h)
+set_source_files_properties(cddbconfigwidget.cpp PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ui_cddbconfigwidget.h)
-kde4_add_ui_files(kcm_cddb_PART_SRCS cddbconfigwidget.ui )
+qt5_wrap_ui(kcm_cddb_PART_SRCS cddbconfigwidget.ui )
-kde4_add_plugin(kcm_cddb ${kcm_cddb_PART_SRCS})
+add_library(kcm_cddb MODULE ${kcm_cddb_PART_SRCS})
-target_link_libraries(kcm_cddb ${KDE4_KIO_LIBS} kcddb)
+target_link_libraries(kcm_cddb KF5::KIOCore kcddb)
install(TARGETS kcm_cddb DESTINATION ${PLUGIN_INSTALL_DIR} )
diff --git a/kcmcddb/cddbconfigwidget.cpp b/kcmcddb/cddbconfigwidget.cpp
index e7e3758..9a0fb50 100644
--- a/kcmcddb/cddbconfigwidget.cpp
+++ b/kcmcddb/cddbconfigwidget.cpp
@@ -33,11 +33,7 @@
#include <klocale.h>
#include <kinputdialog.h>
#include <kmessagebox.h>
-#ifndef KDE_NO_DEPRECATED
-#include <keditlistbox.h>
-#else
#include <keditlistwidget.h>
-#endif
#include <kurlrequester.h>
#include <QCheckBox>
@@ -60,11 +56,7 @@ CDDBConfigWidget::CDDBConfigWidget(QWidget * parent)
QVBoxLayout* gbLayout = new QVBoxLayout(groupBox);
gbLayout->setMargin(0);
-#ifndef KDE_NO_DEPRECATED
- KEditListBox* editListWidget = new KEditListBox(groupBox);
-#else
KEditListWidget* editListWidget = new KEditListWidget(groupBox);
-#endif
editListWidget->setCustomEditor(urlReq->customEditor());
editListWidget->setObjectName(QString::fromLatin1("kcfg_cacheLocations"));
gbLayout->addWidget(editListWidget);
@@ -131,5 +123,3 @@ void CDDBConfigWidget::needAuthenticationChanged(bool needsAuth)
}
// vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1
-
-#include "cddbconfigwidget.moc"
diff --git a/kcmcddb/doc/CMakeLists.txt b/kcmcddb/doc/CMakeLists.txt
index a565b0b..c702409 100644
--- a/kcmcddb/doc/CMakeLists.txt
+++ b/kcmcddb/doc/CMakeLists.txt
@@ -1,2 +1,2 @@
########### install files ###############
-kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kcontrol/cddbretrieval)
+kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kcontrol/cddbretrieval)
diff --git a/kcmcddb/kcmcddb.cpp b/kcmcddb/kcmcddb.cpp
index 00c8b9f..1f9bb9d 100644
--- a/kcmcddb/kcmcddb.cpp
+++ b/kcmcddb/kcmcddb.cpp
@@ -40,8 +40,8 @@ K_PLUGIN_FACTORY(KCDDBFactory, registerPlugin<CDDBModule>();)
K_EXPORT_PLUGIN(KCDDBFactory( "kcmcddb" ))
-CDDBModule::CDDBModule(QWidget *parent, const QVariantList &)
- : KCModule(KCDDBFactory::componentData(), parent)
+CDDBModule::CDDBModule(QWidget *parent, const QVariantList &args)
+ : KCModule(parent, args)
{
KGlobal::locale()->insertCatalog( QLatin1String( "libkcddb" ));
setButtons(Default | Apply | Help);
diff --git a/kcmcddb/kcmcddb.h b/kcmcddb/kcmcddb.h
index 5a9a712..9ecf628 100644
--- a/kcmcddb/kcmcddb.h
+++ b/kcmcddb/kcmcddb.h
@@ -32,7 +32,7 @@ class CDDBModule : public KCModule
public:
- CDDBModule(QWidget * parent, const QVariantList &);
+ CDDBModule(QWidget * parent, const QVariantList & args);
public slots:
diff --git a/libkcddb/CMakeLists.txt b/libkcddb/CMakeLists.txt
index 8927d1a..e300a75 100644
--- a/libkcddb/CMakeLists.txt
+++ b/libkcddb/CMakeLists.txt
@@ -28,20 +28,22 @@ set(kcddb_LIB_SRCS ${libmusicbrainz_SRCS}
categories.cpp
genres.cpp
cdinfodialog.cpp
- cdinfoencodingwidget.cpp )
+ cdinfoencodingwidget.cpp
+ logging.cpp )
+qt5_wrap_ui(kcddb_LIB_SRCS cdinfodialog.ui cdinfoencodingwidget.ui )
-kde4_add_ui_files(kcddb_LIB_SRCS cdinfodialog.ui cdinfoencodingwidget.ui )
+kconfig_add_kcfg_files(kcddb_LIB_SRCS configbase.kcfgc )
-kde4_add_kcfg_files(kcddb_LIB_SRCS configbase.kcfgc )
+add_library(kcddb SHARED ${kcddb_LIB_SRCS})
-kde4_add_library(kcddb SHARED ${kcddb_LIB_SRCS})
-
-target_link_libraries(kcddb ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS})
+target_link_libraries(kcddb KF5::Codecs KF5::ConfigGui KF5::KDELibs4Support KF5::KIOCore)
if(MUSICBRAINZ5_FOUND)
target_link_libraries(kcddb ${MUSICBRAINZ5_LIBRARIES})
endif(MUSICBRAINZ5_FOUND)
+generate_export_header(kcddb)
+
set_target_properties(kcddb PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
install(TARGETS kcddb EXPORT LibkcddbTargets ${INSTALL_TARGETS_DEFAULT_ARGS} )
diff --git a/libkcddb/asynccddbplookup.cpp b/libkcddb/asynccddbplookup.cpp
index 8cc7d23..12a1ebd 100644
--- a/libkcddb/asynccddbplookup.cpp
+++ b/libkcddb/asynccddbplookup.cpp
@@ -20,8 +20,8 @@
*/
#include "asynccddbplookup.h"
+#include "logging.h"
-#include <kdebug.h>
#include <ksocketfactory.h>
namespace KCDDB
@@ -77,14 +77,14 @@ namespace KCDDB
void
AsyncCDDBPLookup::slotConnectionSuccess()
{
- kDebug(60010) << "Connection successful";
+ qCDebug(LIBKCDDB) << "Connection successful";
state_ = WaitingForGreeting;
}
void
AsyncCDDBPLookup::slotReadyRead()
{
- kDebug(60010) << "Ready to read. State: " << stateToString();
+ qCDebug(LIBKCDDB) << "Ready to read. State: " << stateToString();
while ( Idle != state_ && isConnected() && socket_->canReadLine() )
read();
@@ -337,6 +337,4 @@ namespace KCDDB
}
-#include "asynccddbplookup.moc"
-
// vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1
diff --git a/libkcddb/asynchttplookup.cpp b/libkcddb/asynchttplookup.cpp
index bba91df..255cc07 100644
--- a/libkcddb/asynchttplookup.cpp
+++ b/libkcddb/asynchttplookup.cpp
@@ -19,11 +19,11 @@
*/
#include "asynchttplookup.h"
+#include "logging.h"
#include <qstringlist.h>
#include <qapplication.h>
-#include <kdebug.h>
#include <kio/job.h>
namespace KCDDB
@@ -74,7 +74,7 @@ namespace KCDDB
void
AsyncHTTPLookup::slotQueryReady()
{
- kDebug(60010) << "Matches Found: " << matchList_.count();
+ qCDebug(LIBKCDDB) << "Matches Found: " << matchList_.count();
if ( Success != result_ )
{
@@ -130,7 +130,7 @@ namespace KCDDB
Result
AsyncHTTPLookup::fetchURL()
{
- kDebug(60010) << "About to fetch: " << cgiURL_.url();
+ qCDebug(LIBKCDDB) << "About to fetch: " << cgiURL_.url();
KIO::TransferJob* job = KIO::get( cgiURL_, KIO::NoReload, KIO::HideProgressInfo );
@@ -147,6 +147,4 @@ namespace KCDDB
}
-#include "asynchttplookup.moc"
-
// vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1
diff --git a/libkcddb/asynchttpsubmit.cpp b/libkcddb/asynchttpsubmit.cpp
index acc6205..3f54857 100644
--- a/libkcddb/asynchttpsubmit.cpp
+++ b/libkcddb/asynchttpsubmit.cpp
@@ -20,7 +20,7 @@
#include "asynchttpsubmit.h"
#include <kio/job.h>
-#include <kdebug.h>
+#include <QtCore/QDebug>
namespace KCDDB
{
@@ -44,7 +44,7 @@ namespace KCDDB
void AsyncHTTPSubmit::slotFinished(KJob* job)
{
- kDebug() << "Finished";
+ qDebug() << "Finished";
if ( job->error()==0 )
emit finished( Success );
@@ -53,4 +53,3 @@ namespace KCDDB
}
}
-#include "asynchttpsubmit.moc"
diff --git a/libkcddb/asyncsmtpsubmit.cpp b/libkcddb/asyncsmtpsubmit.cpp
index 3ea9702..4ead760 100644
--- a/libkcddb/asyncsmtpsubmit.cpp
+++ b/libkcddb/asyncsmtpsubmit.cpp
@@ -18,11 +18,11 @@
*/
#include "asyncsmtpsubmit.h"
+#include "logging.h"
#include "cdinfo.h"
-#include <kdebug.h>
#include <kio/job.h>
namespace KCDDB
@@ -49,7 +49,7 @@ namespace KCDDB
void AsyncSMTPSubmit::slotDone( KJob* job )
{
- kDebug(60010) ;
+ qCDebug(LIBKCDDB) ;
if ( job->error()==0 )
emit finished( Success );
else
@@ -57,4 +57,3 @@ namespace KCDDB
}
}
-#include "asyncsmtpsubmit.moc"
diff --git a/libkcddb/cache.cpp b/libkcddb/cache.cpp
index a1a3899..1869f3d 100644
--- a/libkcddb/cache.cpp
+++ b/libkcddb/cache.cpp
@@ -24,13 +24,13 @@
#include "kcddbconfig.h"
#include "cddb.h"
+#include "logging.h"
#include "config-musicbrainz.h"
#ifdef HAVE_MUSICBRAINZ5
#include "musicbrainz/musicbrainzlookup.h"
#endif
-#include <kdebug.h>
#include <kstandarddirs.h>
#include <QFile>
@@ -44,7 +44,7 @@ namespace KCDDB
{
QString cddbId = CDDB::trackOffsetListToId(offsetList);
- kDebug(60010) << "Looking up " << cddbId << " in CDDB cache";
+ qCDebug(LIBKCDDB) << "Looking up " << cddbId << " in CDDB cache";
CDInfoList infoList;
@@ -104,7 +104,7 @@ namespace KCDDB
else
{
if (source != QLatin1String( "user" ))
- kWarning(60010) << "Unknown source " << source << " for CDInfo";
+ qCWarning(LIBKCDDB) << "Unknown source " << source << " for CDInfo";
cacheDir = QLatin1String( "/user/" );
QString id = CDDB::trackOffsetListToId(offsetList);
@@ -120,12 +120,12 @@ namespace KCDDB
{
if (!dir.mkpath(cacheDir))
{
- kWarning(60010) << "Couldn't create cache directory " << cacheDir;
+ qCWarning(LIBKCDDB) << "Couldn't create cache directory " << cacheDir;
return;
}
}
- kDebug(60010) << "Storing " << cacheFile << " in CDDB cache";
+ qCDebug(LIBKCDDB) << "Storing " << cacheFile << " in CDDB cache";
QFile f(cacheDir + QLatin1Char( '/' ) + cacheFile);
if ( f.open(QIODevice::WriteOnly) )
diff --git a/libkcddb/cddb.cpp b/libkcddb/cddb.cpp
index 9518f87..8e64d12 100644
--- a/libkcddb/cddb.cpp
+++ b/libkcddb/cddb.cpp
@@ -25,7 +25,7 @@
#include <qstringlist.h>
-#include <kdebug.h>
+#include <QtCore/QDebug>
#include <kstringhandler.h>
#include <klocale.h>
diff --git a/libkcddb/cddbplookup.cpp b/libkcddb/cddbplookup.cpp
index 2f3c772..a77b76c 100644
--- a/libkcddb/cddbplookup.cpp
+++ b/libkcddb/cddbplookup.cpp
@@ -20,8 +20,7 @@
*/
#include "cddbplookup.h"
-
-#include <kdebug.h>
+#include "logging.h"
#include <qbytearray.h>
@@ -90,7 +89,7 @@ namespace KCDDB
void
CDDBPLookup::close()
{
- kDebug(60010) << "Disconnect from server...";
+ qCDebug(LIBKCDDB) << "Disconnect from server...";
if ( isConnected() )
{
socket_->close();
@@ -104,16 +103,16 @@ namespace KCDDB
if ( 200 == serverStatus )
{
- kDebug(60010) << "Server response: read-only";
+ qCDebug(LIBKCDDB) << "Server response: read-only";
readOnly_ = true;
}
else if ( 201 == serverStatus )
{
- kDebug(60010) << "Server response: read-write";
+ qCDebug(LIBKCDDB) << "Server response: read-write";
}
else
{
- kDebug(60010) << "Server response: bugger off";
+ qCDebug(LIBKCDDB) << "Server response: bugger off";
return false;
}
@@ -127,11 +126,11 @@ namespace KCDDB
if ( ( 200 != serverStatus ) && ( 402 != serverStatus ) )
{
- kDebug(60010) << "Handshake was too tight. Letting go.";
+ qCDebug(LIBKCDDB) << "Handshake was too tight. Letting go.";
return false;
}
- kDebug(60010) << "Handshake was warm and firm";
+ qCDebug(LIBKCDDB) << "Handshake was warm and firm";
return true;
}
@@ -142,11 +141,11 @@ namespace KCDDB
{
if ( !isConnected() )
{
- kDebug(60010) << "socket status: " << socket_->state();
+ qCDebug(LIBKCDDB) << "socket status: " << socket_->state();
return -1;
}
- kDebug(60010) << "WRITE: [" << line << "]";
+ qCDebug(LIBKCDDB) << "WRITE: [" << line << "]";
QByteArray buf(line.toUtf8());
buf.append( '\n' );
diff --git a/libkcddb/cdinfo.cpp b/libkcddb/cdinfo.cpp
index ee1cd39..e99418d 100644
--- a/libkcddb/cdinfo.cpp
+++ b/libkcddb/cdinfo.cpp
@@ -24,8 +24,9 @@
#include "client.h"
#include "cddb.h"
+#include "logging.h"
-#include <kdebug.h>
+#include <QtCore/QDebug>
#include <kstringhandler.h>
#include <QMap>
@@ -119,13 +120,13 @@ namespace KCDDB
void
set(const QString& type, const QVariant &d)
{
- //kDebug() << "set: " << type << ", " << d.toString();
+ //qDebug() << "set: " << type << ", " << d.toString();
if(type.contains(QRegExp( QLatin1String( "^T.*_.*$" )) )){
- kDebug(60010) << "Error: custom cdinfo::set data can not start with T and contain a _";
+ qCDebug(LIBKCDDB) << "Error: custom cdinfo::set data can not start with T and contain a _";
return;
}
if(type.toUpper() == QLatin1String( "DTITLE" )){
- kDebug(60010) << "Error: type: DTITLE is reserved and can not be set.";
+ qCDebug(LIBKCDDB) << "Error: type: DTITLE is reserved and can not be set.";
return;
}
@@ -227,7 +228,7 @@ namespace KCDDB
bool ok;
int track = get(QLatin1String( "tracknumber" )).toInt(&ok);
if(!ok)
- kDebug(60010) << "Warning toString() on a track that doesn't have track number assigned.";
+ qCDebug(LIBKCDDB) << "Warning toString() on a track that doesn't have track number assigned.";
QMap<QString, QVariant>::const_iterator i = d->data.constBegin();
while (i != d->data.constEnd()) {
if(i.key() != QLatin1String( "COMMENT" ) && i.key() != QLatin1String( "TITLE" ) && i.key() != QLatin1String( "ARTIST" ) && i.key() != QLatin1String( "TRACKNUMBER" )) {
@@ -412,7 +413,7 @@ namespace KCDDB
if ( get(Genre).toString().isEmpty() )
set(Genre, QLatin1String( "Unknown" ));
- kDebug(60010) << "Loaded CDInfo for " << get(QLatin1String( "discid" )).toString();
+ qCDebug(LIBKCDDB) << "Loaded CDInfo for " << get(QLatin1String( "discid" )).toString();
return true;
}
@@ -572,7 +573,7 @@ namespace KCDDB
return d->trackInfoList[trackNumber];
else
{
- kWarning() << "Couldn't find track " << trackNumber;
+ qWarning() << "Couldn't find track " << trackNumber;
return TrackInfo();
}
}
diff --git a/libkcddb/cdinfodialog.cpp b/libkcddb/cdinfodialog.cpp
index e7f7839..e5790ec 100644
--- a/libkcddb/cdinfodialog.cpp
+++ b/libkcddb/cdinfodialog.cpp
@@ -27,7 +27,7 @@
#include <QStringList>
#include <QStandardItemModel>
-#include <kdebug.h>
+#include <QtCore/QDebug>
#include <kglobal.h>
#include <kcharsets.h>
@@ -149,10 +149,10 @@ class CDInfoDialog::Private
QList<QStandardItem *> trackItems = QList<QStandardItem *>();
TrackInfo ti(info.track(i));
QStandardItem *trackNumberItem = new QStandardItem(QString().sprintf("%02d", i + 1));
- trackNumberItem->setEditable(FALSE);
+ trackNumberItem->setEditable(false);
trackItems << trackNumberItem;
QStandardItem *trackLengthItem = new QStandardItem(framesTime(trackStartFrames[i + 1] - trackStartFrames[i]));
- trackLengthItem->setEditable(FALSE);
+ trackLengthItem->setEditable(false);
trackItems << trackLengthItem;
QStandardItem *trackTitleItem = new QStandardItem(ti.get(Title).toString());
trackItems << trackTitleItem;
@@ -307,4 +307,3 @@ class CDInfoDialog::Private
}
}
-#include "cdinfodialog.moc"
diff --git a/libkcddb/cdinfoencodingwidget.cpp b/libkcddb/cdinfoencodingwidget.cpp
index 97f6071..9f8866e 100644
--- a/libkcddb/cdinfoencodingwidget.cpp
+++ b/libkcddb/cdinfoencodingwidget.cpp
@@ -67,4 +67,3 @@ namespace KCDDB
}
}
-#include "cdinfoencodingwidget.moc"
diff --git a/libkcddb/client.cpp b/libkcddb/client.cpp
index 6ceb0f5..35ed4c7 100644
--- a/libkcddb/client.cpp
+++ b/libkcddb/client.cpp
@@ -31,6 +31,7 @@
#include "asynchttpsubmit.h"
#include "cache.h"
#include "lookup.h"
+#include "logging.h"
#include "config-musicbrainz.h"
#ifdef HAVE_MUSICBRAINZ5
@@ -38,8 +39,6 @@
#include "musicbrainz/asyncmusicbrainzlookup.h"
#endif
-#include <kdebug.h>
-
namespace KCDDB
{
class Client::Private
@@ -111,7 +110,7 @@ namespace KCDDB
if ( trackOffsetList.count() <= 1 )
{
- kDebug(60010) << "Lookup called with empty offset list";
+ qCDebug(LIBKCDDB) << "Lookup called with empty offset list";
return NoRecordFound;
}
@@ -119,7 +118,7 @@ namespace KCDDB
{
d->cdInfoList = Cache::lookup( trackOffsetList, config() );
- kDebug(60010) << "Found " << d->cdInfoList.count() << " hit(s)";
+ qCDebug(LIBKCDDB) << "Found " << d->cdInfoList.count() << " hit(s)";
if ( !d->cdInfoList.isEmpty() )
{
@@ -321,7 +320,7 @@ namespace KCDDB
break;
}
default:
- kDebug(60010) << "Unsupported transport: ";
+ qCDebug(LIBKCDDB) << "Unsupported transport: ";
// << CDDB::transportToString(d->config.submitTransport()) << endl;
return UnknownError;
break;
@@ -370,7 +369,4 @@ namespace KCDDB
}
}
-#include "client.moc"
-
-
// vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1
diff --git a/libkcddb/httplookup.cpp b/libkcddb/httplookup.cpp
index 9a43712..5e360c8 100644
--- a/libkcddb/httplookup.cpp
+++ b/libkcddb/httplookup.cpp
@@ -22,7 +22,7 @@
#include "httplookup.h"
#include <kio/job.h>
-#include <kdebug.h>
+#include <QtCore/QDebug>
namespace KCDDB
{
@@ -183,6 +183,4 @@ namespace KCDDB
}
}
-#include "httplookup.moc"
-
// vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1
diff --git a/libkcddb/httpsubmit.cpp b/libkcddb/httpsubmit.cpp
index 402c98d..284467c 100644
--- a/libkcddb/httpsubmit.cpp
+++ b/libkcddb/httpsubmit.cpp
@@ -20,7 +20,7 @@
#include "httpsubmit.h"
-#include <kdebug.h>
+#include <QtCore/QDebug>
#include <kio/job.h>
namespace KCDDB
diff --git a/libkcddb/kcddb_export.h b/libkcddb/kcddb_export.h
deleted file mode 100644
index 6ac6d57..0000000
--- a/libkcddb/kcddb_export.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This file is part of the KDE project
- Copyright (C) 2007 David Faure <faure@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 KCDDB_EXPORT_H
-#define KCDDB_EXPORT_H
-
-/* needed for KDE_EXPORT and KDE_IMPORT macros */
-#include <kdemacros.h>
-
-#ifndef KCDDB_EXPORT
-# if defined(MAKE_KCDDB_LIB)
- /* We are building this library */
-# define KCDDB_EXPORT KDE_EXPORT
-# else
- /* We are using this library */
-# define KCDDB_EXPORT KDE_IMPORT
-# endif
-#endif
-
-# ifndef KCDDB_EXPORT_DEPRECATED
-# define KCDDB_EXPORT_DEPRECATED KDE_DEPRECATED KCDDB_EXPORT
-# endif
-
-#endif
diff --git a/libkcddb/logging.cpp b/libkcddb/logging.cpp
new file mode 100644
index 0000000..03cab84
--- /dev/null
+++ b/libkcddb/logging.cpp
@@ -0,0 +1,22 @@
+/*
+ Copyright (C) 2003-2004 Richard Lärkäng <nouseforaname@home.se>
+
+ 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 "logging.h"
+
+Q_LOGGING_CATEGORY(LIBKCDDB, "libkcddb")
diff --git a/libkcddb/logging.h b/libkcddb/logging.h
new file mode 100644
index 0000000..d3115a8
--- /dev/null
+++ b/libkcddb/logging.h
@@ -0,0 +1,26 @@
+#ifndef LOGGING_H
+#define LOGGING_H
+/*
+ Copyright (C) 2003 Richard Lärkäng <nouseforaname@home.se>
+
+ 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 <QtCore/QLoggingCategory>
+
+Q_DECLARE_LOGGING_CATEGORY(LIBKCDDB)
+
+#endif // LOGGING_H
diff --git a/libkcddb/lookup.cpp b/libkcddb/lookup.cpp
index d3ec89a..b7efae0 100644
--- a/libkcddb/lookup.cpp
+++ b/libkcddb/lookup.cpp
@@ -21,7 +21,7 @@
#include "lookup.h"
-#include <kdebug.h>
+#include <QtCore/QDebug>
namespace KCDDB
{
diff --git a/libkcddb/musicbrainz/asyncmusicbrainzlookup.cpp b/libkcddb/musicbrainz/asyncmusicbrainzlookup.cpp
index c13c94f..d17a758 100644
--- a/libkcddb/musicbrainz/asyncmusicbrainzlookup.cpp
+++ b/libkcddb/musicbrainz/asyncmusicbrainzlookup.cpp
@@ -23,7 +23,7 @@
#include <QtCore/QThread>
-#include <kdebug.h>
+#include <QtCore/QDebug>
namespace KCDDB
{
@@ -68,7 +68,7 @@ namespace KCDDB
void AsyncMusicBrainzLookup::lookupFinished()
{
- kDebug() ;
+ qDebug() ;
cdInfoList_ = m_lookupThread->m_lookupResponse;
@@ -77,5 +77,3 @@ namespace KCDDB
}
// vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1
-
-#include "asyncmusicbrainzlookup.moc"
diff --git a/libkcddb/musicbrainz/musicbrainzlookup.cpp b/libkcddb/musicbrainz/musicbrainzlookup.cpp
index 3364897..ee03531 100644
--- a/libkcddb/musicbrainz/musicbrainzlookup.cpp
+++ b/libkcddb/musicbrainz/musicbrainzlookup.cpp
@@ -20,7 +20,7 @@
#include "musicbrainzlookup.h"
-#include <kdebug.h>
+#include <QtCore/QDebug>
#include <kcodecs.h>
#include <klocale.h>
#include <qcryptographichash.h>
@@ -55,7 +55,7 @@ namespace KCDDB
{
QString discId = calculateDiscId(trackOffsetList);
- kDebug() << "Should lookup " << discId;
+ qDebug() << "Should lookup " << discId;
MusicBrainz5::CQuery Query("libkcddb-0.5");
@@ -67,7 +67,7 @@ namespace KCDDB
if (Metadata.Disc() && Metadata.Disc()->ReleaseList())
{
MusicBrainz5::CReleaseList *ReleaseList=Metadata.Disc()->ReleaseList();
- kDebug() << "Found " << ReleaseList->NumItems() << " release(s)";
+ qDebug() << "Found " << ReleaseList->NumItems() << " release(s)";
int relnr=1;
@@ -95,17 +95,17 @@ namespace KCDDB
if (MediaList.NumItems() > 0)
{
/*if (FullRelease->ReleaseGroup())
- kDebug() << "Release group title: " << FullRelease->ReleaseGroup()->Title();
+ qDebug() << "Release group title: " << FullRelease->ReleaseGroup()->Title();
else
- kDebug() << "No release group for this release";*/
+ qDebug() << "No release group for this release";*/
- kDebug() << "Found " << MediaList.NumItems() << " media item(s)";
+ qDebug() << "Found " << MediaList.NumItems() << " media item(s)";
for (int i=0; i < MediaList.NumItems(); i++)
{
MusicBrainz5::CMedium* Medium= MediaList.Item(i);
- /*kDebug() << "Found media: '" << Medium.Title() << "', position " << Medium.Position();*/
+ /*qDebug() << "Found media: '" << Medium.Title() << "', position " << Medium.Position();*/
CDInfo info;
info.set(QLatin1String( "source" ), QLatin1String( "musicbrainz" ));
@@ -176,71 +176,71 @@ namespace KCDDB
catch (MusicBrainz5::CConnectionError& Error)
{
- kDebug() << "Connection Exception: '" << Error.what() << "'";
- kDebug() << "LastResult: " << Query.LastResult();
- kDebug() << "LastHTTPCode: " << Query.LastHTTPCode();
- kDebug() << "LastErrorMessage: " << QString::fromUtf8(Query.LastErrorMessage().c_str());
+ qDebug() << "Connection Exception: '" << Error.what() << "'";
+ qDebug() << "LastResult: " << Query.LastResult();
+ qDebug() << "LastHTTPCode: " << Query.LastHTTPCode();
+ qDebug() << "LastErrorMessage: " << QString::fromUtf8(Query.LastErrorMessage().c_str());
return ServerError;
}
catch (MusicBrainz5::CTimeoutError& Error)
{
- kDebug() << "Timeout Exception: '" << Error.what() << "'";
- kDebug() << "LastResult: " << Query.LastResult();
- kDebug() << "LastHTTPCode: " << Query.LastHTTPCode();
- kDebug() << "LastErrorMessage: " << QString::fromUtf8(Query.LastErrorMessage().c_str());
+ qDebug() << "Timeout Exception: '" << Error.what() << "'";
+ qDebug() << "LastResult: " << Query.LastResult();
+ qDebug() << "LastHTTPCode: " << Query.LastHTTPCode();
+ qDebug() << "LastErrorMessage: " << QString::fromUtf8(Query.LastErrorMessage().c_str());
return ServerError;
}
catch (MusicBrainz5::CAuthenticationError& Error)
{
- kDebug() << "Authentication Exception: '" << Error.what() << "'";
- kDebug() << "LastResult: " << Query.LastResult();
- kDebug() << "LastHTTPCode: " << Query.LastHTTPCode();
- kDebug() << "LastErrorMessage: " << QString::fromUtf8(Query.LastErrorMessage().c_str());
+ qDebug() << "Authentication Exception: '" << Error.what() << "'";
+ qDebug() << "LastResult: " << Query.LastResult();
+ qDebug() << "LastHTTPCode: " << Query.LastHTTPCode();
+ qDebug() << "LastErrorMessage: " << QString::fromUtf8(Query.LastErrorMessage().c_str());
return ServerError;
}
catch (MusicBrainz5::CFetchError& Error)
{
- kDebug() << "Fetch Exception: '" << Error.what() << "'";
- kDebug() << "LastResult: " << Query.LastResult();
- kDebug() << "LastHTTPCode: " << Query.LastHTTPCode();
- kDebug() << "LastErrorMessage: " << QString::fromUtf8(Query.LastErrorMessage().c_str());
+ qDebug() << "Fetch Exception: '" << Error.what() << "'";
+ qDebug() << "LastResult: " << Query.LastResult();
+ qDebug() << "LastHTTPCode: " << Query.LastHTTPCode();
+ qDebug() << "LastErrorMessage: " << QString::fromUtf8(Query.LastErrorMessage().c_str());
return ServerError;
}
catch (MusicBrainz5::CRequestError& Error)
{
- kDebug() << "Request Exception: '" << Error.what() << "'";
- kDebug() << "LastResult: " << Query.LastResult();
- kDebug() << "LastHTTPCode: " << Query.LastHTTPCode();
- kDebug() << "LastErrorMessage: " << QString::fromUtf8(Query.LastErrorMessage().c_str());
+ qDebug() << "Request Exception: '" << Error.what() << "'";
+ qDebug() << "LastResult: " << Query.LastResult();
+ qDebug() << "LastHTTPCode: " << Query.LastHTTPCode();
+ qDebug() << "LastErrorMessage: " << QString::fromUtf8(Query.LastErrorMessage().c_str());
return ServerError;
}
catch (MusicBrainz5::CResourceNotFoundError& Error)
{
- kDebug() << "ResourceNotFound Exception: '" << Error.what() << "'";
- kDebug() << "LastResult: " << Query.LastResult();
- kDebug() << "LastHTTPCode: " << Query.LastHTTPCode();
- kDebug() << "LastErrorMessage: " << QString::fromUtf8(Query.LastErrorMessage().c_str());
+ qDebug() << "ResourceNotFound Exception: '" << Error.what() << "'";
+ qDebug() << "LastResult: " << Query.LastResult();
+ qDebug() << "LastHTTPCode: " << Query.LastHTTPCode();
+ qDebug() << "LastErrorMessage: " << QString::fromUtf8(Query.LastErrorMessage().c_str());
return ServerError;
}
if (cdInfoList_.isEmpty())
{
- kDebug() << "No record found";
+ qDebug() << "No record found";
return NoRecordFound;
}
- kDebug() << "Query succeeded :-)";
+ qDebug() << "Query succeeded :-)";
return Success;
}
@@ -302,7 +302,7 @@ namespace KCDDB
dir.setNameFilters(QStringList(discid+QLatin1String( "*" )));
QStringList files = dir.entryList();
- kDebug() << "Cache files found: " << files.count();
+ qDebug() << "Cache files found: " << files.count();
for (QStringList::iterator it = files.begin(); it != files.end(); ++it)
{
QFile f( dir.filePath(*it) );
@@ -320,7 +320,7 @@ namespace KCDDB
infoList.append( info );
}
else
- kDebug() << "Could not read file: " << f.fileName();
+ qDebug() << "Could not read file: " << f.fileName();
}
}
@@ -329,7 +329,7 @@ namespace KCDDB
QString MusicBrainzLookup::artistFromCreditList(MusicBrainz5::CArtistCredit * artistCredit )
{
- kDebug() << k_funcinfo;
+ qDebug()/* << k_funcinfo*/;
QString artistName;
MusicBrainz5::CNameCreditList *ArtistList=artistCredit->NameCreditList();
@@ -349,7 +349,7 @@ namespace KCDDB
artistName += QString::fromUtf8(Name->JoinPhrase().c_str());
}
- kDebug() << "Artist:" << artistName;
+ qDebug() << "Artist:" << artistName;
}
@@ -358,5 +358,3 @@ namespace KCDDB
}
// vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1
-
-#include "musicbrainzlookup.moc"
diff --git a/libkcddb/sites.cpp b/libkcddb/sites.cpp
index 65a2e48..a3f69ae 100644
--- a/libkcddb/sites.cpp
+++ b/libkcddb/sites.cpp
@@ -23,7 +23,7 @@
#include <kio/netaccess.h>
#include <kio/job.h>
#include <QTextStream>
-#include <kdebug.h>
+#include <QtCore/QDebug>
#include <QRegExp>
namespace KCDDB
@@ -103,7 +103,7 @@ namespace KCDDB
m.port = rexp.cap(3).toUInt();
if (m.transport == Lookup::HTTP && rexp.cap(4) != QLatin1String( "/~cddb/cddb.cgi" ))
- kWarning() << "Non default urls are not supported for http";
+ qWarning() << "Non default urls are not supported for http";
m.description = rexp.cap(5);
}
diff --git a/libkcddb/smtpsubmit.cpp b/libkcddb/smtpsubmit.cpp
index 3e74ce9..bf2c268 100644
--- a/libkcddb/smtpsubmit.cpp
+++ b/libkcddb/smtpsubmit.cpp
@@ -18,8 +18,8 @@
*/
#include "smtpsubmit.h"
+#include "logging.h"
-#include <kdebug.h>
#include <kio/job.h>
namespace KCDDB
@@ -46,7 +46,7 @@ namespace KCDDB
url_.setQuery(QString::fromLatin1("to=%1&subject=cddb %2 %3&from=%4")
.arg(to_, cdInfo.get(Category).toString(),
cdInfo.get(QLatin1String( "discid" )).toString(), from_));
- kDebug(60010) << "Url is: " << url_.prettyUrl();
+ qCDebug(LIBKCDDB) << "Url is: " << url_.prettyUrl();
return KIO::storedPut(diskData_.toUtf8().data(), url_, -1, KIO::HideProgressInfo);
}
diff --git a/libkcddb/submit.cpp b/libkcddb/submit.cpp
index 99661cc..ef806e9 100644
--- a/libkcddb/submit.cpp
+++ b/libkcddb/submit.cpp
@@ -20,8 +20,7 @@
*/
#include "submit.h"
-
-#include <kdebug.h>
+#include "logging.h"
namespace KCDDB
{
@@ -82,7 +81,7 @@ namespace KCDDB
diskData_ += cdInfo.toString(true);
- kDebug(60010) << "diskData_ == " << diskData_;
+ qCDebug(LIBKCDDB) << "diskData_ == " << diskData_;
}
bool Submit::validCategory( const QString& c )
diff --git a/libkcddb/synccddbplookup.cpp b/libkcddb/synccddbplookup.cpp
index a4d9625..7c402bc 100644
--- a/libkcddb/synccddbplookup.cpp
+++ b/libkcddb/synccddbplookup.cpp
@@ -20,9 +20,9 @@
*/
#include "synccddbplookup.h"
+#include "logging.h"
#include <qstringlist.h>
-#include <kdebug.h>
#include <ksocketfactory.h>
namespace KCDDB
@@ -51,8 +51,8 @@ namespace KCDDB
if ( !socket_->isValid() )
{
- kDebug(60010) << "Couldn't connect to " << socket_->peerName() << ":" << socket_->peerPort();
- kDebug(60010) << "Socket error: " << socket_->errorString();
+ qCDebug(LIBKCDDB) << "Couldn't connect to " << socket_->peerName() << ":" << socket_->peerPort();
+ qCDebug(LIBKCDDB) << "Socket error: " << socket_->errorString();
if ( socket_->error() == QAbstractSocket::HostNotFoundError )
return HostNotFound;
@@ -77,7 +77,7 @@ namespace KCDDB
if (matchList_.isEmpty())
return NoRecordFound;
- kDebug(60010) << matchList_.count() << " matches found.";
+ qCDebug(LIBKCDDB) << matchList_.count() << " matches found.";
// For each match, read the cd info from the server and save it to
// cdInfoList.
@@ -186,7 +186,7 @@ namespace KCDDB
{
if ( !isConnected() )
{
- kDebug(60010) << "socket status: " << socket_->state();
+ qCDebug(LIBKCDDB) << "socket status: " << socket_->state();
return QString();
}
diff --git a/libkcddb/synchttplookup.cpp b/libkcddb/synchttplookup.cpp
index bfe79d2..f5345fa 100644
--- a/libkcddb/synchttplookup.cpp
+++ b/libkcddb/synchttplookup.cpp
@@ -19,11 +19,11 @@
*/
#include "synchttplookup.h"
+#include "logging.h"
#include <qstringlist.h>
#include <qapplication.h>
-#include <kdebug.h>
#include <kio/job.h>
#include <kio/netaccess.h>
@@ -57,7 +57,7 @@ namespace KCDDB
if ( Success != result_ )
return result_;
- kDebug(60010) << matchList_.count() << " matches found.";
+ qCDebug(LIBKCDDB) << matchList_.count() << " matches found.";
if (matchList_.isEmpty())
return NoRecordFound;
@@ -87,7 +87,7 @@ namespace KCDDB
if ( Success != result_ )
return result_;
- kDebug(60010) << "runQuery() Result: " << resultToString(result_);
+ qCDebug(LIBKCDDB) << "runQuery() Result: " << resultToString(result_);
return result_;
}
@@ -109,7 +109,7 @@ namespace KCDDB
Result
SyncHTTPLookup::fetchURL()
{
- kDebug(60010) << "About to fetch: " << cgiURL_.url();
+ qCDebug(LIBKCDDB) << "About to fetch: " << cgiURL_.url();
KIO::TransferJob* job = KIO::get( cgiURL_, KIO::NoReload, KIO::HideProgressInfo );
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index e2e2aab..87851a4 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -2,23 +2,23 @@ set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/../libkcddb )
+macro(kcddb_executable_tests)
+ foreach(_testname ${ARGN})
+ add_executable(${_testname} ${_testname}.cpp)
+ add_test( ${_testname} ${_testname} )
+ target_link_libraries(${_testname} Qt5::Test kcddb)
+ endforeach()
+endmacro()
-MACRO(KCDDB_EXECUTABLE_TESTS)
- FOREACH(_testname ${ARGN})
- kde4_add_executable(${_testname} TEST ${_testname}.cpp)
- target_link_libraries(${_testname} ${KDE4_KDEUI_LIBS}
- ${QT_QTTEST_LIBRARY} kcddb)
- ENDFOREACH(_testname)
-ENDMACRO(KCDDB_EXECUTABLE_TESTS)
-MACRO(KCDDB_UNIT_TESTS)
- FOREACH(_testname ${ARGN})
- kde4_add_unit_test(${_testname} TESTNAME kcddb-${_testname} ${_testname}.cpp)
- target_link_libraries(${_testname} ${KDE4_KDEUI_LIBS}
- ${QT_QTTEST_LIBRARY} kcddb)
- ENDFOREACH(_testname)
-ENDMACRO(KCDDB_UNIT_TESTS)
+macro(kcddb_unit_tests)
+ foreach(_testname ${ARGN})
+ add_executable(${_testname} ${_testname}.cpp)
+ add_test( kcddb-${_testname} ${_testname} )
+ target_link_libraries(${_testname} Qt5::Test kcddb)
+ endforeach()
+endmacro()
-KCDDB_UNIT_TESTS(
+kcddb_unit_tests(
asynchttplookuptest
asynccddblookuptest
synccddblookuptest
@@ -32,11 +32,10 @@ KCDDB_UNIT_TESTS(
musicbrainztest-fulldate
)
-KCDDB_EXECUTABLE_TESTS(
+kcddb_executable_tests(
syncsmtpsubmittest
asyncsmtpsubmittest
asynchttpsubmittest
synchttpsubmittest
sitestest
)
-
diff --git a/test/asynccddblookuptest.cpp b/test/asynccddblookuptest.cpp
index 03f79fe..f0a8394 100644
--- a/test/asynccddblookuptest.cpp
+++ b/test/asynccddblookuptest.cpp
@@ -95,17 +95,17 @@ void AsyncCDDBLookupTest::testLookup()
AsyncCDDBLookupTest::slotFinished(Result r)
{
m_result = r;
- kDebug() << "AsyncCDDBLookupTest::slotResult: Got " << KCDDB::resultToString(r);
+ qDebug() << "AsyncCDDBLookupTest::slotResult: Got " << KCDDB::resultToString(r);
CDInfoList l = client_->lookupResponse();
- kDebug() << "AsyncCDDBLookupTest::slotResult: Item count: " << l.count();
+ qDebug() << "AsyncCDDBLookupTest::slotResult: Item count: " << l.count();
foreach(const CDInfo &i, l)
{
if (i.get("discid") == "a1107d0a" && i.get(Category) == "jazz")
{
- kDebug() << "Found the CD";
+ qDebug() << "Found the CD";
m_info = i;
break;
}
@@ -115,5 +115,3 @@ AsyncCDDBLookupTest::slotFinished(Result r)
}
QTEST_KDEMAIN(AsyncCDDBLookupTest, NoGUI)
-
-#include "asynccddblookuptest.moc"
diff --git a/test/asynchttplookuptest.cpp b/test/asynchttplookuptest.cpp
index 3377987..5b28ddd 100644
--- a/test/asynchttplookuptest.cpp
+++ b/test/asynchttplookuptest.cpp
@@ -96,17 +96,17 @@ void AsyncHTTPLookupTest::testLookup()
AsyncHTTPLookupTest::slotFinished(Result r)
{
m_result = r;
- kDebug() << "AsyncHTTPLookupTest::slotFinished: Got " << KCDDB::resultToString(r);
+ qDebug() << "AsyncHTTPLookupTest::slotFinished: Got " << KCDDB::resultToString(r);
CDInfoList l = client_->lookupResponse();
- kDebug() << "AsyncHTTPLookupTest::slotFinished: Item count: " << l.count();
+ qDebug() << "AsyncHTTPLookupTest::slotFinished: Item count: " << l.count();
foreach(const CDInfo &i, l)
{
if (i.get("discid") == "a1107d0a" && i.get(Category) == "jazz")
{
- kDebug() << "Found the CD";
+ qDebug() << "Found the CD";
m_info = i;
break;
}
@@ -116,5 +116,3 @@ AsyncHTTPLookupTest::slotFinished(Result r)
}
QTEST_KDEMAIN(AsyncHTTPLookupTest, NoGUI)
-
-#include "asynchttplookuptest.moc"
diff --git a/test/asynchttpsubmittest.cpp b/test/asynchttpsubmittest.cpp
index 155ad98..70792f4 100644
--- a/test/asynchttpsubmittest.cpp
+++ b/test/asynchttpsubmittest.cpp
@@ -17,7 +17,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <kdebug.h>
+#include <QtCore/QDebug>
#include <kapplication.h>
#include <kcmdlineargs.h>
@@ -68,7 +68,7 @@ AsyncHTTPSubmitTest::AsyncHTTPSubmitTest()
void
AsyncHTTPSubmitTest::slotFinished(Result r)
{
- kDebug() << "AsyncHTTPSubmitTest::slotFinished: Got " << KCDDB::resultToString(r);
+ qDebug() << "AsyncHTTPSubmitTest::slotFinished: Got " << KCDDB::resultToString(r);
kapp->quit();
}
@@ -83,5 +83,3 @@ int main(int argc, char ** argv)
return app.exec();
}
-
-#include "asynchttpsubmittest.moc"
diff --git a/test/asyncmusicbrainztest.cpp b/test/asyncmusicbrainztest.cpp
index 4aea67e..7ac3255 100644
--- a/test/asyncmusicbrainztest.cpp
+++ b/test/asyncmusicbrainztest.cpp
@@ -141,11 +141,11 @@ void AsyncMusicBrainzTest::testLookup()
AsyncMusicBrainzTest::slotFinished(Result r)
{
m_result = r;
- kDebug() << ": Got " << KCDDB::resultToString(r);
+ qDebug() << ": Got " << KCDDB::resultToString(r);
CDInfoList l = client_->lookupResponse();
- kDebug() << ": Item count: " << l.count();
+ qDebug() << ": Item count: " << l.count();
QVERIFY(l.count() > 0);
m_info = l.first();
@@ -154,5 +154,3 @@ AsyncMusicBrainzTest::slotFinished(Result r)
}
QTEST_KDEMAIN(AsyncMusicBrainzTest, NoGUI)
-
-#include "asyncmusicbrainztest.moc"
diff --git a/test/asyncsmtpsubmittest.cpp b/test/asyncsmtpsubmittest.cpp
index 5ade7c9..425cca4 100644
--- a/test/asyncsmtpsubmittest.cpp
+++ b/test/asyncsmtpsubmittest.cpp
@@ -17,7 +17,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <kdebug.h>
+#include <QtCore/QDebug>
#include <kapplication.h>
#include <kcmdlineargs.h>
@@ -69,7 +69,7 @@ AsyncSMTPSubmitTest::AsyncSMTPSubmitTest()
void
AsyncSMTPSubmitTest::slotFinished(Result r)
{
- kDebug() << "AsyncSMTPSubmitTest::slotFinished: Got " << KCDDB::resultToString(r);
+ qDebug() << "AsyncSMTPSubmitTest::slotFinished: Got " << KCDDB::resultToString(r);
kapp->quit();
}
@@ -84,5 +84,3 @@ int main(int argc, char ** argv)
return app.exec();
}
-
-#include "asyncsmtpsubmittest.moc"
diff --git a/test/cachetest.cpp b/test/cachetest.cpp
index fd5bcb7..efef3bb 100644
--- a/test/cachetest.cpp
+++ b/test/cachetest.cpp
@@ -130,5 +130,3 @@ void CacheTest::testMusicbrainz()
}
QTEST_KDEMAIN(CacheTest, NoGUI)
-
-#include "cachetest.moc"
diff --git a/test/cdinfotest.cpp b/test/cdinfotest.cpp
index 69f98a8..cff48ca 100644
--- a/test/cdinfotest.cpp
+++ b/test/cdinfotest.cpp
@@ -89,5 +89,3 @@ void CDInfoTest::testLongLines()
}
QTEST_MAIN(CDInfoTest)
-
-#include "cdinfotest.moc"
diff --git a/test/musicbrainztest-fulldate.cpp b/test/musicbrainztest-fulldate.cpp
index d1c4ad4..6e106a2 100644
--- a/test/musicbrainztest-fulldate.cpp
+++ b/test/musicbrainztest-fulldate.cpp
@@ -77,11 +77,11 @@ void MusicBrainzTestFullDate::testLookup()
QVERIFY(r == Success);
- kDebug() << "Client::lookup gave : " << resultToString(r);
+ qDebug() << "Client::lookup gave : " << resultToString(r);
CDInfoList response = c.lookupResponse();
- kDebug() << "Client::lookup returned : " << response.count() << " entries"
+ qDebug() << "Client::lookup returned : " << response.count() << " entries"
<< endl;
QVERIFY(response.count() > 0);
@@ -153,5 +153,3 @@ void MusicBrainzTestFullDate::testLookup()
}
QTEST_KDEMAIN(MusicBrainzTestFullDate, NoGUI)
-
-#include "musicbrainztest-fulldate.moc"
diff --git a/test/musicbrainztest-severaldiscs.cpp b/test/musicbrainztest-severaldiscs.cpp
index e476a8b..65b8487 100644
--- a/test/musicbrainztest-severaldiscs.cpp
+++ b/test/musicbrainztest-severaldiscs.cpp
@@ -67,11 +67,11 @@ void MusicBrainzTestSeveralDiscs::testLookup()
QVERIFY(r == Success);
- kDebug() << "Client::lookup gave : " << resultToString(r);
+ qDebug() << "Client::lookup gave : " << resultToString(r);
CDInfoList response = c.lookupResponse();
- kDebug() << "Client::lookup returned : " << response.count() << " entries"
+ qDebug() << "Client::lookup returned : " << response.count() << " entries"
<< endl;
QVERIFY(response.count() > 0);
@@ -137,5 +137,3 @@ void MusicBrainzTestSeveralDiscs::testLookup()
}
QTEST_KDEMAIN(MusicBrainzTestSeveralDiscs, NoGUI)
-
-#include "musicbrainztest-severaldiscs.moc"
diff --git a/test/musicbrainztest.cpp b/test/musicbrainztest.cpp
index 95bef0b..b0986fd 100644
--- a/test/musicbrainztest.cpp
+++ b/test/musicbrainztest.cpp
@@ -62,11 +62,11 @@ void MusicBrainzTest::testLookup()
QVERIFY(r == Success);
- kDebug() << "Client::lookup gave : " << resultToString(r);
+ qDebug() << "Client::lookup gave : " << resultToString(r);
CDInfoList response = c.lookupResponse();
- kDebug() << "Client::lookup returned : " << response.count() << " entries"
+ qDebug() << "Client::lookup returned : " << response.count() << " entries"
<< endl;
QVERIFY(response.count() > 0);
@@ -120,5 +120,3 @@ void MusicBrainzTest::testLookup()
}
QTEST_KDEMAIN(MusicBrainzTest, NoGUI)
-
-#include "musicbrainztest.moc"
diff --git a/test/sitestest.cpp b/test/sitestest.cpp
index dd028fa..3fbe95b 100644
--- a/test/sitestest.cpp
+++ b/test/sitestest.cpp
@@ -17,7 +17,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <kdebug.h>
+#include <QtCore/QDebug>
#include <kapplication.h>
#include <kcmdlineargs.h>
@@ -35,14 +35,14 @@ main(int argc, char ** argv)
Sites s;
- kDebug() << "Sites: ";
+ qDebug() << "Sites: ";
QList<Mirror> sites = s.siteList();
for (QList<Mirror>::Iterator it = sites.begin(); it != sites.end(); ++it)
if ((*it).transport == Lookup::CDDBP)
- kDebug() << (*it).address << " CDDBP " << (*it).port << " " << (*it).description;
+ qDebug() << (*it).address << " CDDBP " << (*it).port << " " << (*it).description;
else
- kDebug() << (*it).address << " HTTP " << (*it).port << " " << (*it).description;
+ qDebug() << (*it).address << " HTTP " << (*it).port << " " << (*it).description;
return 0;
}
diff --git a/test/synccddblookuptest.cpp b/test/synccddblookuptest.cpp
index 6b6b28b..25adbb5 100644
--- a/test/synccddblookuptest.cpp
+++ b/test/synccddblookuptest.cpp
@@ -92,5 +92,3 @@ void SyncCDDBLookupTest::testLookup()
}
QTEST_KDEMAIN(SyncCDDBLookupTest, NoGUI)
-
-#include "synccddblookuptest.moc"
diff --git a/test/synchttplookuptest.cpp b/test/synchttplookuptest.cpp
index c09f324..862fdee 100644
--- a/test/synchttplookuptest.cpp
+++ b/test/synchttplookuptest.cpp
@@ -92,5 +92,3 @@ void SyncHTTPLookupTest::testLookup()
}
QTEST_KDEMAIN(SyncHTTPLookupTest, NoGUI)
-
-#include "synchttplookuptest.moc"
diff --git a/test/synchttpsubmittest.cpp b/test/synchttpsubmittest.cpp
index a107b9d..7dc83c5 100644
--- a/test/synchttpsubmittest.cpp
+++ b/test/synchttpsubmittest.cpp
@@ -17,7 +17,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <kdebug.h>
+#include <QtCore/QDebug>
#include <kapplication.h>
#include <kcmdlineargs.h>
@@ -67,6 +67,6 @@ main(int argc, char ** argv)
Result r = c.submit(cdInfo, list);
- kDebug() << "Result: " << resultToString(r);
+ qDebug() << "Result: " << resultToString(r);
}
diff --git a/test/syncsmtpsubmittest.cpp b/test/syncsmtpsubmittest.cpp
index c957c6d..d7c63e3 100644
--- a/test/syncsmtpsubmittest.cpp
+++ b/test/syncsmtpsubmittest.cpp
@@ -17,7 +17,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <kdebug.h>
+#include <QtCore/QDebug>
#include <kapplication.h>
#include <kcmdlineargs.h>
@@ -69,6 +69,6 @@ main(int argc, char ** argv)
Result r = c.submit(cdInfo, list);
- kDebug() << "Result: " << resultToString(r);
+ qDebug() << "Result: " << resultToString(r);
}
diff --git a/test/utf8test.cpp b/test/utf8test.cpp
index 83f7b3a..041a656 100644
--- a/test/utf8test.cpp
+++ b/test/utf8test.cpp
@@ -83,5 +83,3 @@ void Utf8Test::testLookup()
}
QTEST_KDEMAIN(Utf8Test, NoGUI)
-
-#include "utf8test.moc"