summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Małek <michalm@jabster.pl>2014-10-14 20:11:31 (GMT)
committerMichał Małek <michalm@jabster.pl>2014-10-14 20:11:31 (GMT)
commitbe53b333e6405cbcd34ef2b8d99debe88bfe8f1d (patch)
tree0381432ee583384f16af9f9969b5b0b9f1158549
parentbfe7453628786247801f9c008ab172edbe726a07 (diff)
Ensure i18n() are connected to proper catalogs
-rw-r--r--kcmcddb/CMakeLists.txt2
-rw-r--r--kcmcddb/cddbconfigwidget.cpp2
-rw-r--r--kcmcddb/kcmcddb.cpp5
-rw-r--r--kcmcddb/kcmcddbi18n.h7
-rw-r--r--libkcddb/CMakeLists.txt2
-rw-r--r--libkcddb/categories.cpp2
-rw-r--r--libkcddb/cddb.cpp2
-rw-r--r--libkcddb/cdinfodialog.cpp5
-rw-r--r--libkcddb/cdinfoencodingwidget.cpp3
-rw-r--r--libkcddb/genres.cpp2
-rw-r--r--libkcddb/kcddb.cpp2
-rw-r--r--libkcddb/kcddbi18n.h7
-rw-r--r--libkcddb/musicbrainz/musicbrainzlookup.cpp3
13 files changed, 27 insertions, 17 deletions
diff --git a/kcmcddb/CMakeLists.txt b/kcmcddb/CMakeLists.txt
index d8f1b9c..4e1a2b9 100644
--- a/kcmcddb/CMakeLists.txt
+++ b/kcmcddb/CMakeLists.txt
@@ -1,7 +1,7 @@
add_subdirectory ( doc )
-qt5_wrap_ui(ui_sources cddbconfigwidget.ui)
+ki18n_wrap_ui(ui_sources cddbconfigwidget.ui)
add_library(kcm_cddb MODULE
cddbconfigwidget.cpp
diff --git a/kcmcddb/cddbconfigwidget.cpp b/kcmcddb/cddbconfigwidget.cpp
index 07d9ea2..f740f60 100644
--- a/kcmcddb/cddbconfigwidget.cpp
+++ b/kcmcddb/cddbconfigwidget.cpp
@@ -19,13 +19,13 @@
*/
#include "cddbconfigwidget.h"
+#include "kcmcddbi18n.h"
#include "config-musicbrainz.h"
#include "libkcddb/sites.h"
#include "libkcddb/lookup.h"
-#include <KI18n/KLocalizedString>
#include <KIOWidgets/KUrlRequester>
#include <KWidgetsAddons/KMessageBox>
#include <KWidgetsAddons/KEditListWidget>
diff --git a/kcmcddb/kcmcddb.cpp b/kcmcddb/kcmcddb.cpp
index d9d3864..b6fd00c 100644
--- a/kcmcddb/kcmcddb.cpp
+++ b/kcmcddb/kcmcddb.cpp
@@ -19,6 +19,7 @@
*/
#include "kcmcddb.h"
+#include "kcmcddbi18n.h"
#include "cddbconfigwidget.h"
#include "libkcddb/lookup.h"
@@ -26,7 +27,6 @@
#include "libkcddb/submit.h"
#include <KCoreAddons/KPluginFactory>
-#include <KI18n/KLocalizedString>
#include <KWidgetsAddons/KMessageBox>
#include <QtCore/QDebug>
@@ -41,9 +41,6 @@ K_EXPORT_PLUGIN(KCDDBFactory( "kcmcddb" ))
CDDBModule::CDDBModule(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
{
- // TODO: ensure we get our translations
- // KGlobal::locale()->insertCatalog( QLatin1String( "libkcddb" ));
- qWarning() << "KGlobal::locale()->insertCatalog( QLatin1String( \"libkcddb\" )) needs to be ported to KF5. See the Ki18n programmers guide.";
setButtons(Default | Apply | Help);
widget_ = new CDDBConfigWidget(this);
diff --git a/kcmcddb/kcmcddbi18n.h b/kcmcddb/kcmcddbi18n.h
new file mode 100644
index 0000000..1e4703c
--- /dev/null
+++ b/kcmcddb/kcmcddbi18n.h
@@ -0,0 +1,7 @@
+#ifndef KCMCDDBI18N_H
+#define KCMCDDBI18N_H
+
+#define TRANSLATION_DOMAIN "kcmcddb"
+#include <KI18n/KLocalizedString>
+
+#endif // KCMCDDBI18N_H
diff --git a/libkcddb/CMakeLists.txt b/libkcddb/CMakeLists.txt
index 828a28a..153e405 100644
--- a/libkcddb/CMakeLists.txt
+++ b/libkcddb/CMakeLists.txt
@@ -58,7 +58,7 @@ if(MUSICBRAINZ5_FOUND)
target_link_libraries(kcddb PRIVATE musicbrainz)
endif()
-qt5_wrap_ui(ui_sources cdinfodialog.ui cdinfoencodingwidget.ui)
+ki18n_wrap_ui(ui_sources cdinfodialog.ui cdinfoencodingwidget.ui)
add_library(kcddbwidgets SHARED
cdinfodialog.cpp
diff --git a/libkcddb/categories.cpp b/libkcddb/categories.cpp
index 40abf0a..b21b661 100644
--- a/libkcddb/categories.cpp
+++ b/libkcddb/categories.cpp
@@ -8,7 +8,7 @@
#include "categories.h"
-#include <KI18n/KLocalizedString>
+#include "kcddbi18n.h"
class KCDDB::Categories::Private
{
diff --git a/libkcddb/cddb.cpp b/libkcddb/cddb.cpp
index 34c3787..e86fe9f 100644
--- a/libkcddb/cddb.cpp
+++ b/libkcddb/cddb.cpp
@@ -22,9 +22,9 @@
#include "cddb.h"
#include "categories.h"
+#include "kcddbi18n.h"
#include <KCoreAddons/KStringHandler>
-#include <KI18n/KLocalizedString>
#include <QtCore/QDebug>
#include <QtCore/QStringList>
diff --git a/libkcddb/cdinfodialog.cpp b/libkcddb/cdinfodialog.cpp
index c9c2f1a..b5d2e4e 100644
--- a/libkcddb/cdinfodialog.cpp
+++ b/libkcddb/cdinfodialog.cpp
@@ -21,10 +21,10 @@
#include "cdinfodialog.h"
#include "cdinfoencodingwidget.h"
+#include "kcddbi18n.h"
#include "ui_cdinfodialog.h"
#include <KCodecs/KCharsets>
-#include <KI18n/KLocalizedString>
#include <QtCore/QDebug>
#include <QtCore/QStringList>
@@ -83,9 +83,6 @@ class CDInfoDialog::Private
// We want control over the visibility of this column. See artistChanged().
d->ui->m_trackList->header()->setSectionResizeMode(Private::TRACK_ARTIST, QHeaderView::Interactive);
- // TODO: ensure we get our translations
- // KGlobal::locale()->insertCatalog( QLatin1String( "libkcddb" ));
- qWarning() << "KGlobal::locale()->insertCatalog( QLatin1String( \"libkcddb\" )) needs to be ported to KF5. See the Ki18n programmers guide.";
connect( d->ui->m_trackList, SIGNAL(activated(QModelIndex)), this, SLOT(slotTrackSelected(QModelIndex)) );
connect( d->ui->m_trackList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotTrackDoubleClicked(QModelIndex)) );
connect( d->ui->m_artist, SIGNAL(textChanged(QString)), this, SLOT(artistChanged(QString)) );
diff --git a/libkcddb/cdinfoencodingwidget.cpp b/libkcddb/cdinfoencodingwidget.cpp
index a9c38b8..568cfe7 100644
--- a/libkcddb/cdinfoencodingwidget.cpp
+++ b/libkcddb/cdinfoencodingwidget.cpp
@@ -19,8 +19,9 @@
#include "cdinfoencodingwidget.h"
+#include "kcddbi18n.h"
+
#include <KCodecs/KCharsets>
-#include <KI18n/KLocalizedString>
#include <QtCore/QTextCodec>
namespace KCDDB
diff --git a/libkcddb/genres.cpp b/libkcddb/genres.cpp
index bc8f284..281d349 100644
--- a/libkcddb/genres.cpp
+++ b/libkcddb/genres.cpp
@@ -8,7 +8,7 @@
#include "genres.h"
-#include <KI18n/KLocalizedString>
+#include "kcddbi18n.h"
class KCDDB::Genres::Private
{
diff --git a/libkcddb/kcddb.cpp b/libkcddb/kcddb.cpp
index ec236c7..ae6d8c0 100644
--- a/libkcddb/kcddb.cpp
+++ b/libkcddb/kcddb.cpp
@@ -19,7 +19,7 @@
#include "kcddb.h"
-#include <KI18n/KLocalizedString>
+#include "kcddbi18n.h"
namespace KCDDB
{
diff --git a/libkcddb/kcddbi18n.h b/libkcddb/kcddbi18n.h
new file mode 100644
index 0000000..a1fb2ca
--- /dev/null
+++ b/libkcddb/kcddbi18n.h
@@ -0,0 +1,7 @@
+#ifndef KCDDBI18N_H
+#define KCDDBI18N_H
+
+#define TRANSLATION_DOMAIN "libkcddb"
+#include <KI18n/KLocalizedString>
+
+#endif // KCDDBI18N_H
diff --git a/libkcddb/musicbrainz/musicbrainzlookup.cpp b/libkcddb/musicbrainz/musicbrainzlookup.cpp
index 6accc69..aa6e08f 100644
--- a/libkcddb/musicbrainz/musicbrainzlookup.cpp
+++ b/libkcddb/musicbrainz/musicbrainzlookup.cpp
@@ -19,6 +19,8 @@
#include "musicbrainzlookup.h"
+#include "kcddbi18n.h"
+
#include <musicbrainz5/Query.h>
#include <musicbrainz5/Medium.h>
#include <musicbrainz5/Release.h>
@@ -33,7 +35,6 @@
#include <musicbrainz5/SecondaryType.h>
#include <KCodecs/KCodecs>
-#include <KI18n/KLocalizedString>
#include <QtCore/QCryptographicHash>
#include <QtCore/QDebug>