summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeslie Zhai <xiangzhai83@gmail.com>2016-08-15 04:17:45 (GMT)
committerLeslie Zhai <xiangzhai83@gmail.com>2016-08-15 04:17:45 (GMT)
commitaeaf3341989fedca65b18d1dcd0e5a006a811d61 (patch)
tree2b5f0d147ad325f675ab6afecfb2bd15e4879d7d
parent8b122fe31192d7d6e2f8167feb42786d72ed7fd2 (diff)
Follow KF5 style header generation and keep the original project version
-rw-r--r--CMakeLists.txt66
-rw-r--r--KF5CddbConfig.cmake.in5
-rw-r--r--kcmcddb/CMakeLists.txt6
-rw-r--r--kcmcddb/cddbconfigwidget.h2
-rw-r--r--kcmcddb/kcmcddb.h2
-rw-r--r--libkcddb/CMakeLists.txt67
-rw-r--r--libkcddb/asynccddbplookup.h4
-rw-r--r--libkcddb/asynchttplookup.h4
-rw-r--r--libkcddb/asynchttpsubmit.h4
-rw-r--r--libkcddb/asyncsmtpsubmit.h4
-rw-r--r--libkcddb/categories.h2
-rw-r--r--libkcddb/cddb.h6
-rw-r--r--libkcddb/cdinfo.cpp2
-rw-r--r--libkcddb/cdinfo.h2
-rw-r--r--libkcddb/cdinfodialog.cpp11
-rw-r--r--libkcddb/cdinfodialog.h6
-rw-r--r--libkcddb/cdinfodialog.ui8
-rw-r--r--libkcddb/cdinfoencodingwidget.h2
-rw-r--r--libkcddb/client.cpp3
-rw-r--r--libkcddb/configbase.kcfgc2
-rw-r--r--libkcddb/genres.h2
-rw-r--r--libkcddb/httplookup.cpp4
-rw-r--r--libkcddb/httplookup.h2
-rw-r--r--libkcddb/kcddb.h2
-rw-r--r--libkcddb/kcddbconfig.cpp2
-rw-r--r--libkcddb/kcddbconfig.h2
-rw-r--r--libkcddb/lookup.h4
-rw-r--r--libkcddb/musicbrainz/asyncmusicbrainzlookup.h4
-rw-r--r--libkcddb/musicbrainz/musicbrainzlookup.cpp4
-rw-r--r--libkcddb/sites.h6
-rw-r--r--test/asynccddblookuptest.cpp117
-rw-r--r--test/asynchttplookuptest.cpp118
-rw-r--r--tests/CMakeLists.txt (renamed from test/CMakeLists.txt)3
-rw-r--r--tests/asynccddblookuptest.cpp117
-rw-r--r--tests/asynccddblookuptest.h (renamed from test/asynccddblookuptest.h)6
-rw-r--r--tests/asynchttplookuptest.cpp118
-rw-r--r--tests/asynchttplookuptest.h (renamed from test/asynchttplookuptest.h)6
-rw-r--r--tests/asynchttpsubmittest.cpp (renamed from test/asynchttpsubmittest.cpp)30
-rw-r--r--tests/asynchttpsubmittest.h (renamed from test/asynchttpsubmittest.h)4
-rw-r--r--tests/asyncmusicbrainztest.cpp (renamed from test/asyncmusicbrainztest.cpp)2
-rw-r--r--tests/asyncmusicbrainztest.h (renamed from test/asyncmusicbrainztest.h)6
-rw-r--r--tests/asyncsmtpsubmittest.cpp (renamed from test/asyncsmtpsubmittest.cpp)32
-rw-r--r--tests/asyncsmtpsubmittest.h (renamed from test/asyncsmtpsubmittest.h)4
-rw-r--r--tests/cachetest.cpp (renamed from test/cachetest.cpp)36
-rw-r--r--tests/cachetest.h (renamed from test/cachetest.h)2
-rw-r--r--tests/cdinfotest.cpp (renamed from test/cdinfotest.cpp)58
-rw-r--r--tests/cdinfotest.h (renamed from test/cdinfotest.h)2
-rw-r--r--tests/musicbrainztest-fulldate.cpp (renamed from test/musicbrainztest-fulldate.cpp)42
-rw-r--r--tests/musicbrainztest-fulldate.h (renamed from test/musicbrainztest-fulldate.h)2
-rw-r--r--tests/musicbrainztest-severaldiscs.cpp (renamed from test/musicbrainztest-severaldiscs.cpp)50
-rw-r--r--tests/musicbrainztest-severaldiscs.h (renamed from test/musicbrainztest-severaldiscs.h)2
-rw-r--r--tests/musicbrainztest.cpp (renamed from test/musicbrainztest.cpp)32
-rw-r--r--tests/musicbrainztest.h (renamed from test/musicbrainztest.h)2
-rw-r--r--tests/sitestest.cpp (renamed from test/sitestest.cpp)2
-rw-r--r--tests/synccddblookuptest.cpp (renamed from test/synccddblookuptest.cpp)34
-rw-r--r--tests/synccddblookuptest.h (renamed from test/synccddblookuptest.h)2
-rw-r--r--tests/synchttplookuptest.cpp (renamed from test/synchttplookuptest.cpp)34
-rw-r--r--tests/synchttplookuptest.h (renamed from test/synchttplookuptest.h)2
-rw-r--r--tests/synchttpsubmittest.cpp (renamed from test/synchttpsubmittest.cpp)30
-rw-r--r--tests/syncsmtpsubmittest.cpp (renamed from test/syncsmtpsubmittest.cpp)32
-rw-r--r--tests/utf8test.cpp (renamed from test/utf8test.cpp)12
-rw-r--r--tests/utf8test.h (renamed from test/utf8test.h)2
62 files changed, 625 insertions, 556 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 67ffc32..d98582e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,22 +2,34 @@ project(libkcddb)
cmake_minimum_required(VERSION 2.8.12)
-find_package(ECM REQUIRED NO_MODULE)
+# ECM setup
+include(FeatureSummary)
+find_package(ECM 5.24.0 NO_MODULE)
+set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
+feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
set(CMAKE_MODULE_PATH "${ECM_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(KDEInstallDirs)
-include(KDECompilerSettings)
+include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
-include(FeatureSummary)
include(GenerateExportHeader)
include(ECMSetupVersion)
+include(ECMPackageConfigHelpers)
+include(ECMGenerateHeaders)
-find_package(Qt5 REQUIRED COMPONENTS Network Widgets)
-find_package(KF5 REQUIRED COMPONENTS Config DocTools Codecs I18n KIO WidgetsAddons)
+set(PROJECT_VERSION "16.08.0")
+set(KF5_DEP_VERSION "5.24.0") # handled by release scripts
+set(REQUIRED_QT_VERSION 5.4.0)
-ecm_setup_version(${KF5_VERSION}
+find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Network Widgets)
+find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS Config DocTools Codecs I18n KIO WidgetsAddons)
+
+ecm_setup_version(${PROJECT_VERSION}
VARIABLE_PREFIX KCDDB
- PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LibkcddbConfigVersion.cmake")
+ VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcddb_version.h"
+ PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CddbConfigVersion.cmake"
+ SOVERSION 16
+)
find_package(MusicBrainz5)
set_package_properties(MusicBrainz5 PROPERTIES
@@ -36,24 +48,40 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-musicbrainz.h.cmake ${CMAKE_CU
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
-add_subdirectory( kcmcddb )
-add_subdirectory( libkcddb )
+add_subdirectory(kcmcddb)
+add_subdirectory(libkcddb)
if(BUILD_TESTING)
find_package(Qt5Test REQUIRED)
- add_subdirectory( test )
+ add_subdirectory(tests)
endif()
feature_summary(WHAT PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
-# Figure out the relative path from the installed Config.cmake file to the install prefix (which may be at
-# runtime different from the chosen CMAKE_INSTALL_PREFIX if under Windows the package was installed anywhere)
-# This relative path will be configured into LibkcddbConfig.cmake
-file(RELATIVE_PATH relInstallDir ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/cmake/libkcddb ${CMAKE_INSTALL_PREFIX})
+set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5Cddb")
+ecm_configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KF5CddbConfig.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/KF5CddbConfig.cmake"
+ INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
+)
-configure_file(LibkcddbConfig.cmake.in ${CMAKE_BINARY_DIR}/LibkcddbConfig.cmake @ONLY)
install(FILES
- ${CMAKE_BINARY_DIR}/LibkcddbConfig.cmake
- ${CMAKE_BINARY_DIR}/LibkcddbConfigVersion.cmake
- DESTINATION ${LIB_INSTALL_DIR}/cmake/libkcddb)
-install(EXPORT LibkcddbTargets DESTINATION ${LIB_INSTALL_DIR}/cmake/libkcddb/ FILE LibkcddbTargets.cmake NAMESPACE KDE::Libkcddb::)
+ "${CMAKE_CURRENT_BINARY_DIR}/KF5CddbConfig.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/KF5CddbConfigVersion.cmake"
+ DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
+ COMPONENT Devel
+)
+
+install(EXPORT
+ KF5CddbTargets
+ DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
+ FILE KF5CddbTargets.cmake
+ NAMESPACE KF5::
+ COMPONENT Devel
+)
+
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/kcddb_version.h"
+ DESTINATION "${KF5_INCLUDE_INSTALL_DIR}"
+ COMPONENT Devel
+)
+
diff --git a/KF5CddbConfig.cmake.in b/KF5CddbConfig.cmake.in
new file mode 100644
index 0000000..9ea3bc2
--- /dev/null
+++ b/KF5CddbConfig.cmake.in
@@ -0,0 +1,5 @@
+@PACKAGE_INIT@
+
+find_dependency(Qt5Widgets "@REQUIRED_QT_VERSION@")
+
+include("${CMAKE_CURRENT_LIST_DIR}/KF5CddbTargets.cmake")
diff --git a/kcmcddb/CMakeLists.txt b/kcmcddb/CMakeLists.txt
index 4e1a2b9..b103670 100644
--- a/kcmcddb/CMakeLists.txt
+++ b/kcmcddb/CMakeLists.txt
@@ -1,5 +1,4 @@
-
-add_subdirectory ( doc )
+add_subdirectory(doc)
ki18n_wrap_ui(ui_sources cddbconfigwidget.ui)
@@ -16,7 +15,8 @@ target_link_libraries(kcm_cddb PRIVATE
KF5::KIOCore
KF5::KIOWidgets
KF5::WidgetsAddons
- kcddbwidgets)
+ KF5::Cddb
+)
install(TARGETS kcm_cddb DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/kcmcddb/cddbconfigwidget.h b/kcmcddb/cddbconfigwidget.h
index 1cc9a8b..bdd4174 100644
--- a/kcmcddb/cddbconfigwidget.h
+++ b/kcmcddb/cddbconfigwidget.h
@@ -30,7 +30,7 @@ class CDDBConfigWidget : public QWidget, public Ui::CDDBConfigWidgetBase
CDDBConfigWidget(QWidget * parent = 0);
- protected slots:
+ protected Q_SLOTS:
virtual void showMirrorList();
diff --git a/kcmcddb/kcmcddb.h b/kcmcddb/kcmcddb.h
index 6780826..5df4edd 100644
--- a/kcmcddb/kcmcddb.h
+++ b/kcmcddb/kcmcddb.h
@@ -34,7 +34,7 @@ class CDDBModule : public KCModule
CDDBModule(QWidget * parent, const QVariantList & args);
- public slots:
+ public Q_SLOTS:
void defaults();
void save();
diff --git a/libkcddb/CMakeLists.txt b/libkcddb/CMakeLists.txt
index 153e405..02f1335 100644
--- a/libkcddb/CMakeLists.txt
+++ b/libkcddb/CMakeLists.txt
@@ -1,3 +1,4 @@
+include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDES})
if(MUSICBRAINZ5_FOUND)
set(musicbrainz_sources
@@ -17,7 +18,7 @@ endif()
kconfig_add_kcfg_files(kcfg_sources configbase.kcfgc)
-add_library(kcddb SHARED
+add_library(KF5Cddb SHARED
cache.cpp
cdinfo.cpp
kcddbconfig.cpp
@@ -45,7 +46,7 @@ add_library(kcddb SHARED
${musicbrainz_sources}
${kcfg_sources})
-target_link_libraries(kcddb
+target_link_libraries(KF5Cddb
PUBLIC
KF5::ConfigGui
PRIVATE
@@ -55,40 +56,64 @@ target_link_libraries(kcddb
Qt5::Network)
if(MUSICBRAINZ5_FOUND)
- target_link_libraries(kcddb PRIVATE musicbrainz)
+ target_link_libraries(KF5Cddb PRIVATE musicbrainz)
endif()
ki18n_wrap_ui(ui_sources cdinfodialog.ui cdinfoencodingwidget.ui)
-add_library(kcddbwidgets SHARED
+add_library(KF5CddbWidgets SHARED
cdinfodialog.cpp
cdinfoencodingwidget.cpp
${ui_sources})
-target_link_libraries(kcddbwidgets
+target_link_libraries(KF5CddbWidgets
PUBLIC
- kcddb
+ KF5::Cddb
Qt5::Widgets
PRIVATE
KF5::Codecs
KF5::I18n)
-generate_export_header(kcddb)
+generate_export_header(KF5Cddb BASE_NAME KCddb)
+add_library(KF5::Cddb ALIAS KF5Cddb)
+add_library(KF5::CddbWidgets ALIAS KF5CddbWidgets)
+target_include_directories(KF5Cddb PUBLIC "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/KCddb>")
-set_target_properties(kcddb kcddbwidgets PROPERTIES VERSION ${KCDDB_VERSION} SOVERSION ${KCDDB_SOVERSION})
+set_target_properties(KF5Cddb PROPERTIES VERSION ${KCDDB_VERSION_STRING}
+ SOVERSION ${KCDDB_SOVERSION}
+ EXPORT_NAME Cddb
+)
-install(TARGETS kcddb kcddbwidgets EXPORT LibkcddbTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
+set_target_properties(KF5CddbWidgets PROPERTIES VERSION ${KCDDB_VERSION_STRING}
+ SOVERSION ${KCDDB_SOVERSION}
+ EXPORT_NAME CddbWidgets
+)
+
+ecm_generate_headers(KCddb_HEADERS
+ HEADER_NAMES
+ Categories
+ Cdinfo
+ CdinfoDialog
+ Client
+ Genres
+ KcddbConfig
+ Kcddb
+
+ REQUIRED_HEADERS KCddb_HEADERS
+)
+
+install(TARGETS KF5Cddb EXPORT KF5CddbTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS KF5CddbWidgets EXPORT KF5CddbTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES
- categories.h
- cdinfo.h
- cdinfodialog.h
- client.h
- genres.h
- kcddbconfig.h
- kcddb.h
- ${CMAKE_CURRENT_BINARY_DIR}/kcddb_export.h
- ${CMAKE_CURRENT_BINARY_DIR}/configbase.h
- DESTINATION ${INCLUDE_INSTALL_DIR}/libkcddb COMPONENT Devel)
-
-install( FILES libkcddb.kcfg DESTINATION ${KCFG_INSTALL_DIR})
+ ${CMAKE_CURRENT_BINARY_DIR}/kcddb_export.h
+ ${CMAKE_CURRENT_BINARY_DIR}/configbase.h
+ ${KCddb_HEADERS}
+ DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KCddb COMPONENT Devel
+)
+
+include(ECMGeneratePriFile)
+ecm_generate_pri_file(BASE_NAME KCddb LIB_NAME KF5Cddb DEPS "Qt5Widgets" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KCddb)
+install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
+
+install(FILES libkcddb.kcfg DESTINATION ${KCFG_INSTALL_DIR})
diff --git a/libkcddb/asynccddbplookup.h b/libkcddb/asynccddbplookup.h
index 4079b25..fb474bf 100644
--- a/libkcddb/asynccddbplookup.h
+++ b/libkcddb/asynccddbplookup.h
@@ -51,12 +51,12 @@ namespace KCDDB
Result lookup( const QString &, uint, const TrackOffsetList & );
- signals:
+ Q_SIGNALS:
void finished( KCDDB::Result );
void quit( Result );
- protected slots:
+ protected Q_SLOTS:
void slotGotError(QAbstractSocket::SocketError error);
void slotConnectionSuccess();
diff --git a/libkcddb/asynchttplookup.h b/libkcddb/asynchttplookup.h
index 6f3ee4a..3d70acc 100644
--- a/libkcddb/asynchttplookup.h
+++ b/libkcddb/asynchttplookup.h
@@ -41,11 +41,11 @@ namespace KCDDB
CDInfoList lookupResponse() const;
- signals:
+ Q_SIGNALS:
void finished( KCDDB::Result );
- protected slots:
+ protected Q_SLOTS:
void slotQueryReady();
void requestCDInfoForMatch();
diff --git a/libkcddb/asynchttpsubmit.h b/libkcddb/asynchttpsubmit.h
index 9dac9d6..59ea38a 100644
--- a/libkcddb/asynchttpsubmit.h
+++ b/libkcddb/asynchttpsubmit.h
@@ -32,11 +32,11 @@ namespace KCDDB
AsyncHTTPSubmit(const QString& from, const QString& hostname, uint port);
virtual ~AsyncHTTPSubmit();
- signals:
+ Q_SIGNALS:
void finished( KCDDB::Result );
protected:
virtual Result runJob(KIO::Job* job);
- private slots:
+ private Q_SLOTS:
void slotFinished(KJob*);
} ;
}
diff --git a/libkcddb/asyncsmtpsubmit.h b/libkcddb/asyncsmtpsubmit.h
index 6eaeef8..e894440 100644
--- a/libkcddb/asyncsmtpsubmit.h
+++ b/libkcddb/asyncsmtpsubmit.h
@@ -38,9 +38,9 @@ namespace KCDDB
const QString& from, const QString& to);
virtual ~AsyncSMTPSubmit();
- signals:
+ Q_SIGNALS:
void finished( KCDDB::Result );
- protected slots:
+ protected Q_SLOTS:
void slotDone( KJob * );
protected:
virtual Result runJob(KIO::Job* job);
diff --git a/libkcddb/categories.h b/libkcddb/categories.h
index d96ae35..fde1392 100644
--- a/libkcddb/categories.h
+++ b/libkcddb/categories.h
@@ -8,7 +8,7 @@
#ifndef KCDDB_CATEGORIES_H
#define KCDDB_CATEGORIES_H
-#include <libkcddb/kcddb_export.h>
+#include <kcddb_export.h>
#include <QtCore/QString>
#include <QtCore/QStringList>
diff --git a/libkcddb/cddb.h b/libkcddb/cddb.h
index 8adc077..d914025 100644
--- a/libkcddb/cddb.h
+++ b/libkcddb/cddb.h
@@ -22,9 +22,9 @@
#ifndef KCDDB_CDDB_H
#define KCDDB_CDDB_H
-#include <libkcddb/kcddb.h>
-#include <libkcddb/cdinfo.h>
-#include <libkcddb/kcddbconfig.h>
+#include <kcddb.h>
+#include <cdinfo.h>
+#include <kcddbconfig.h>
#include <QtCore/QList>
#include <QtCore/QString>
diff --git a/libkcddb/cdinfo.cpp b/libkcddb/cdinfo.cpp
index 4c1d67e..9b23793 100644
--- a/libkcddb/cdinfo.cpp
+++ b/libkcddb/cdinfo.cpp
@@ -351,7 +351,7 @@ namespace KCDDB
checkTrack( trackNumber );
QString extt = track(trackNumber).get(Comment).toString();
- track(trackNumber).set(Comment, extt+value );
+ track(trackNumber).set(Comment, QVariant(extt + value));
}
else if ( key.startsWith(QLatin1String( "T" )) )
{
diff --git a/libkcddb/cdinfo.h b/libkcddb/cdinfo.h
index a8702d8..4cb03a3 100644
--- a/libkcddb/cdinfo.h
+++ b/libkcddb/cdinfo.h
@@ -22,7 +22,7 @@
#ifndef KCDDB_CDINFO_H
#define KCDDB_CDINFO_H
-#include <libkcddb/kcddb_export.h>
+#include <kcddb_export.h>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
diff --git a/libkcddb/cdinfodialog.cpp b/libkcddb/cdinfodialog.cpp
index b5d2e4e..63d1367 100644
--- a/libkcddb/cdinfodialog.cpp
+++ b/libkcddb/cdinfodialog.cpp
@@ -90,6 +90,15 @@ class CDInfoDialog::Private
connect( d->ui->m_multiple, SIGNAL(toggled(bool)), this, SLOT(slotMultipleArtists(bool)) );
connect(d->ui->m_changeEncoding,SIGNAL(clicked()),SLOT(slotChangeEncoding()));
+
+ QHBoxLayout *hbox = new QHBoxLayout;
+ layout->addLayout(hbox);
+ QPushButton *ok = new QPushButton(i18n("Ok"));
+ connect(ok, SIGNAL(clicked()), SLOT(accept()));
+ QPushButton *cancel = new QPushButton(i18n("Cancel"));
+ connect(cancel, SIGNAL(clicked()), SLOT(close()));
+ hbox->addWidget(ok);
+ hbox->addWidget(cancel);
}
void CDInfoDialog::slotTrackSelected( const QModelIndex &index )
@@ -252,7 +261,7 @@ class CDInfoDialog::Private
if (!artist.isEmpty()) {
m_trackModel->setData(m_trackModel->index(t, Private::TRACK_ARTIST), QString());
QString title = m_trackModel->index(t, Private::TRACK_TITLE).data().toString();
- m_trackModel->setData(m_trackModel->index(t, Private::TRACK_TITLE), artist + Private::SEPARATOR + title);
+ m_trackModel->setData(m_trackModel->index(t, Private::TRACK_TITLE), QVariant(artist + Private::SEPARATOR + title));
}
}
d->ui->m_trackList->hideColumn(Private::TRACK_ARTIST);
diff --git a/libkcddb/cdinfodialog.h b/libkcddb/cdinfodialog.h
index cd049c5..7bbbaca 100644
--- a/libkcddb/cdinfodialog.h
+++ b/libkcddb/cdinfodialog.h
@@ -20,9 +20,9 @@
#ifndef KCDDB_CDINFODIALOG_H
#define KCDDB_CDINFODIALOG_H
-#include <libkcddb/kcddb_export.h>
-#include <libkcddb/cdinfo.h>
-#include <libkcddb/kcddb.h>
+#include <kcddb_export.h>
+#include <cdinfo.h>
+#include <kcddb.h>
#include <QtWidgets/QDialog>
diff --git a/libkcddb/cdinfodialog.ui b/libkcddb/cdinfodialog.ui
index 4d60d62..f7c32da 100644
--- a/libkcddb/cdinfodialog.ui
+++ b/libkcddb/cdinfodialog.ui
@@ -254,10 +254,10 @@
<tabstop>m_playOrder</tabstop>
</tabstops>
<includes>
- <include location="local">libkcddb/cdinfo.h</include>
- <include location="local">libkcddb/kcddb.h</include>
- <include location="local">libkcddb/categories.h</include>
- <include location="local">libkcddb/genres.h</include>
+ <include location="local">cdinfo.h</include>
+ <include location="local">kcddb.h</include>
+ <include location="local">categories.h</include>
+ <include location="local">genres.h</include>
</includes>
<resources/>
<connections/>
diff --git a/libkcddb/cdinfoencodingwidget.h b/libkcddb/cdinfoencodingwidget.h
index 9c30950..508ebdd 100644
--- a/libkcddb/cdinfoencodingwidget.h
+++ b/libkcddb/cdinfoencodingwidget.h
@@ -34,7 +34,7 @@ namespace KCDDB
QString selectedEncoding();
- private slots:
+ private Q_SLOTS:
void slotEncodingChanged(const QString &);
private:
diff --git a/libkcddb/client.cpp b/libkcddb/client.cpp
index b122495..68cff8a 100644
--- a/libkcddb/client.cpp
+++ b/libkcddb/client.cpp
@@ -55,6 +55,7 @@ namespace KCDDB
{
delete cdInfoLookup;
delete cdInfoSubmit;
+ qDeleteAll(pendingLookups);
}
Lookup * cdInfoLookup;
@@ -134,6 +135,8 @@ namespace KCDDB
// just in case we have an info lookup hanging around, prevent mem leakage
delete d->cdInfoLookup;
d->cdInfoLookup = 0;
+ qDeleteAll(d->pendingLookups);
+ d->pendingLookups.clear();
if ( blockingMode() )
{
diff --git a/libkcddb/configbase.kcfgc b/libkcddb/configbase.kcfgc
index 309065b..7692fc9 100644
--- a/libkcddb/configbase.kcfgc
+++ b/libkcddb/configbase.kcfgc
@@ -1,6 +1,6 @@
ClassName=ConfigBase
File=libkcddb.kcfg
Mutators=true
-IncludeFiles=libkcddb/kcddb_export.h
+IncludeFiles=kcddb_export.h
Visibility=KCDDB_EXPORT
MemberVariables=dpointer
diff --git a/libkcddb/genres.h b/libkcddb/genres.h
index de3dca3..b067dbd 100644
--- a/libkcddb/genres.h
+++ b/libkcddb/genres.h
@@ -8,7 +8,7 @@
#ifndef KCDDB_GENRES_H
#define KCDDB_GENRES_H
-#include <libkcddb/kcddb_export.h>
+#include <kcddb_export.h>
#include <QtCore/QStringList>
namespace KCDDB
diff --git a/libkcddb/httplookup.cpp b/libkcddb/httplookup.cpp
index 0a5044d..8c27945 100644
--- a/libkcddb/httplookup.cpp
+++ b/libkcddb/httplookup.cpp
@@ -93,7 +93,7 @@ namespace KCDDB
void
HTTPLookup::jobFinished()
{
- QStringList lineList = QString::fromUtf8(data_, data_.size()).split( QLatin1String( "\n" ), QString::SkipEmptyParts );
+ QStringList lineList = QString::fromUtf8(data_).split( QLatin1String( "\n" ), QString::SkipEmptyParts );
QStringList::ConstIterator it = lineList.constBegin();
switch ( state_ )
@@ -158,7 +158,7 @@ namespace KCDDB
{
CDInfo info;
- if ( info.load( QString::fromUtf8(data_,data_.size()) ) )
+ if ( info.load( QString::fromUtf8(data_) ) )
{
info.set( QLatin1String( "category" ), category_ );
info.set( QLatin1String( "discid" ), discid_ );
diff --git a/libkcddb/httplookup.h b/libkcddb/httplookup.h
index 83bcb17..ed99162 100644
--- a/libkcddb/httplookup.h
+++ b/libkcddb/httplookup.h
@@ -60,7 +60,7 @@ namespace KCDDB
Result sendQuery();
Result sendRead( const CDDBMatch & );
- signals:
+ Q_SIGNALS:
void queryReady();
void readReady();
diff --git a/libkcddb/kcddb.h b/libkcddb/kcddb.h
index fca9fd8..aff2636 100644
--- a/libkcddb/kcddb.h
+++ b/libkcddb/kcddb.h
@@ -23,7 +23,7 @@
#include <QtCore/QList>
#include <QtCore/QString>
-#include <libkcddb/kcddb_export.h>
+#include <kcddb_export.h>
namespace KCDDB
{
diff --git a/libkcddb/kcddbconfig.cpp b/libkcddb/kcddbconfig.cpp
index 6cb99a6..a410af4 100644
--- a/libkcddb/kcddbconfig.cpp
+++ b/libkcddb/kcddbconfig.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <libkcddb/kcddbconfig.h>
+#include <kcddbconfig.h>
#include <KConfigCore/KEMailSettings>
diff --git a/libkcddb/kcddbconfig.h b/libkcddb/kcddbconfig.h
index 7df5d4e..5904e4c 100644
--- a/libkcddb/kcddbconfig.h
+++ b/libkcddb/kcddbconfig.h
@@ -23,7 +23,7 @@
#ifndef KCDDB_CONFIG_H
#define KCDDB_CONFIG_H
-#include <libkcddb/kcddb_export.h>
+#include <kcddb_export.h>
#include "configbase.h"
namespace KCDDB
diff --git a/libkcddb/lookup.h b/libkcddb/lookup.h
index fec63ce..ce8df97 100644
--- a/libkcddb/lookup.h
+++ b/libkcddb/lookup.h
@@ -22,8 +22,8 @@
#ifndef KCDDB_LOOKUP_H
#define KCDDB_LOOKUP_H
-#include <libkcddb/cddb.h>
-#include <libkcddb/cdinfo.h>
+#include <cddb.h>
+#include <cdinfo.h>
#include <QtCore/QList>
#include <QtCore/QObject>
diff --git a/libkcddb/musicbrainz/asyncmusicbrainzlookup.h b/libkcddb/musicbrainz/asyncmusicbrainzlookup.h
index 373fb16..042c8eb 100644
--- a/libkcddb/musicbrainz/asyncmusicbrainzlookup.h
+++ b/libkcddb/musicbrainz/asyncmusicbrainzlookup.h
@@ -40,11 +40,11 @@ namespace KCDDB
CDInfoList lookupResponse() const;
- signals:
+ Q_SIGNALS:
void finished( KCDDB::Result );
- protected slots:
+ protected Q_SLOTS:
void lookupFinished( );
private:
diff --git a/libkcddb/musicbrainz/musicbrainzlookup.cpp b/libkcddb/musicbrainz/musicbrainzlookup.cpp
index aa6e08f..d0643c7 100644
--- a/libkcddb/musicbrainz/musicbrainzlookup.cpp
+++ b/libkcddb/musicbrainz/musicbrainzlookup.cpp
@@ -118,7 +118,7 @@ namespace KCDDB
if (relnr == 1)
info.set(QLatin1String( "discid" ), discId);
else
- info.set(QLatin1String( "discid" ), discId+QLatin1String( "-" )+QString::number(relnr));
+ info.set(QLatin1String( "discid" ), QVariant(discId+QLatin1String( "-" )+QString::number(relnr)));
QString title = QString::fromUtf8(FullRelease->Title().c_str());
@@ -129,7 +129,7 @@ namespace KCDDB
info.set(Artist, artistFromCreditList(FullRelease->ArtistCredit()));
QString date = QString::fromUtf8(FullRelease->Date().c_str());
- QRegExp yearRe("^(\\d{4,4})(-\\d{1,2}-\\d{1,2})?$");
+ QRegExp yearRe(QString::fromUtf8("^(\\d{4,4})(-\\d{1,2}-\\d{1,2})?$"));
int year = 0;
if (yearRe.indexIn(date) > -1)
{
diff --git a/libkcddb/sites.h b/libkcddb/sites.h
index 97a157f..2cbaae4 100644
--- a/libkcddb/sites.h
+++ b/libkcddb/sites.h
@@ -20,9 +20,9 @@
#ifndef KCDDB_SITES_H
#define KCDDB_SITES_H
-#include <libkcddb/cddb.h>
-#include <libkcddb/lookup.h>
-#include <libkcddb/kcddb_export.h>
+#include <cddb.h>
+#include <lookup.h>
+#include <kcddb_export.h>
#include <QtCore/QList>
namespace KCDDB
diff --git a/test/asynccddblookuptest.cpp b/test/asynccddblookuptest.cpp
deleted file mode 100644
index 9558c56..0000000
--- a/test/asynccddblookuptest.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- Copyright (C) 2006 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 "asynccddblookuptest.h"
-#include "libkcddb/cache.h"
-#include "libkcddb/lookup.h"
-#include <QtTest/QTest>
-
-void AsyncCDDBLookupTest::testLookup()
-{
- using namespace KCDDB;
-
- client_ = new Client;
- client_->config().setHostname("freedb.freedb.org");
- client_->config().setPort(8880);
- client_->config().setCacheLookupEnabled(false);
- client_->config().setFreedbLookupEnabled(true);
- client_->config().setMusicBrainzLookupEnabled(false);
- client_->config().setFreedbLookupTransport(Lookup::CDDBP);
- client_->setBlockingMode( false );
-
- connect(client_,SIGNAL(finished(KCDDB::Result)),SLOT(slotFinished(KCDDB::Result)));
-
- TrackOffsetList list;
-
- // a1107d0a - Kruder & Dorfmeister - The K&D Sessions - Disc One.
- list
- << 150 // First track start.
- << 29462
- << 66983
- << 96785
- << 135628
- << 168676
- << 194147
- << 222158
- << 247076
- << 278203 // Last track start.
- << 316732; // Disc end.
-
- client_->lookup(list);
-
- m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
-
- delete client_;
-
- QVERIFY(m_result == Success);
-
- // If revision doesn't match, test probably needs to be updated
- // See: http://www.freedb.org/freedb/jazz/a1107d0a for updated data
- QCOMPARE(m_info.get("revision").toInt(), 7);
-
- QCOMPARE(m_info.get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.get(Title).toString(),QString("The K&D Sessions (Part One)"));
- QCOMPARE(m_info.get(Genre).toString(),QString("Trip-Hop"));
- QCOMPARE(m_info.get(Year).toInt(),1998);
- QCOMPARE(m_info.track(0).get(Title).toString(),QString("Roni Size - Heroes (Kruder's Long Loose Bossa remixed by Peter Kruder)"));
- QCOMPARE(m_info.track(1).get(Title).toString(),QString("Alex Reece - Jazz Master (K&D Session)"));
- QCOMPARE(m_info.track(2).get(Title).toString(),QString("Count Basic - Speechless (Drum 'n' Bass remixed by Peter Kruder)"));
- QCOMPARE(m_info.track(3).get(Title).toString(),QString("Rockers Hi-Fi - Going Under (K&D Session)"));
- QCOMPARE(m_info.track(4).get(Title).toString(),QString("Bomb The Bass - Bug Powder Dust (K&D Session)"));
- QCOMPARE(m_info.track(5).get(Title).toString(),QString("Aphrodelics - Rollin' On Chrome (Wild Motherfucker Dub remixed by Richard Dorfmeister)"));
- QCOMPARE(m_info.track(6).get(Title).toString(),QString("Depeche Mode - Useless (K&D Session)"));
- QCOMPARE(m_info.track(7).get(Title).toString(),QString("Count Basic - Gotta Jazz (remixed by Richard Dorfmeister)"));
- QCOMPARE(m_info.track(8).get(Title).toString(),QString("Rainer Truby Trio - Donaueschingen (Peter Kruder's Donaudampfschifffahrtsgesellschaftskapitnskajtenremix)"));
- QCOMPARE(m_info.track(9).get(Title).toString(),QString("Lamb - Trans Fatty Acid (K&D Session)"));
- QCOMPARE(m_info.track(0).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(1).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(2).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(3).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(4).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(5).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(6).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(7).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(8).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(9).get(Artist).toString(),QString("Kruder & Dorfmeister"));
-}
-
- void
-AsyncCDDBLookupTest::slotFinished(Result r)
-{
- m_result = r;
- qDebug() << "AsyncCDDBLookupTest::slotResult: Got " << KCDDB::resultToString(r);
-
- CDInfoList l = client_->lookupResponse();
-
- qDebug() << "AsyncCDDBLookupTest::slotResult: Item count: " << l.count();
-
- foreach(const CDInfo &i, l)
- {
- if (i.get("discid") == "a1107d0a" && i.get(Category) == "jazz")
- {
- qDebug() << "Found the CD";
- m_info = i;
- break;
- }
- }
-
- m_eventLoop.quit();
-}
-
-QTEST_GUILESS_MAIN(AsyncCDDBLookupTest)
diff --git a/test/asynchttplookuptest.cpp b/test/asynchttplookuptest.cpp
deleted file mode 100644
index 56a3f74..0000000
--- a/test/asynchttplookuptest.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- Copyright (C) 2006 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 "asynchttplookuptest.h"
-#include "libkcddb/cache.h"
-#include "libkcddb/lookup.h"
-#include <QtTest/QTest>
-
-void AsyncHTTPLookupTest::testLookup()
-{
- using namespace KCDDB;
-
- client_ = new Client;
- client_->config().setHostname("freedb.freedb.org");
- client_->config().setPort(80);
- client_->config().setCacheLookupEnabled(false);
- client_->config().setFreedbLookupEnabled(true);
- client_->config().setMusicBrainzLookupEnabled(false);
- client_->config().setFreedbLookupTransport(Lookup::HTTP);
- client_->setBlockingMode( false );
-
- connect(client_, SIGNAL(finished(KCDDB::Result)), SLOT(slotFinished(KCDDB::Result)));
-
- TrackOffsetList list;
-
- // a1107d0a - Kruder & Dorfmeister - The K&D Sessions - Disc One.
- list
- << 150 // First track start.
- << 29462
- << 66983
- << 96785
- << 135628
- << 168676
- << 194147
- << 222158
- << 247076
- << 278203 // Last track start.
- << 316732; // Disc end.
-
- client_->lookup(list);
-
- m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
-
- delete client_;
-
- QVERIFY(m_result == Success);
-
- // If revision doesn't match, test probably needs to be updated
- // See: http://www.freedb.org/freedb/jazz/a1107d0a for updated data
- QCOMPARE(m_info.get("revision").toInt(), 7);
-
- QCOMPARE(m_info.get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.get(Title).toString(),QString("The K&D Sessions (Part One)"));
- QCOMPARE(m_info.get(Genre).toString(),QString("Trip-Hop"));
- QCOMPARE(m_info.get(Year).toInt(),1998);
- QCOMPARE(m_info.track(0).get(Title).toString(),QString("Roni Size - Heroes (Kruder's Long Loose Bossa remixed by Peter Kruder)"));
- QCOMPARE(m_info.track(1).get(Title).toString(),QString("Alex Reece - Jazz Master (K&D Session)"));
- QCOMPARE(m_info.track(2).get(Title).toString(),QString("Count Basic - Speechless (Drum 'n' Bass remixed by Peter Kruder)"));
- QCOMPARE(m_info.track(3).get(Title).toString(),QString("Rockers Hi-Fi - Going Under (K&D Session)"));
- QCOMPARE(m_info.track(4).get(Title).toString(),QString("Bomb The Bass - Bug Powder Dust (K&D Session)"));
- QCOMPARE(m_info.track(5).get(Title).toString(),QString("Aphrodelics - Rollin' On Chrome (Wild Motherfucker Dub remixed by Richard Dorfmeister)"));
- QCOMPARE(m_info.track(6).get(Title).toString(),QString("Depeche Mode - Useless (K&D Session)"));
- QCOMPARE(m_info.track(7).get(Title).toString(),QString("Count Basic - Gotta Jazz (remixed by Richard Dorfmeister)"));
- QCOMPARE(m_info.track(8).get(Title).toString(),QString("Rainer Truby Trio - Donaueschingen (Peter Kruder's Donaudampfschifffahrtsgesellschaftskapitnskajtenremix)"));
- QCOMPARE(m_info.track(9).get(Title).toString(),QString("Lamb - Trans Fatty Acid (K&D Session)"));
- QCOMPARE(m_info.track(0).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(1).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(2).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(3).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(4).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(5).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(6).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(7).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(8).get(Artist).toString(),QString("Kruder & Dorfmeister"));
- QCOMPARE(m_info.track(9).get(Artist).toString(),QString("Kruder & Dorfmeister"));
-}
-
- void
-AsyncHTTPLookupTest::slotFinished(Result r)
-{
- m_result = r;
- qDebug() << "AsyncHTTPLookupTest::slotFinished: Got " << KCDDB::resultToString(r);
-
- CDInfoList l = client_->lookupResponse();
-
- qDebug() << "AsyncHTTPLookupTest::slotFinished: Item count: " << l.count();
-
- foreach(const CDInfo &i, l)
- {
- if (i.get("discid") == "a1107d0a" && i.get(Category) == "jazz")
- {
- qDebug() << "Found the CD";
- m_info = i;
- break;
- }
- }
-
- m_eventLoop.quit();
-}
-
-QTEST_GUILESS_MAIN(AsyncHTTPLookupTest)
diff --git a/test/CMakeLists.txt b/tests/CMakeLists.txt
index 2cb0633..63cc89b 100644
--- a/test/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,9 +1,8 @@
-
function(add_unit_tests)
foreach(test ${ARGN})
add_executable(${test} ${test}.cpp)
add_test( ${test} ${test} )
- target_link_libraries(${test} Qt5::Test kcddb)
+ target_link_libraries(${test} Qt5::Test KF5::Cddb)
endforeach()
endfunction()
diff --git a/tests/asynccddblookuptest.cpp b/tests/asynccddblookuptest.cpp
new file mode 100644
index 0000000..742c944
--- /dev/null
+++ b/tests/asynccddblookuptest.cpp
@@ -0,0 +1,117 @@
+/*
+ Copyright (C) 2006 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 "asynccddblookuptest.h"
+#include "libkcddb/cache.h"
+#include "libkcddb/lookup.h"
+#include <QtTest/QTest>
+
+void AsyncCDDBLookupTest::testLookup()
+{
+ using namespace KCDDB;
+
+ client_ = new Client;
+ client_->config().setHostname(QString::fromUtf8("freedb.freedb.org"));
+ client_->config().setPort(8880);
+ client_->config().setCacheLookupEnabled(false);
+ client_->config().setFreedbLookupEnabled(true);
+ client_->config().setMusicBrainzLookupEnabled(false);
+ client_->config().setFreedbLookupTransport(Lookup::CDDBP);
+ client_->setBlockingMode( false );
+
+ connect(client_,SIGNAL(finished(KCDDB::Result)),SLOT(slotFinished(KCDDB::Result)));
+
+ TrackOffsetList list;
+
+ // a1107d0a - Kruder & Dorfmeister - The K&D Sessions - Disc One.
+ list
+ << 150 // First track start.
+ << 29462
+ << 66983
+ << 96785
+ << 135628
+ << 168676
+ << 194147
+ << 222158
+ << 247076
+ << 278203 // Last track start.
+ << 316732; // Disc end.
+
+ client_->lookup(list);
+
+ m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
+
+ delete client_;
+
+ QVERIFY(m_result == Success);
+
+ // If revision doesn't match, test probably needs to be updated
+ // See: http://www.freedb.org/freedb/jazz/a1107d0a for updated data
+ QCOMPARE(m_info.get(QString::fromUtf8("revision")).toInt(), 7);
+
+ QCOMPARE(m_info.get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.get(Title).toString(),QString::fromUtf8("The K&D Sessions (Part One)"));
+ QCOMPARE(m_info.get(Genre).toString(),QString::fromUtf8("Trip-Hop"));
+ QCOMPARE(m_info.get(Year).toInt(),1998);
+ QCOMPARE(m_info.track(0).get(Title).toString(),QString::fromUtf8("Roni Size - Heroes (Kruder's Long Loose Bossa remixed by Peter Kruder)"));
+ QCOMPARE(m_info.track(1).get(Title).toString(),QString::fromUtf8("Alex Reece - Jazz Master (K&D Session)"));
+ QCOMPARE(m_info.track(2).get(Title).toString(),QString::fromUtf8("Count Basic - Speechless (Drum 'n' Bass remixed by Peter Kruder)"));
+ QCOMPARE(m_info.track(3).get(Title).toString(),QString::fromUtf8("Rockers Hi-Fi - Going Under (K&D Session)"));
+ QCOMPARE(m_info.track(4).get(Title).toString(),QString::fromUtf8("Bomb The Bass - Bug Powder Dust (K&D Session)"));
+ QCOMPARE(m_info.track(5).get(Title).toString(),QString::fromUtf8("Aphrodelics - Rollin' On Chrome (Wild Motherfucker Dub remixed by Richard Dorfmeister)"));
+ QCOMPARE(m_info.track(6).get(Title).toString(),QString::fromUtf8("Depeche Mode - Useless (K&D Session)"));
+ QCOMPARE(m_info.track(7).get(Title).toString(),QString::fromUtf8("Count Basic - Gotta Jazz (remixed by Richard Dorfmeister)"));
+ QCOMPARE(m_info.track(8).get(Title).toString(),QString::fromUtf8("Rainer Truby Trio - Donaueschingen (Peter Kruder's Donaudampfschifffahrtsgesellschaftskapitnskajtenremix)"));
+ QCOMPARE(m_info.track(9).get(Title).toString(),QString::fromUtf8("Lamb - Trans Fatty Acid (K&D Session)"));
+ QCOMPARE(m_info.track(0).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(1).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(2).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(3).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(4).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(5).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(6).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(7).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(8).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(9).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+}
+
+ void
+AsyncCDDBLookupTest::slotFinished(Result r)
+{
+ m_result = r;
+ qDebug() << "AsyncCDDBLookupTest::slotResult: Got " << KCDDB::resultToString(r);
+
+ CDInfoList l = client_->lookupResponse();
+
+ qDebug() << "AsyncCDDBLookupTest::slotResult: Item count: " << l.count();
+
+ foreach(const CDInfo &i, l)
+ {
+ if (i.get(QString::fromUtf8("discid")) == QString::fromUtf8("a1107d0a") && i.get(Category) == QString::fromUtf8("jazz"))
+ {
+ qDebug() << "Found the CD";
+ m_info = i;
+ break;
+ }
+ }
+
+ m_eventLoop.quit();
+}
+
+QTEST_GUILESS_MAIN(AsyncCDDBLookupTest)
diff --git a/test/asynccddblookuptest.h b/tests/asynccddblookuptest.h
index efa6fce..b665e4b 100644
--- a/test/asynccddblookuptest.h
+++ b/tests/asynccddblookuptest.h
@@ -22,15 +22,15 @@
#include <QEventLoop>
#include <QtCore/QObject>
-#include <libkcddb/client.h>
-#include <libkcddb/kcddb.h>
+#include <KCddb/Client>
+#include <KCddb/Kcddb>
using namespace KCDDB;
class AsyncCDDBLookupTest : public QObject
{
Q_OBJECT
- private slots:
+ private Q_SLOTS:
void testLookup();
void slotFinished(KCDDB::Result);
diff --git a/tests/asynchttplookuptest.cpp b/tests/asynchttplookuptest.cpp
new file mode 100644
index 0000000..de581f1
--- /dev/null
+++ b/tests/asynchttplookuptest.cpp
@@ -0,0 +1,118 @@
+/*
+ Copyright (C) 2006 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 "asynchttplookuptest.h"
+#include "libkcddb/cache.h"
+#include "libkcddb/lookup.h"
+#include <QtTest/QTest>
+
+void AsyncHTTPLookupTest::testLookup()
+{
+ using namespace KCDDB;
+
+ client_ = new Client;
+ client_->config().setHostname(QString::fromUtf8("freedb.freedb.org"));
+ client_->config().setPort(80);
+ client_->config().setCacheLookupEnabled(false);
+ client_->config().setFreedbLookupEnabled(true);
+ client_->config().setMusicBrainzLookupEnabled(false);
+ client_->config().setFreedbLookupTransport(Lookup::HTTP);
+ client_->setBlockingMode( false );
+
+ connect(client_, SIGNAL(finished(KCDDB::Result)), SLOT(slotFinished(KCDDB::Result)));
+
+ TrackOffsetList list;
+
+ // a1107d0a - Kruder & Dorfmeister - The K&D Sessions - Disc One.
+ list
+ << 150 // First track start.
+ << 29462
+ << 66983
+ << 96785
+ << 135628
+ << 168676
+ << 194147
+ << 222158
+ << 247076
+ << 278203 // Last track start.
+ << 316732; // Disc end.
+
+ client_->lookup(list);
+
+ m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
+
+ delete client_;
+
+ QVERIFY(m_result == Success);
+
+ // If revision doesn't match, test probably needs to be updated
+ // See: http://www.freedb.org/freedb/jazz/a1107d0a for updated data
+ QCOMPARE(m_info.get(QString::fromUtf8("revision")).toInt(), 7);
+
+ QCOMPARE(m_info.get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.get(Title).toString(),QString::fromUtf8("The K&D Sessions (Part One)"));
+ QCOMPARE(m_info.get(Genre).toString(),QString::fromUtf8("Trip-Hop"));
+ QCOMPARE(m_info.get(Year).toInt(),1998);
+ QCOMPARE(m_info.track(0).get(Title).toString(),QString::fromUtf8("Roni Size - Heroes (Kruder's Long Loose Bossa remixed by Peter Kruder)"));
+ QCOMPARE(m_info.track(1).get(Title).toString(),QString::fromUtf8("Alex Reece - Jazz Master (K&D Session)"));
+ QCOMPARE(m_info.track(2).get(Title).toString(),QString::fromUtf8("Count Basic - Speechless (Drum 'n' Bass remixed by Peter Kruder)"));
+ QCOMPARE(m_info.track(3).get(Title).toString(),QString::fromUtf8("Rockers Hi-Fi - Going Under (K&D Session)"));
+ QCOMPARE(m_info.track(4).get(Title).toString(),QString::fromUtf8("Bomb The Bass - Bug Powder Dust (K&D Session)"));
+ QCOMPARE(m_info.track(5).get(Title).toString(),QString::fromUtf8("Aphrodelics - Rollin' On Chrome (Wild Motherfucker Dub remixed by Richard Dorfmeister)"));
+ QCOMPARE(m_info.track(6).get(Title).toString(),QString::fromUtf8("Depeche Mode - Useless (K&D Session)"));
+ QCOMPARE(m_info.track(7).get(Title).toString(),QString::fromUtf8("Count Basic - Gotta Jazz (remixed by Richard Dorfmeister)"));
+ QCOMPARE(m_info.track(8).get(Title).toString(),QString::fromUtf8("Rainer Truby Trio - Donaueschingen (Peter Kruder's Donaudampfschifffahrtsgesellschaftskapitnskajtenremix)"));
+ QCOMPARE(m_info.track(9).get(Title).toString(),QString::fromUtf8("Lamb - Trans Fatty Acid (K&D Session)"));
+ QCOMPARE(m_info.track(0).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(1).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(2).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(3).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(4).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(5).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(6).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(7).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(8).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+ QCOMPARE(m_info.track(9).get(Artist).toString(),QString::fromUtf8("Kruder & Dorfmeister"));
+}
+
+ void
+AsyncHTTPLookupTest::slotFinished(Result r)
+{
+ m_result = r;
+ qDebug() << "AsyncHTTPLookupTest::slotFinished: Got " << KCDDB::resultToString(r);
+
+ CDInfoList l = client_->lookupResponse();
+
+ qDebug() << "AsyncHTTPLookupTest::slotFinished: Item count: " << l.count();
+
+ foreach(const CDInfo &i, l)
+ {
+ if (i.get(QString::fromUtf8("discid")) == QVariant(QString::fromUtf8("a1107d0a")) && i.get(Category) == QVariant(QString::fromUtf8("jazz")))
+ {
+ qDebug() << "Found the CD";
+ m_info = i;
+ break;
+ }
+ }
+
+ m_eventLoop.quit();
+}
+
+QTEST_GUILESS_MAIN(AsyncHTTPLookupTest)
diff --git a/test/asynchttplookuptest.h b/tests/asynchttplookuptest.h
index 1c92b42..9aed71c 100644
--- a/test/asynchttplookuptest.h
+++ b/tests/asynchttplookuptest.h
@@ -22,15 +22,15 @@
#include <QEventLoop>
#include <QtCore/QObject>
-#include <libkcddb/client.h>
-#include <libkcddb/kcddb.h>
+#include <KCddb/Client>
+#include <KCddb/Kcddb>
using namespace KCDDB;
class AsyncHTTPLookupTest : public QObject
{
Q_OBJECT
- private slots:
+ private Q_SLOTS:
void testLookup();
void slotFinished(KCDDB::Result);
diff --git a/test/asynchttpsubmittest.cpp b/tests/asynchttpsubmittest.cpp
index 4574872..7b2dddb 100644
--- a/test/asynchttpsubmittest.cpp
+++ b/tests/asynchttpsubmittest.cpp
@@ -44,20 +44,20 @@ AsyncHTTPSubmitTest::AsyncHTTPSubmitTest(QCoreApplication& app)
CDInfo cdInfo;
- cdInfo.set("discid", "3606ed05");
- cdInfo.set("revision", 4);
- cdInfo.set("title", "Bamse och Bronto");
- cdInfo.set("artist", "Musiksage");
- cdInfo.set("year", 2001);
- cdInfo.set("category", "misc");
- cdInfo.set("genre", "Barnsaga");
- cdInfo.set("extd", QString::fromUtf8("Berättare: Olof Thunberg"));
-
- cdInfo.track(0).set("title", "Bamses signaturmelodi");
- cdInfo.track(1).set("title","*");
- cdInfo.track(2).set("title", "Brummavisan");
- cdInfo.track(3).set("title", "*");
- cdInfo.track(4).set("title", QString::fromUtf8("Jätteödlan Bronto"));
+ cdInfo.set(QString::fromUtf8("discid"), QString::fromUtf8("3606ed05"));
+ cdInfo.set(QString::fromUtf8("revision"), 4);
+ cdInfo.set(QString::fromUtf8("title"), QString::fromUtf8("Bamse och Bronto"));
+ cdInfo.set(QString::fromUtf8("artist"), QString::fromUtf8("Musiksage"));
+ cdInfo.set(QString::fromUtf8("year"), 2001);
+ cdInfo.set(QString::fromUtf8("category"), QString::fromUtf8("misc"));
+ cdInfo.set(QString::fromUtf8("genre"), QString::fromUtf8("Barnsaga"));
+ cdInfo.set(QString::fromUtf8("extd"), QString::fromUtf8("Berättare: Olof Thunberg"));
+
+ cdInfo.track(0).set(QString::fromUtf8("title"), QString::fromUtf8("Bamses signaturmelodi"));
+ cdInfo.track(1).set(QString::fromUtf8("title"),QString::fromUtf8("*"));
+ cdInfo.track(2).set(QString::fromUtf8("title"), QString::fromUtf8("Brummavisan"));
+ cdInfo.track(3).set(QString::fromUtf8("title"), QString::fromUtf8("*"));
+ cdInfo.track(4).set(QString::fromUtf8("title"), QString::fromUtf8("Jätteödlan Bronto"));
connect(client_,SIGNAL(finished(KCDDB::Result)),SLOT(slotFinished(KCDDB::Result)));
@@ -75,7 +75,7 @@ AsyncHTTPSubmitTest::slotFinished(Result r)
int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- app.setApplicationName("libkcddb_test");
+ app.setApplicationName(QString::fromUtf8("libkcddb_test"));
new AsyncHTTPSubmitTest(app);
diff --git a/test/asynchttpsubmittest.h b/tests/asynchttpsubmittest.h
index 5f061b9..b376c8e 100644
--- a/test/asynchttpsubmittest.h
+++ b/tests/asynchttpsubmittest.h
@@ -21,7 +21,7 @@
#define TEST_H
#include <QtCore/QObject>
-#include <libkcddb/client.h>
+#include <KCddb/Client>
using namespace KCDDB;
@@ -34,7 +34,7 @@ class AsyncHTTPSubmitTest : public QObject
public:
AsyncHTTPSubmitTest(QCoreApplication& app);
- public slots:
+ public Q_SLOTS:
void slotFinished(KCDDB::Result);
diff --git a/test/asyncmusicbrainztest.cpp b/tests/asyncmusicbrainztest.cpp
index a9accba..5879a35 100644
--- a/test/asyncmusicbrainztest.cpp
+++ b/tests/asyncmusicbrainztest.cpp
@@ -72,7 +72,7 @@ void AsyncMusicBrainzTest::testLookup()
// See http://musicbrainz.org/release/dbb3e39a-4bea-4e32-a546-456654f30ca6.html for changes
QCOMPARE(m_info.numberOfTracks(),17);
- QCOMPARE(m_info.get(Artist).toString(),QString("Various Artists"));
+ QCOMPARE(m_info.get(Artist).toString(),QString::fromUtf8("Various Artists"));
QCOMPARE(m_info.get(Title).toString(),QString::fromUtf8("Definitivt 50 spänn 10"));
// genre not really supported for musicbrainz
QCOMPARE(m_info.get(Genre).toString(),QString());
diff --git a/test/asyncmusicbrainztest.h b/tests/asyncmusicbrainztest.h
index 6187a95..6b22522 100644
--- a/test/asyncmusicbrainztest.h
+++ b/tests/asyncmusicbrainztest.h
@@ -22,15 +22,15 @@
#include <QEventLoop>
#include <QtCore/QObject>
-#include <libkcddb/client.h>
-#include <libkcddb/kcddb.h>
+#include <KCddb/Client>
+#include <KCddb/Kcddb>
using namespace KCDDB;
class AsyncMusicBrainzTest : public QObject
{
Q_OBJECT
- private slots:
+ private Q_SLOTS:
void testLookup();
void slotFinished(KCDDB::Result);
diff --git a/test/asyncsmtpsubmittest.cpp b/tests/asyncsmtpsubmittest.cpp
index e99d879..ecb4ca0 100644
--- a/test/asyncsmtpsubmittest.cpp
+++ b/tests/asyncsmtpsubmittest.cpp
@@ -30,7 +30,7 @@ AsyncSMTPSubmitTest::AsyncSMTPSubmitTest(QCoreApplication& app)
client_ = new Client;
client_->config().setFreedbSubmitTransport(Submit::SMTP);
- client_->config().setSubmitAddress("test-submit@freedb.org");
+ client_->config().setSubmitAddress(QString::fromUtf8("test-submit@freedb.org"));
client_->setBlockingMode( false );
TrackOffsetList list;
@@ -45,20 +45,20 @@ AsyncSMTPSubmitTest::AsyncSMTPSubmitTest(QCoreApplication& app)
CDInfo cdInfo;
- cdInfo.set("discid", "3606ed05");
- cdInfo.set("revision", 4);
- cdInfo.set("title", "Bamse och Bronto");
- cdInfo.set("artist", "Musiksage");
- cdInfo.set("year", 2001);
- cdInfo.set("category", "misc");
- cdInfo.set("genre", "Barnsaga");
- cdInfo.set("extd", QString::fromUtf8("Berättare: Olof Thunberg"));
-
- cdInfo.track(0).set("title", "Bamses signaturmelodi");
- cdInfo.track(1).set("title","*");
- cdInfo.track(2).set("title", "Brummavisan");
- cdInfo.track(3).set("title", "*");
- cdInfo.track(4).set("title", QString::fromUtf8("Jätteödlan Bronto"));
+ cdInfo.set(QString::fromUtf8("discid"), QString::fromUtf8("3606ed05"));
+ cdInfo.set(QString::fromUtf8("revision"), 4);
+ cdInfo.set(QString::fromUtf8("title"), QString::fromUtf8("Bamse och Bronto"));
+ cdInfo.set(QString::fromUtf8("artist"), QString::fromUtf8("Musiksage"));
+ cdInfo.set(QString::fromUtf8("year"), 2001);
+ cdInfo.set(QString::fromUtf8("category"), QString::fromUtf8("misc"));
+ cdInfo.set(QString::fromUtf8("genre"), QString::fromUtf8("Barnsaga"));
+ cdInfo.set(QString::fromUtf8("extd"), QString::fromUtf8("Berättare: Olof Thunberg"));
+
+ cdInfo.track(0).set(QString::fromUtf8("title"), QString::fromUtf8("Bamses signaturmelodi"));
+ cdInfo.track(1).set(QString::fromUtf8("title"),QString::fromUtf8("*"));
+ cdInfo.track(2).set(QString::fromUtf8("title"), QString::fromUtf8("Brummavisan"));
+ cdInfo.track(3).set(QString::fromUtf8("title"), QString::fromUtf8("*"));
+ cdInfo.track(4).set(QString::fromUtf8("title"), QString::fromUtf8("Jätteödlan Bronto"));
connect(client_,SIGNAL(finished(KCDDB::Result)),SLOT(slotFinished(KCDDB::Result)));
@@ -76,7 +76,7 @@ AsyncSMTPSubmitTest::slotFinished(Result r)
int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- app.setApplicationName("libkcddb_test");
+ app.setApplicationName(QString::fromUtf8("libkcddb_test"));
new AsyncSMTPSubmitTest(app);
diff --git a/test/asyncsmtpsubmittest.h b/tests/asyncsmtpsubmittest.h
index 06b8801..bcf416a 100644
--- a/test/asyncsmtpsubmittest.h
+++ b/tests/asyncsmtpsubmittest.h
@@ -21,7 +21,7 @@
#define TEST_H
#include <QtCore/QObject>
-#include <libkcddb/client.h>
+#include <KCddb/Client>
using namespace KCDDB;
@@ -34,7 +34,7 @@ class AsyncSMTPSubmitTest : public QObject
public:
AsyncSMTPSubmitTest(QCoreApplication& app);
- public slots:
+ public Q_SLOTS:
void slotFinished(KCDDB::Result);
diff --git a/test/cachetest.cpp b/tests/cachetest.cpp
index 5ba43ca..d5db7f6 100644
--- a/test/cachetest.cpp
+++ b/tests/cachetest.cpp
@@ -30,7 +30,7 @@ using namespace KCDDB;
void CacheTest::initTestCase()
{
m_client = new Client;
- m_client->config().setCacheLocations(QStringList(QDir::homePath()+"/.cddbTest/"));
+ m_client->config().setCacheLocations(QStringList(QDir::homePath()+QString::fromUtf8("/.cddbTest/")));
// a1107d0a
m_list
@@ -58,7 +58,7 @@ void CacheTest::initTestCase()
void CacheTest::cleanupTestCase()
{
- QDir().rmdir(QDir::homePath()+"/.cddbTest/");
+ QDir().rmdir(QDir::homePath()+QString::fromUtf8("/.cddbTest/"));
}
bool CacheTest::verify(const QString& source, const QString& discid, const CDInfo& info)
@@ -68,7 +68,7 @@ bool CacheTest::verify(const QString& source, const QString& discid, const CDInf
CDInfoList results = Cache::lookup(m_list, m_client->config());
foreach(const CDInfo &newInfo, results)
{
- if (newInfo.get("source") == source && newInfo.get("discid").toString() == discid)
+ if (newInfo.get(QString::fromUtf8("source")) == source && newInfo.get(QString::fromUtf8("discid")).toString() == discid)
{
if (newInfo.get(Artist) != m_info.get(Artist))
continue;
@@ -94,38 +94,38 @@ bool CacheTest::verify(const QString& source, const QString& discid, const CDInf
void CacheTest::testFreedb()
{
CDInfo testInfo = m_info;
- testInfo.set("source", "freedb");
- testInfo.set("discid", "a1107d0a");
- testInfo.set("category", "misc");
+ testInfo.set(QString::fromUtf8("source"), QString::fromUtf8("freedb"));
+ testInfo.set(QString::fromUtf8("discid"), QString::fromUtf8("a1107d0a"));
+ testInfo.set(QString::fromUtf8("category"), QString::fromUtf8("misc"));
- QVERIFY(verify("freedb", "a1107d0a", testInfo));
+ QVERIFY(verify(QString::fromUtf8("freedb"), QString::fromUtf8("a1107d0a"), testInfo));
- QFile::remove(QDir::homePath()+"/.cddbTest/misc/a1107d0a");
- QDir().rmdir(QDir::homePath()+"/.cddbTest/misc/");
+ QFile::remove(QDir::homePath()+QString::fromUtf8("/.cddbTest/misc/a1107d0a"));
+ QDir().rmdir(QDir::homePath()+QString::fromUtf8("/.cddbTest/misc/"));
}
void CacheTest::testUser()
{
CDInfo testInfo = m_info;
- testInfo.set("source", "user");
+ testInfo.set(QString::fromUtf8("source"), QString::fromUtf8("user"));
- QVERIFY(verify("user", "a1107d0a", testInfo));
+ QVERIFY(verify(QString::fromUtf8("user"), QString::fromUtf8("a1107d0a"), testInfo));
- QFile::remove(QDir::homePath()+"/.cddbTest/user/a1107d0a");
- QDir().rmdir(QDir::homePath()+"/.cddbTest/user/");
+ QFile::remove(QDir::homePath()+QString::fromUtf8("/.cddbTest/user/a1107d0a"));
+ QDir().rmdir(QDir::homePath()+QString::fromUtf8("/.cddbTest/user/"));
}
void CacheTest::testMusicbrainz()
{
#ifdef HAVE_MUSICBRAINZ5
CDInfo testInfo = m_info;
- testInfo.set("source", "musicbrainz");
- testInfo.set("discid", "wdABQ7s86gS7eVmS74CCQ6KwPUI-");
+ testInfo.set(QString::fromUtf8("source"), QString::fromUtf8("musicbrainz"));
+ testInfo.set(QString::fromUtf8("discid"), QString::fromUtf8("wdABQ7s86gS7eVmS74CCQ6KwPUI-"));
- QVERIFY(verify("musicbrainz", "wdABQ7s86gS7eVmS74CCQ6KwPUI-", testInfo));
+ QVERIFY(verify(QString::fromUtf8("musicbrainz"), QString::fromUtf8("wdABQ7s86gS7eVmS74CCQ6KwPUI-"), testInfo));
- QFile::remove(QDir::homePath()+"/.cddbTest/musicbrainz/wdABQ7s86gS7eVmS74CCQ6KwPUI-");
- QDir().rmdir(QDir::homePath()+"/.cddbTest/musicbrainz/");
+ QFile::remove(QDir::homePath()+QString::fromUtf8("/.cddbTest/musicbrainz/wdABQ7s86gS7eVmS74CCQ6KwPUI-"));
+ QDir().rmdir(QDir::homePath()+QString::fromUtf8("/.cddbTest/musicbrainz/"));
#endif
}
diff --git a/test/cachetest.h b/tests/cachetest.h
index 1a67813..6a96753 100644
--- a/test/cachetest.h
+++ b/tests/cachetest.h
@@ -33,7 +33,7 @@ namespace KCDDB
class CacheTest : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void testFreedb();
diff --git a/test/cdinfotest.cpp b/tests/cdinfotest.cpp
index b5e510a..ce0c25b 100644
--- a/test/cdinfotest.cpp
+++ b/tests/cdinfotest.cpp
@@ -34,57 +34,57 @@ void CDInfoTest::testLongLines()
for (int i=0; i <= 100; i++)
{
- str.fill('A',10*i);
+ str.fill(QLatin1Char('A'),10*i);
info.set(Title, str);
- str.fill('B',10*i);
- str.append('\n');
+ str.fill(QLatin1Char('B'),10*i);
+ str.append(QLatin1Char('\n'));
info.set(Comment, str);
- str.fill('C',10*i);
+ str.fill(QLatin1Char('C'),10*i);
info.set(Artist, str);
- str.fill('D',10*i);
+ str.fill(QLatin1Char('D'),10*i);
info.set(Genre, str);
- str.fill('E',10*i);
+ str.fill(QLatin1Char('E'),10*i);
info.set(Length, str);
- str.fill('F',10*i);
- str.append('\n');
- info.set("custom", str);
- str.fill('G',10*i);
+ str.fill(QLatin1Char('F'),10*i);
+ str.append(QLatin1Char('\n'));
+ info.set(QString::fromUtf8("custom"), str);
+ str.fill(QLatin1Char('G'),10*i);
tinfo.set(Title, str);
- str.fill('H',10*i);
- str.append('\n');
- tinfo.set("custom", str);
+ str.fill(QLatin1Char('H'),10*i);
+ str.append(QLatin1Char('\n'));
+ tinfo.set(QString::fromUtf8("custom"), str);
QString data = info.toString();
QString submitData = info.toString(true);
CDInfo info2;
info2.load(data);
- str.fill('A',10*i);
+ str.fill(QLatin1Char('A'),10*i);
QCOMPARE(info2.get(Title).toString(), str);
- str.fill('B',10*i);
- str.append('\n');
+ str.fill(QLatin1Char('B'),10*i);
+ str.append(QLatin1Char('\n'));
QCOMPARE(info2.get(Comment).toString(), str);
- str.fill('C',10*i);
+ str.fill(QLatin1Char('C'),10*i);
QCOMPARE(info2.get(Artist).toString(), str);
- str.fill('D',10*i);
+ str.fill(QLatin1Char('D'),10*i);
if (i == 0)
- QCOMPARE(info2.get(Genre).toString(), QString("Unknown"));
+ QCOMPARE(info2.get(Genre).toString(), QString::fromUtf8("Unknown"));
else
QCOMPARE(info2.get(Genre).toString(), str);
- str.fill('E',10*i);
+ str.fill(QLatin1Char('E'),10*i);
QCOMPARE(info2.get(Length).toString(), str);
- str.fill('F',10*i);
- str.append('\n');
- QCOMPARE(info2.get("custom").toString(), str);
- str.fill('G',10*i);
+ str.fill(QLatin1Char('F'),10*i);
+ str.append(QLatin1Char('\n'));
+ QCOMPARE(info2.get(QString::fromUtf8("custom")).toString(), str);
+ str.fill(QLatin1Char('G'),10*i);
QCOMPARE(info2.track(0).get(Title).toString(), str);
const CDInfo info3(info2);
QCOMPARE(info3.track(0).get(Title).toString(), str);
- str.fill('H',10*i);
- str.append('\n');
- QCOMPARE(info2.track(0).get("custom").toString(), str);
+ str.fill(QLatin1Char('H'),10*i);
+ str.append(QLatin1Char('\n'));
+ QCOMPARE(info2.track(0).get(QString::fromUtf8("custom")).toString(), str);
- QVERIFY(!submitData.contains("CUSTOM"));
- QVERIFY(data.contains("CUSTOM"));
+ QVERIFY(!submitData.contains(QString::fromUtf8("CUSTOM")));
+ QVERIFY(data.contains(QString::fromUtf8("CUSTOM")));
}
}
diff --git a/test/cdinfotest.h b/tests/cdinfotest.h
index 70db442..2c1e963 100644
--- a/test/cdinfotest.h
+++ b/tests/cdinfotest.h
@@ -25,7 +25,7 @@
class CDInfoTest : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void testLongLines();
};
diff --git a/test/musicbrainztest-fulldate.cpp b/tests/musicbrainztest-fulldate.cpp
index d5f7677..8c553db 100644
--- a/test/musicbrainztest-fulldate.cpp
+++ b/tests/musicbrainztest-fulldate.cpp
@@ -89,43 +89,43 @@ void MusicBrainzTestFullDate::testLookup()
CDInfo i(response.first());
QCOMPARE(i.numberOfTracks(),30);
- QCOMPARE(i.get(Artist).toString(),QString("Troublemakers"));
- QCOMPARE(i.get(Title).toString(),QString("30"));
+ QCOMPARE(i.get(Artist).toString(),QString::fromUtf8("Troublemakers"));
+ QCOMPARE(i.get(Title).toString(),QString::fromUtf8("30"));
// genre not really supported for musicbrainz
QCOMPARE(i.get(Genre).toString(),QString());
QCOMPARE(i.get(Year).toInt(),2011);
- QCOMPARE(i.track(0).get(Title).toString(),QString("30"));
+ QCOMPARE(i.track(0).get(Title).toString(),QString::fromUtf8("30"));
QCOMPARE(i.track(1).get(Title).toString(),QString::fromUtf8("Staden Göteborg"));
QCOMPARE(i.track(2).get(Title).toString(),QString::fromUtf8("Lilla Blå"));
- QCOMPARE(i.track(3).get(Title).toString(),QString("Kleptoman"));
+ QCOMPARE(i.track(3).get(Title).toString(),QString::fromUtf8("Kleptoman"));
QCOMPARE(i.track(4).get(Title).toString(),QString::fromUtf8("Grogg å parabol"));
- QCOMPARE(i.track(5).get(Title).toString(),QString("Majorna brinner"));
+ QCOMPARE(i.track(5).get(Title).toString(),QString::fromUtf8("Majorna brinner"));
QCOMPARE(i.track(6).get(Title).toString(),QString::fromUtf8("Utan hjärta stannar Sverige"));
- QCOMPARE(i.track(7).get(Title).toString(),QString("Dom e efter mig"));
- QCOMPARE(i.track(8).get(Title).toString(),QString("Mammas flickor"));
- QCOMPARE(i.track(9).get(Title).toString(),QString("Handgranat"));
- QCOMPARE(i.track(10).get(Title).toString(),QString("Stenar o blod"));
- QCOMPARE(i.track(11).get(Title).toString(),QString("Enkel Berlin"));
- QCOMPARE(i.track(12).get(Title).toString(),QString("Dom ljuger"));
- QCOMPARE(i.track(13).get(Title).toString(),QString("Jobba"));
+ QCOMPARE(i.track(7).get(Title).toString(),QString::fromUtf8("Dom e efter mig"));
+ QCOMPARE(i.track(8).get(Title).toString(),QString::fromUtf8("Mammas flickor"));
+ QCOMPARE(i.track(9).get(Title).toString(),QString::fromUtf8("Handgranat"));
+ QCOMPARE(i.track(10).get(Title).toString(),QString::fromUtf8("Stenar o blod"));
+ QCOMPARE(i.track(11).get(Title).toString(),QString::fromUtf8("Enkel Berlin"));
+ QCOMPARE(i.track(12).get(Title).toString(),QString::fromUtf8("Dom ljuger"));
+ QCOMPARE(i.track(13).get(Title).toString(),QString::fromUtf8("Jobba"));
QCOMPARE(i.track(14).get(Title).toString(),QString::fromUtf8("Varför lyser inga stjärnor"));
- QCOMPARE(i.track(15).get(Title).toString(),QString("Partytrash"));
+ QCOMPARE(i.track(15).get(Title).toString(),QString::fromUtf8("Partytrash"));
QCOMPARE(i.track(16).get(Title).toString(),QString::fromUtf8("Förstod ingenting"));
QCOMPARE(i.track(17).get(Title).toString(),QString::fromUtf8("Bara om min älskade väntar"));
- QCOMPARE(i.track(18).get(Title).toString(),QString("Lillebror"));
- QCOMPARE(i.track(19).get(Title).toString(),QString("Skandaler"));
+ QCOMPARE(i.track(18).get(Title).toString(),QString::fromUtf8("Lillebror"));
+ QCOMPARE(i.track(19).get(Title).toString(),QString::fromUtf8("Skandaler"));
QCOMPARE(i.track(20).get(Title).toString(),QString::fromUtf8("Hjältarna skålar i blod"));
- QCOMPARE(i.track(21).get(Title).toString(),QString("Bomber o granater"));
+ QCOMPARE(i.track(21).get(Title).toString(),QString::fromUtf8("Bomber o granater"));
QCOMPARE(i.track(22).get(Title).toString(),QString::fromUtf8("Vill du bli miljonär"));
QCOMPARE(i.track(23).get(Title).toString(),QString::fromUtf8("Stjärnorna kvittar det lika"));
- QCOMPARE(i.track(24).get(Title).toString(),QString("Naken"));
+ QCOMPARE(i.track(24).get(Title).toString(),QString::fromUtf8("Naken"));
QCOMPARE(i.track(25).get(Title).toString(),QString::fromUtf8("Månen lyser klar"));
- QCOMPARE(i.track(26).get(Title).toString(),QString("Vild o vacker"));
- QCOMPARE(i.track(27).get(Title).toString(),QString("Jag fryser"));
- QCOMPARE(i.track(28).get(Title).toString(),QString("Ein zwei polizei"));
+ QCOMPARE(i.track(26).get(Title).toString(),QString::fromUtf8("Vild o vacker"));
+ QCOMPARE(i.track(27).get(Title).toString(),QString::fromUtf8("Jag fryser"));
+ QCOMPARE(i.track(28).get(Title).toString(),QString::fromUtf8("Ein zwei polizei"));
QCOMPARE(i.track(29).get(Title).toString(),QString::fromUtf8("Jävla idiot"));
for (int j=0; j < 30; j++)
- QCOMPARE(i.track(j).get(Artist).toString(),QString("Troublemakers"));
+ QCOMPARE(i.track(j).get(Artist).toString(),QString::fromUtf8("Troublemakers"));
// comments not supported in a simple way
for (int j=0; j < 19; j++)
QCOMPARE(i.track(j).get(Comment).toString(),QString());
diff --git a/test/musicbrainztest-fulldate.h b/tests/musicbrainztest-fulldate.h
index 9f9cf01..8a82fb7 100644
--- a/test/musicbrainztest-fulldate.h
+++ b/tests/musicbrainztest-fulldate.h
@@ -25,7 +25,7 @@
class MusicBrainzTestFullDate : public QObject
{
Q_OBJECT
- private slots:
+ private Q_SLOTS:
void testLookup();
};
diff --git a/test/musicbrainztest-severaldiscs.cpp b/tests/musicbrainztest-severaldiscs.cpp
index 5964c6a..109d598 100644
--- a/test/musicbrainztest-severaldiscs.cpp
+++ b/tests/musicbrainztest-severaldiscs.cpp
@@ -79,37 +79,37 @@ void MusicBrainzTestSeveralDiscs::testLookup()
CDInfo i(response.first());
QCOMPARE(i.numberOfTracks(),20);
- QCOMPARE(i.get(Artist).toString(),QString("Billy Bragg"));
- QCOMPARE(i.get(Title).toString(),QString("Must I Paint You a Picture? The Essential Billy Bragg (disc 2)"));
+ QCOMPARE(i.get(Artist).toString(),QString::fromUtf8("Billy Bragg"));
+ QCOMPARE(i.get(Title).toString(),QString::fromUtf8("Must I Paint You a Picture? The Essential Billy Bragg (disc 2)"));
// genre not really supported for musicbrainz
QCOMPARE(i.get(Genre).toString(),QString());
QCOMPARE(i.get(Year).toInt(),2003);
- QCOMPARE(i.track(0).get(Title).toString(),QString("Sexuality"));
- QCOMPARE(i.track(1).get(Title).toString(),QString("Cindy of 1000 Lives"));
- QCOMPARE(i.track(2).get(Title).toString(),QString("Moving the Goalposts"));
- QCOMPARE(i.track(3).get(Title).toString(),QString("Tank Park Salute"));
- QCOMPARE(i.track(4).get(Title).toString(),QString("You Woke Up My Neighbourhood"));
- QCOMPARE(i.track(5).get(Title).toString(),QString("Accident Waiting to Happen (Red Stars version)"));
- QCOMPARE(i.track(6).get(Title).toString(),QString("Sulk"));
- QCOMPARE(i.track(7).get(Title).toString(),QString("Upfield"));
- QCOMPARE(i.track(8).get(Title).toString(),QString("The Fourteenth of February"));
- QCOMPARE(i.track(9).get(Title).toString(),QString("Brickbat"));
- QCOMPARE(i.track(10).get(Title).toString(),QString("The Space Race Is Over"));
- QCOMPARE(i.track(11).get(Title).toString(),QString("The Boy Done Good"));
- QCOMPARE(i.track(12).get(Title).toString(),QString("Ingrid Bergman"));
- QCOMPARE(i.track(13).get(Title).toString(),QString("Way Over Yonder in the Minor Key"));
- QCOMPARE(i.track(14).get(Title).toString(),QString("My Flying Saucer"));
- QCOMPARE(i.track(15).get(Title).toString(),QString("All You Fascists Bound to Lose (Blokes version)"));
- QCOMPARE(i.track(16).get(Title).toString(),QString("NPWA"));
- QCOMPARE(i.track(17).get(Title).toString(),QString("St. Monday"));
- QCOMPARE(i.track(18).get(Title).toString(),QString("Somedays I See the Point"));
- QCOMPARE(i.track(19).get(Title).toString(),QString("Take Down the Union Jack (Band version)"));
+ QCOMPARE(i.track(0).get(Title).toString(),QString::fromUtf8("Sexuality"));
+ QCOMPARE(i.track(1).get(Title).toString(),QString::fromUtf8("Cindy of 1000 Lives"));
+ QCOMPARE(i.track(2).get(Title).toString(),QString::fromUtf8("Moving the Goalposts"));
+ QCOMPARE(i.track(3).get(Title).toString(),QString::fromUtf8("Tank Park Salute"));
+ QCOMPARE(i.track(4).get(Title).toString(),QString::fromUtf8("You Woke Up My Neighbourhood"));
+ QCOMPARE(i.track(5).get(Title).toString(),QString::fromUtf8("Accident Waiting to Happen (Red Stars version)"));
+ QCOMPARE(i.track(6).get(Title).toString(),QString::fromUtf8("Sulk"));
+ QCOMPARE(i.track(7).get(Title).toString(),QString::fromUtf8("Upfield"));
+ QCOMPARE(i.track(8).get(Title).toString(),QString::fromUtf8("The Fourteenth of February"));
+ QCOMPARE(i.track(9).get(Title).toString(),QString::fromUtf8("Brickbat"));
+ QCOMPARE(i.track(10).get(Title).toString(),QString::fromUtf8("The Space Race Is Over"));
+ QCOMPARE(i.track(11).get(Title).toString(),QString::fromUtf8("The Boy Done Good"));
+ QCOMPARE(i.track(12).get(Title).toString(),QString::fromUtf8("Ingrid Bergman"));
+ QCOMPARE(i.track(13).get(Title).toString(),QString::fromUtf8("Way Over Yonder in the Minor Key"));
+ QCOMPARE(i.track(14).get(Title).toString(),QString::fromUtf8("My Flying Saucer"));
+ QCOMPARE(i.track(15).get(Title).toString(),QString::fromUtf8("All You Fascists Bound to Lose (Blokes version)"));
+ QCOMPARE(i.track(16).get(Title).toString(),QString::fromUtf8("NPWA"));
+ QCOMPARE(i.track(17).get(Title).toString(),QString::fromUtf8("St. Monday"));
+ QCOMPARE(i.track(18).get(Title).toString(),QString::fromUtf8("Somedays I See the Point"));
+ QCOMPARE(i.track(19).get(Title).toString(),QString::fromUtf8("Take Down the Union Jack (Band version)"));
for (int j=0; j < 12; j++)
- QCOMPARE(i.track(j).get(Artist).toString(),QString("Billy Bragg"));
+ QCOMPARE(i.track(j).get(Artist).toString(),QString::fromUtf8("Billy Bragg"));
for (int j=12; j < 15; j++)
- QCOMPARE(i.track(j).get(Artist).toString(),QString("Billy Bragg & Wilco"));
+ QCOMPARE(i.track(j).get(Artist).toString(),QString::fromUtf8("Billy Bragg & Wilco"));
for (int j=15; j < 20; j++)
- QCOMPARE(i.track(j).get(Artist).toString(),QString("Billy Bragg and The Blokes"));
+ QCOMPARE(i.track(j).get(Artist).toString(),QString::fromUtf8("Billy Bragg and The Blokes"));
// comments not supported in a simple way
for (int j=0; j < 19; j++)
QCOMPARE(i.track(j).get(Comment).toString(),QString());
diff --git a/test/musicbrainztest-severaldiscs.h b/tests/musicbrainztest-severaldiscs.h
index f792f5d..3435725 100644
--- a/test/musicbrainztest-severaldiscs.h
+++ b/tests/musicbrainztest-severaldiscs.h
@@ -25,7 +25,7 @@
class MusicBrainzTestSeveralDiscs : public QObject
{
Q_OBJECT
- private slots:
+ private Q_SLOTS:
void testLookup();
};
diff --git a/test/musicbrainztest.cpp b/tests/musicbrainztest.cpp
index 540de5d..4503f47 100644
--- a/test/musicbrainztest.cpp
+++ b/tests/musicbrainztest.cpp
@@ -74,25 +74,25 @@ void MusicBrainzTest::testLookup()
CDInfo i(response.first());
QCOMPARE(i.numberOfTracks(),14);
- QCOMPARE(i.get(Artist).toString(),QString("The Liptones"));
- QCOMPARE(i.get(Title).toString(),QString("The Latest News"));
+ QCOMPARE(i.get(Artist).toString(),QString::fromUtf8("The Liptones"));
+ QCOMPARE(i.get(Title).toString(),QString::fromUtf8("The Latest News"));
// genre not really supported for musicbrainz
QCOMPARE(i.get(Genre).toString(),QString());
QCOMPARE(i.get(Year).toInt(),2002);
- QCOMPARE(i.track(0).get(Title).toString(),QString("Jungle Heat"));
- QCOMPARE(i.track(1).get(Title).toString(),QString("It's All I Hear You Say"));
- QCOMPARE(i.track(2).get(Title).toString(),QString("Girl for Tonight"));
- QCOMPARE(i.track(3).get(Title).toString(),QString("Shoot Em Down"));
- QCOMPARE(i.track(4).get(Title).toString(),QString("Beautiful Day"));
- QCOMPARE(i.track(5).get(Title).toString(),QString("Paranoia"));
- QCOMPARE(i.track(6).get(Title).toString(),QString("My Way"));
- QCOMPARE(i.track(7).get(Title).toString(),QString("Dressed in Pink"));
- QCOMPARE(i.track(8).get(Title).toString(),QString("No Way Out"));
- QCOMPARE(i.track(9).get(Title).toString(),QString("Strange Kind of Justice"));
- QCOMPARE(i.track(10).get(Title).toString(),QString("Waiting Til Midnight"));
- QCOMPARE(i.track(11).get(Title).toString(),QString("Liptones"));
- QCOMPARE(i.track(12).get(Title).toString(),QString("Out With the Boys"));
- QCOMPARE(i.track(13).get(Title).toString(),QString("Free Like a Bird"));
+ QCOMPARE(i.track(0).get(Title).toString(),QString::fromUtf8("Jungle Heat"));
+ QCOMPARE(i.track(1).get(Title).toString(),QString::fromUtf8("It's All I Hear You Say"));
+ QCOMPARE(i.track(2).get(Title).toString(),QString::fromUtf8("Girl for Tonight"));
+ QCOMPARE(i.track(3).get(Title).toString(),QString::fromUtf8("Shoot Em Down"));
+ QCOMPARE(i.track(4).get(Title).toString(),QString::fromUtf8("Beautiful Day"));
+ QCOMPARE(i.track(5).get(Title).toString(),QString::fromUtf8("Paranoia"));
+ QCOMPARE(i.track(6).get(Title).toString(),QString::fromUtf8("My Way"));
+ QCOMPARE(i.track(7).get(Title).toString(),QString::fromUtf8("Dressed in Pink"));
+ QCOMPARE(i.track(8).get(Title).toString(),QString::fromUtf8("No Way Out"));
+ QCOMPARE(i.track(9).get(Title).toString(),QString::fromUtf8("Strange Kind of Justice"));
+ QCOMPARE(i.track(10).get(Title).toString(),QString::fromUtf8("Waiting Til Midnight"));
+ QCOMPARE(i.track(11).get(Title).toString(),QString::fromUtf8("Liptones"));
+ QCOMPARE(i.track(12).get(Title).toString(),QString::fromUtf8("Out With the Boys"));
+ QCOMPARE(i.track(13).get(Title).toString(),QString::fromUtf8("Free Like a Bird"));
// comments not supported in a simple way
for (int j=0; j < 14; j++)
QCOMPARE(i.track(j).get(Comment).toString(),QString());
diff --git a/test/musicbrainztest.h b/tests/musicbrainztest.h
index 0a8ec21..079f450 100644
--- a/test/musicbrainztest.h
+++ b/tests/musicbrainztest.h
@@ -25,7 +25,7 @@
class MusicBrainzTest : public QObject
{
Q_OBJECT
- private slots:
+ private Q_SLOTS:
void testLookup();
};
diff --git a/test/sitestest.cpp b/tests/sitestest.cpp
index e5aeeed..bab5524 100644
--- a/test/sitestest.cpp
+++ b/tests/sitestest.cpp
@@ -27,7 +27,7 @@
main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- app.setApplicationName("libkcddb_test");
+ app.setApplicationName(QString::fromUtf8("libkcddb_test"));
using namespace KCDDB;
diff --git a/test/synccddblookuptest.cpp b/tests/synccddblookuptest.cpp
index 2a73929..9e240b8 100644
--- a/test/synccddblookuptest.cpp
+++ b/tests/synccddblookuptest.cpp
@@ -28,7 +28,7 @@ void SyncCDDBLookupTest::testLookup()
using namespace KCDDB;
Client c;
- c.config().setHostname("freedb.freedb.org");
+ c.config().setHostname(QString::fromUtf8("freedb.freedb.org"));
c.config().setPort(8880);
c.config().setCacheLookupEnabled(false);
c.config().setFreedbLookupEnabled(true);
@@ -59,29 +59,29 @@ void SyncCDDBLookupTest::testLookup()
{
CDInfo i(*it);
- if (i.get("discid") == "3e0c3a05" && i.get(Category) == "misc")
+ if (i.get(QString::fromUtf8("discid")) == QString::fromUtf8("3e0c3a05") && i.get(Category) == QString::fromUtf8("misc"))
{
// If revision doesn't match, test probably needs to be updated
// See: http://www.freedb.org/freedb/misc/3e0c3a05 for updated data
- QCOMPARE(i.get("revision").toInt(), 17);
+ QCOMPARE(i.get(QString::fromUtf8("revision")).toInt(), 17);
- QCOMPARE(i.get(Artist).toString(),QString("Pink Floyd"));
- QCOMPARE(i.get(Title).toString(),QString("Atom Heart Mother"));
- QCOMPARE(i.get(Genre).toString(),QString("Psychedelic Rock"));
+ QCOMPARE(i.get(Artist).toString(),QString::fromUtf8("Pink Floyd"));
+ QCOMPARE(i.get(Title).toString(),QString::fromUtf8("Atom Heart Mother"));
+ QCOMPARE(i.get(Genre).toString(),QString::fromUtf8("Psychedelic Rock"));
QCOMPARE(i.get(Year).toInt(),1970);
- QCOMPARE(i.track(0).get(Title).toString(),QString("Atom Heart Mother: Father's Shout/Breast Milky/Mother Fore/Funky Dung/Mind Your Throats Please/Remergence"));
- QCOMPARE(i.track(1).get(Title).toString(),QString("If"));
- QCOMPARE(i.track(2).get(Title).toString(),QString("Summer '68"));
- QCOMPARE(i.track(3).get(Title).toString(),QString("Fat Old Sun"));
- QCOMPARE(i.track(4).get(Title).toString(),QString("Alan's Psychedelic Breakfast: Rise and Shine/Sunny Side Up/Morning Glory"));
- QCOMPARE(i.track(0).get(Comment).toString(),QString(""));
- QCOMPARE(i.track(1).get(Comment).toString(),QString(""));
- QCOMPARE(i.track(2).get(Comment).toString(),QString(""));
- QCOMPARE(i.track(3).get(Comment).toString(),QString(""));
- QCOMPARE(i.track(4).get(Comment).toString(),QString(""));
+ QCOMPARE(i.track(0).get(Title).toString(),QString::fromUtf8("Atom Heart Mother: Father's Shout/Breast Milky/Mother Fore/Funky Dung/Mind Your Throats Please/Remergence"));
+ QCOMPARE(i.track(1).get(Title).toString(),QString::fromUtf8("If"));
+ QCOMPARE(i.track(2).get(Title).toString(),QString::fromUtf8("Summer '68"));
+ QCOMPARE(i.track(3).get(Title).toString(),QString::fromUtf8("Fat Old Sun"));
+ QCOMPARE(i.track(4).get(Title).toString(),QString::fromUtf8("Alan's Psychedelic Breakfast: Rise and Shine/Sunny Side Up/Morning Glory"));
+ QCOMPARE(i.track(0).get(Comment).toString(),QString::fromUtf8(""));
+ QCOMPARE(i.track(1).get(Comment).toString(),QString::fromUtf8(""));
+ QCOMPARE(i.track(2).get(Comment).toString(),QString::fromUtf8(""));
+ QCOMPARE(i.track(3).get(Comment).toString(),QString::fromUtf8(""));
+ QCOMPARE(i.track(4).get(Comment).toString(),QString::fromUtf8(""));
for (int j=0; j <= 4; j++)
{
- QCOMPARE(i.track(j).get(Artist).toString(),QString("Pink Floyd"));
+ QCOMPARE(i.track(j).get(Artist).toString(),QString::fromUtf8("Pink Floyd"));
}
hasRunTest = true;
diff --git a/test/synccddblookuptest.h b/tests/synccddblookuptest.h
index 7687464..401154b 100644
--- a/test/synccddblookuptest.h
+++ b/tests/synccddblookuptest.h
@@ -25,7 +25,7 @@
class SyncCDDBLookupTest : public QObject
{
Q_OBJECT
- private slots:
+ private Q_SLOTS:
void testLookup();
};
diff --git a/test/synchttplookuptest.cpp b/tests/synchttplookuptest.cpp
index f93120c..068f5a0 100644
--- a/test/synchttplookuptest.cpp
+++ b/tests/synchttplookuptest.cpp
@@ -28,7 +28,7 @@ void SyncHTTPLookupTest::testLookup()
using namespace KCDDB;
Client c;
- c.config().setHostname("freedb.freedb.org");
+ c.config().setHostname(QString::fromUtf8("freedb.freedb.org"));
c.config().setPort(80);
c.config().setCacheLookupEnabled(false);
c.config().setFreedbLookupEnabled(true);
@@ -59,29 +59,29 @@ void SyncHTTPLookupTest::testLookup()
{
CDInfo i(*it);
- if (i.get("discid") == "3e0c3a05" && i.get(Category) == "misc")
+ if (i.get(QString::fromUtf8("discid")) == QString::fromUtf8("3e0c3a05") && i.get(Category) == QString::fromUtf8("misc"))
{
// If revision doesn't match, test probably needs to be updated
// See: http://www.freedb.org/freedb/misc/3e0c3a05 for updated data
- QCOMPARE(i.get("revision").toInt(), 17);
+ QCOMPARE(i.get(QString::fromUtf8("revision")).toInt(), 17);
- QCOMPARE(i.get(Artist).toString(),QString("Pink Floyd"));
- QCOMPARE(i.get(Title).toString(),QString("Atom Heart Mother"));
- QCOMPARE(i.get(Genre).toString(),QString("Psychedelic Rock"));
+ QCOMPARE(i.get(Artist).toString(),QString::fromUtf8("Pink Floyd"));
+ QCOMPARE(i.get(Title).toString(),QString::fromUtf8("Atom Heart Mother"));
+ QCOMPARE(i.get(Genre).toString(),QString::fromUtf8("Psychedelic Rock"));
QCOMPARE(i.get(Year).toInt(),1970);
- QCOMPARE(i.track(0).get(Title).toString(),QString("Atom Heart Mother: Father's Shout/Breast Milky/Mother Fore/Funky Dung/Mind Your Throats Please/Remergence"));
- QCOMPARE(i.track(1).get(Title).toString(),QString("If"));
- QCOMPARE(i.track(2).get(Title).toString(),QString("Summer '68"));
- QCOMPARE(i.track(3).get(Title).toString(),QString("Fat Old Sun"));
- QCOMPARE(i.track(4).get(Title).toString(),QString("Alan's Psychedelic Breakfast: Rise and Shine/Sunny Side Up/Morning Glory"));
- QCOMPARE(i.track(0).get(Comment).toString(),QString(""));
- QCOMPARE(i.track(1).get(Comment).toString(),QString(""));
- QCOMPARE(i.track(2).get(Comment).toString(),QString(""));
- QCOMPARE(i.track(3).get(Comment).toString(),QString(""));
- QCOMPARE(i.track(4).get(Comment).toString(),QString(""));
+ QCOMPARE(i.track(0).get(Title).toString(),QString::fromUtf8("Atom Heart Mother: Father's Shout/Breast Milky/Mother Fore/Funky Dung/Mind Your Throats Please/Remergence"));
+ QCOMPARE(i.track(1).get(Title).toString(),QString::fromUtf8("If"));
+ QCOMPARE(i.track(2).get(Title).toString(),QString::fromUtf8("Summer '68"));
+ QCOMPARE(i.track(3).get(Title).toString(),QString::fromUtf8("Fat Old Sun"));
+ QCOMPARE(i.track(4).get(Title).toString(),QString::fromUtf8("Alan's Psychedelic Breakfast: Rise and Shine/Sunny Side Up/Morning Glory"));
+ QCOMPARE(i.track(0).get(Comment).toString(),QString::fromUtf8(""));
+ QCOMPARE(i.track(1).get(Comment).toString(),QString::fromUtf8(""));
+ QCOMPARE(i.track(2).get(Comment).toString(),QString::fromUtf8(""));
+ QCOMPARE(i.track(3).get(Comment).toString(),QString::fromUtf8(""));
+ QCOMPARE(i.track(4).get(Comment).toString(),QString::fromUtf8(""));
for (int j=0; j <= 4; j++)
{
- QCOMPARE(i.track(j).get(Artist).toString(),QString("Pink Floyd"));
+ QCOMPARE(i.track(j).get(Artist).toString(),QString::fromUtf8("Pink Floyd"));
}
hasRunTest = true;
diff --git a/test/synchttplookuptest.h b/tests/synchttplookuptest.h
index 8a12b31..6604ff1 100644
--- a/test/synchttplookuptest.h
+++ b/tests/synchttplookuptest.h
@@ -25,7 +25,7 @@
class SyncHTTPLookupTest : public QObject
{
Q_OBJECT
- private slots:
+ private Q_SLOTS:
void testLookup();
};
diff --git a/test/synchttpsubmittest.cpp b/tests/synchttpsubmittest.cpp
index d247b1e..fb78839 100644
--- a/test/synchttpsubmittest.cpp
+++ b/tests/synchttpsubmittest.cpp
@@ -28,7 +28,7 @@
main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- app.setApplicationName("libkcddb_test");
+ app.setApplicationName(QString::fromUtf8("libkcddb_test"));
using namespace KCDDB;
@@ -44,20 +44,20 @@ main(int argc, char ** argv)
CDInfo cdInfo;
- cdInfo.set("discid", "3606ed05");
- cdInfo.set("revision", 4);
- cdInfo.set("title", "Bamse och Bronto");
- cdInfo.set("artist", "Musiksage");
- cdInfo.set("year", 2001);
- cdInfo.set("category", "misc");
- cdInfo.set("genre", "Barnsaga");
- cdInfo.set("extd", QString::fromUtf8("Berättare: Olof Thunberg"));
-
- cdInfo.track(0).set("title", "Bamses signaturmelodi");
- cdInfo.track(1).set("title","*");
- cdInfo.track(2).set("title", "Brummavisan");
- cdInfo.track(3).set("title", "*");
- cdInfo.track(4).set("title", QString::fromUtf8("Jätteödlan Bronto"));
+ cdInfo.set(QString::fromUtf8("discid"), QString::fromUtf8("3606ed05"));
+ cdInfo.set(QString::fromUtf8("revision"), 4);
+ cdInfo.set(QString::fromUtf8("title"), QString::fromUtf8("Bamse och Bronto"));
+ cdInfo.set(QString::fromUtf8("artist"), QString::fromUtf8("Musiksage"));
+ cdInfo.set(QString::fromUtf8("year"), 2001);
+ cdInfo.set(QString::fromUtf8("category"), QString::fromUtf8("misc"));
+ cdInfo.set(QString::fromUtf8("genre"), QString::fromUtf8("Barnsaga"));
+ cdInfo.set(QString::fromUtf8("extd"), QString::fromUtf8("Berättare: Olof Thunberg"));
+
+ cdInfo.track(0).set(QString::fromUtf8("title"), QString::fromUtf8("Bamses signaturmelodi"));
+ cdInfo.track(1).set(QString::fromUtf8("title"),QString::fromUtf8("*"));
+ cdInfo.track(2).set(QString::fromUtf8("title"), QString::fromUtf8("Brummavisan"));
+ cdInfo.track(3).set(QString::fromUtf8("title"), QString::fromUtf8("*"));
+ cdInfo.track(4).set(QString::fromUtf8("title"), QString::fromUtf8("Jätteödlan Bronto"));
Client c;
c.config().setFreedbSubmitTransport(Submit::HTTP);
diff --git a/test/syncsmtpsubmittest.cpp b/tests/syncsmtpsubmittest.cpp
index 2aca5ae..e02c8de 100644
--- a/test/syncsmtpsubmittest.cpp
+++ b/tests/syncsmtpsubmittest.cpp
@@ -28,7 +28,7 @@
main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- app.setApplicationName("libkcddb_test");
+ app.setApplicationName(QString::fromUtf8("libkcddb_test"));
using namespace KCDDB;
@@ -44,24 +44,24 @@ main(int argc, char ** argv)
CDInfo cdInfo;
- cdInfo.set("discid", "3606ed05");
- cdInfo.set("revision", 4);
- cdInfo.set("title", "Bamse och Bronto");
- cdInfo.set("artist", "Musiksage");
- cdInfo.set("year", 2001);
- cdInfo.set("category", "misc");
- cdInfo.set("genre", "Barnsaga");
- cdInfo.set("extd", QString::fromUtf8("Berättare: Olof Thunberg"));
-
- cdInfo.track(0).set("title", "Bamses signaturmelodi");
- cdInfo.track(1).set("title","*");
- cdInfo.track(2).set("title", "Brummavisan");
- cdInfo.track(3).set("title", "*");
- cdInfo.track(4).set("title", QString::fromUtf8("Jätteödlan Bronto"));
+ cdInfo.set(QString::fromUtf8("discid"), QString::fromUtf8("3606ed05"));
+ cdInfo.set(QString::fromUtf8("revision"), 4);
+ cdInfo.set(QString::fromUtf8("title"), QString::fromUtf8("Bamse och Bronto"));
+ cdInfo.set(QString::fromUtf8("artist"), QString::fromUtf8("Musiksage"));
+ cdInfo.set(QString::fromUtf8("year"), 2001);
+ cdInfo.set(QString::fromUtf8("category"), QString::fromUtf8("misc"));
+ cdInfo.set(QString::fromUtf8("genre"), QString::fromUtf8("Barnsaga"));
+ cdInfo.set(QString::fromUtf8("extd"), QString::fromUtf8("Berättare: Olof Thunberg"));
+
+ cdInfo.track(0).set(QString::fromUtf8("title"), QString::fromUtf8("Bamses signaturmelodi"));
+ cdInfo.track(1).set(QString::fromUtf8("title"),QString::fromUtf8("*"));
+ cdInfo.track(2).set(QString::fromUtf8("title"), QString::fromUtf8("Brummavisan"));
+ cdInfo.track(3).set(QString::fromUtf8("title"), QString::fromUtf8("*"));
+ cdInfo.track(4).set(QString::fromUtf8("title"), QString::fromUtf8("Jätteödlan Bronto"));
Client c;
c.config().setFreedbSubmitTransport(Submit::SMTP);
- c.config().setSubmitAddress("test-submit@freedb.org");
+ c.config().setSubmitAddress(QString::fromUtf8("test-submit@freedb.org"));
c.setBlockingMode( true );
diff --git a/test/utf8test.cpp b/tests/utf8test.cpp
index 2f27146..8f7f37c 100644
--- a/test/utf8test.cpp
+++ b/tests/utf8test.cpp
@@ -28,7 +28,7 @@ void Utf8Test::testLookup()
using namespace KCDDB;
Client c;
- c.config().setHostname("freedb.freedb.org");
+ c.config().setHostname(QString::fromUtf8("freedb.freedb.org"));
c.config().setPort(80);
c.config().setCacheLookupEnabled(false);
c.config().setFreedbLookupEnabled(true);
@@ -54,22 +54,22 @@ void Utf8Test::testLookup()
{
CDInfo i(*it);
- if (i.get("discid") == "13093f02" && i.get(Category) == "blues")
+ if (i.get(QString::fromUtf8("discid")) == QString::fromUtf8("13093f02") && i.get(Category) == QString::fromUtf8("blues"))
{
// If revision doesn't match, test probably needs to be updated
// See: http://www.freedb.org/freedb/blues/13093f02 for updated data
- QCOMPARE(i.get("revision").toInt(), 3);
+ QCOMPARE(i.get(QString::fromUtf8("revision")).toInt(), 3);
QString artist = QString::fromUtf8("神城麻郁(浪川大輔)/宮藤深衣奈(中原麻衣)/小野寺樺恋(清水愛)/織部椿(根谷美智子)/島崎康生(鈴村健一)/風見みずほ(井上喜久子)/森野苺(田村ゆかり)/四道跨(三浦祥朗)/四道晴子(新谷良子)/佐川秋那(浅野真澄)/真下双葉(佐久間紅美)/菊池浩美(進藤尚美)/草薙桂(保志総一郎)/縁川小石(川澄綾子)/間雲漂介(岩田光央)/水澄楓(大原さやか)/まりえ(金田朋子)/山田政臣(杉田智和)神城麻郁(浪川大輔)/宮藤深衣奈(中原麻衣)/小野寺樺恋(清水愛)/織部椿(根谷美智子)/島崎康生(鈴村健一)/風見みずほ(井上喜久子)/森野苺(田村ゆかり)/四道跨(三Y祥朗)/四道晴子(新谷良子)/佐川秋那(浅野真澄)/真下双葉(佐久間紅美)/菊池浩美(進藤尚美)/草薙桂(保志総一郎)/縁川小石(川澄綾子)/間雲漂介(岩田光央)/水澄楓(大原さやか)/まりえ(金田朋子)/山田政臣(杉田智和)");
QCOMPARE(i.get(Artist).toString(),artist);
QCOMPARE(i.get(Title).toString(),QString::fromUtf8("みずほ先生とはちみつツインズ ドラマアルバム2時間目「百合百合ツインズ」"));
- QCOMPARE(i.get(Genre).toString(),QString("Anime"));
+ QCOMPARE(i.get(Genre).toString(),QString::fromUtf8("Anime"));
QCOMPARE(i.get(Year).toInt(),2004);
QCOMPARE(i.track(0).get(Title).toString(),QString::fromUtf8("第EX話 おねがい☆全員集合"));
QCOMPARE(i.track(1).get(Title).toString(),QString::fromUtf8("エピローグ"));
- QCOMPARE(i.track(0).get(Comment).toString(),QString(""));
- QCOMPARE(i.track(1).get(Comment).toString(),QString(""));
+ QCOMPARE(i.track(0).get(Comment).toString(),QString::fromUtf8(""));
+ QCOMPARE(i.track(1).get(Comment).toString(),QString::fromUtf8(""));
for (int j=0; j <= 1; j++)
{
QCOMPARE(i.track(j).get(Artist).toString(),artist);
diff --git a/test/utf8test.h b/tests/utf8test.h
index 2298b0e..ebd1aa3 100644
--- a/test/utf8test.h
+++ b/tests/utf8test.h
@@ -25,7 +25,7 @@
class Utf8Test : public QObject
{
Q_OBJECT
- private slots:
+ private Q_SLOTS:
void testLookup();
};