summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cord-Landwehr <cordlandwehr@kde.org>2015-09-27 18:57:30 (GMT)
committerAndreas Cord-Landwehr <cordlandwehr@kde.org>2015-09-27 18:57:30 (GMT)
commit841d4175ae45abe362fbca1efa586120ba21ee07 (patch)
treee2a05ef9fab5ff0a79aac8283bfed9fb68d874a7
parent3b0bcbf80c0a3636695a4d3d3a2a0e16e0acedbe (diff)
Port away from KGlobal.
-rw-r--r--plasmoid/applet/nuclearPlasmoid/nuclearCalculator.cpp1
-rw-r--r--plasmoid/applet/psePlasmoid/Molmasscalculator.cpp1
-rw-r--r--plasmoid/engine/kalzium_engine.cpp3
-rw-r--r--src/detailinfodlg.cpp12
-rw-r--r--src/kalzium.cpp4
-rw-r--r--src/kalziumdataobject.cpp5
-rw-r--r--src/tools/moleculeview.cpp5
7 files changed, 9 insertions, 22 deletions
diff --git a/plasmoid/applet/nuclearPlasmoid/nuclearCalculator.cpp b/plasmoid/applet/nuclearPlasmoid/nuclearCalculator.cpp
index dfcbc6d..d8a6b4a 100644
--- a/plasmoid/applet/nuclearPlasmoid/nuclearCalculator.cpp
+++ b/plasmoid/applet/nuclearPlasmoid/nuclearCalculator.cpp
@@ -49,7 +49,6 @@ nuclearCalculator::nuclearCalculator(QObject *parent, const QVariantList &args)
: Plasma::PopupApplet(parent, args)
, m_widget(0)
{
- KGlobal::locale()->insertCatalog("libkdeedu");
m_converter = new Converter(this);
setAspectRatioMode(Plasma::IgnoreAspectRatio);
setPopupIcon("accessories-calculator");
diff --git a/plasmoid/applet/psePlasmoid/Molmasscalculator.cpp b/plasmoid/applet/psePlasmoid/Molmasscalculator.cpp
index ccf7d27..9f876d9 100644
--- a/plasmoid/applet/psePlasmoid/Molmasscalculator.cpp
+++ b/plasmoid/applet/psePlasmoid/Molmasscalculator.cpp
@@ -43,7 +43,6 @@ Molmasscalculator::Molmasscalculator(QObject *parent, const QVariantList &args)
m_MassLabel(0),
m_switchButton(0)
{
- KGlobal::locale()->insertCatalog("kalzium");
// Some Applet settings
setAspectRatioMode(Plasma::IgnoreAspectRatio);
setHasConfigurationInterface(true);
diff --git a/plasmoid/engine/kalzium_engine.cpp b/plasmoid/engine/kalzium_engine.cpp
index da44c17..72573c3 100644
--- a/plasmoid/engine/kalzium_engine.cpp
+++ b/plasmoid/engine/kalzium_engine.cpp
@@ -22,7 +22,7 @@
#include <QLatin1String>
#include <QStringList>
-#include <KLocale>
+#include <QLocalizedString>
#include <KConfigGroup>
#include <QStandardPaths>
@@ -33,7 +33,6 @@
KalziumEngine::KalziumEngine(QObject* parent, const QVariantList& args)
: Plasma::DataEngine(parent)
{
- KGlobal::locale()->insertCatalog("libkdeedu");
Q_UNUSED(args)
// we don't need the data to fly by any faster - even at a second it's hard to read.
setMinimumPollingInterval(1000);
diff --git a/src/detailinfodlg.cpp b/src/detailinfodlg.cpp
index d8a3968..05be17a 100644
--- a/src/detailinfodlg.cpp
+++ b/src/detailinfodlg.cpp
@@ -29,7 +29,6 @@
#include <KConfig>
#include <KConfigWidgets/khelpclient.h>
#include <krun.h>
-#include <KGlobal>
#include <QIcon>
#include <KPageDialog>
#include <QUrl>
@@ -41,6 +40,7 @@
#include <QImage>
#include <QStackedWidget>
#include <QStandardPaths>
+#include <QLocale>
#include "element.h"
#include "orbitswidget.h"
#include "detailedgraphicaloverview.h"
@@ -287,12 +287,10 @@ QString DetailedInfoDlg::getHtml(DATATYPE type)
}
case EXTRA:
{
- QString language(KGlobal::locale()->languageCodeToName(KGlobal::locale()->language()));
-
//Wikipedia.org
// html.append ("<tr><td><img src=\"wiki.png\" alt=\"icon\"/></td><td>");
html.append ("<tr><td>");
- html.append (createWikiLink(m_element->dataAsString(ChemicalDataObject::name), i18nc("Link to element's Wikipedia page, %1 is localized language name", "Wikipedia (%1)", language)));
+ html.append (createWikiLink(m_element->dataAsString(ChemicalDataObject::name), i18nc("Link to element's Wikipedia page, %1 is localized language name", "Wikipedia (%1)", QLocale().nativeLanguageName())));
html.append ("</td></tr>");
//http://education.jlab.org/itselemental/ele001.html
@@ -310,7 +308,7 @@ QString DetailedInfoDlg::getHtml(DATATYPE type)
html.append ("<tr><td>");
html.append ("<a href=\"http://"); // http://
html.append ("www.webelements.com/");
- if (KGlobal::locale()->language().split('_').at(0) == "en") {
+ if (QLocale().uiLanguages().first().startsWith("en")) {
html.append (m_element->dataAsString(ChemicalDataObject::name).toLower()); // hydrogen
}
html.append ("\" target=\"_blank\" >");
@@ -562,11 +560,11 @@ QString DetailedInfoDlg::createWikiLink(QString link)
QString DetailedInfoDlg::createWikiLink(QString link, QString displayString)
{
QString html;
- QString language(KGlobal::locale()->language());
+ QString language(QLocale().uiLanguages().first());
//Wikipedia.org
html.append ("<a href=\"http://"); // http://
- html.append (language.split('_').at(0)); // en.
+ html.append (language.split('-').at(0)); // en.
html.append (".wikipedia.org/wiki/"); // wikipedia.org
html.append (link); // /hydrogen
html.append ("\" target=\"_blank\" > ");
diff --git a/src/kalzium.cpp b/src/kalzium.cpp
index 6df0d68..b61720a 100644
--- a/src/kalzium.cpp
+++ b/src/kalzium.cpp
@@ -34,7 +34,6 @@
#include "tableinfowidget.h"
#include "psetables.h"
#include <config-kalzium.h>
-#include <KGlobal>
#ifdef HAVE_FACILE
#include "eqchemview.h"
@@ -77,9 +76,6 @@ Kalzium::Kalzium() : KXmlGuiWindow(0)
{
setObjectName("KalziumMainWindow");
- // adding the libkdeedu catalog
- KGlobal::locale()->insertCatalog("libkdeedu");
-
// Init pointers with null
m_infoDialog = 0;
m_isotopeDialog = 0;
diff --git a/src/kalziumdataobject.cpp b/src/kalziumdataobject.cpp
index 8f438d7..d42371d 100644
--- a/src/kalziumdataobject.cpp
+++ b/src/kalziumdataobject.cpp
@@ -28,13 +28,12 @@
#include <QFile>
#include <QFileInfo>
#include <QPainter>
-
+#include <QGlobalStatic>
#include <QLocale>
#include <QDebug>
#include <QUrl>
#include <KPixmapCache>
-#include <KGlobal>
#include <kunitconversion/converter.h>
#include <QStandardPaths>
@@ -43,7 +42,7 @@ struct StaticKalziumDataObject
KalziumDataObject kdo;
};
-K_GLOBAL_STATIC(StaticKalziumDataObject, s_kdo)
+Q_GLOBAL_STATIC(StaticKalziumDataObject, s_kdo)
KalziumDataObject* KalziumDataObject::instance()
{
diff --git a/src/tools/moleculeview.cpp b/src/tools/moleculeview.cpp
index a586b6d..e716e73 100644
--- a/src/tools/moleculeview.cpp
+++ b/src/tools/moleculeview.cpp
@@ -28,8 +28,6 @@
#include <kmessagebox.h>
#include <KLocale>
#include <QUrl>
-#include <KGlobal>
-#include <KGlobalSettings>
#include <knewstuff3/downloaddialog.h>
#include <kio/job.h>
@@ -285,8 +283,7 @@ void MoleculeDialog::slotDownloadNewStuff()
KNS3::DownloadDialog dialog(this);
dialog.exec();
// list of changed entries
- QString destinationDir =
- KGlobalSettings ::documentPath();
+ QString destinationDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
QDir dir(destinationDir);
if (!dir.exists()) {
destinationDir = QDir::homePath();