Commit 69e1c72d authored by Lukáš Tinkl's avatar Lukáš Tinkl
Browse files

port away from KGlobal

parent 8f936ab9
......@@ -30,10 +30,12 @@
#include "vpnuiplugin.h"
#include <networkmodelitem.h>
#include <QUrl>
#include <QStandardPaths>
#include <KActionCollection>
#include <KLocale>
#include <KGlobal>
#include <KGlobalSettings>
#include <KIcon>
#include <KLocalizedString>
#include <KMessageBox>
......@@ -42,15 +44,12 @@
#include <KStandardAction>
#include <KAction>
#include <KXMLGUIFactory>
#include <KMenu>
#include <KAcceleratorManager>
#include <KConfig>
#include <KConfigGroup>
#include <KWallet/Wallet>
#include <KStandardDirs>
#include <KFileDialog>
#include <KShell>
#include <QUrl>
#include <KFilterProxySearchLine>
#include <NetworkManagerQt/Settings>
......@@ -409,7 +408,7 @@ void ConnectionEditor::slotItemDoubleClicked(const QModelIndex &index)
void ConnectionEditor::importSecretsFromPlainTextFiles()
{
const QString secretsDirectory = KStandardDirs::locateLocal("data", "networkmanagement/secrets/");
const QString secretsDirectory = QStandardPaths::locate(QStandardPaths::DataLocation, "networkmanagement/secrets/", QStandardPaths::LocateDirectory);
QDir dir(secretsDirectory);
if (dir.exists() && !dir.entryList(QDir::Files).isEmpty()) {
QMap<QString, QMap<QString, QString > > resultingMap;
......@@ -558,7 +557,7 @@ void ConnectionEditor::exportVpn()
return;
}
const QUrl url = QUrl::fromLocalFile(KGlobalSettings::documentPath() + QDir::separator() + vpnPlugin->suggestedFileName(connSettings));
const QUrl url = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + QDir::separator() + vpnPlugin->suggestedFileName(connSettings));
const QString filename = KFileDialog::getSaveFileName(url, vpnPlugin->supportedFileExtensions(), this, i18n("Export VPN Connection"));
if (!filename.isEmpty()) {
if (!vpnPlugin->exportConnectionSettings(connSettings, filename)) {
......
......@@ -27,6 +27,7 @@
#include <QLabel>
#include <QGraphicsLinearLayout>
#include <KLocale>
#include <KGlobalSettings>
#include <NetworkManagerQt/Manager>
......@@ -220,9 +221,9 @@ void TrafficMonitor::updateTraffic()
_r = m_rx.toDouble();
_t = m_tx.toDouble();
r = KGlobal::locale()->formatByteSize(_r*1024);
r = KLocale::global()->formatByteSize(_r*1024);
r.append("/s");
t = KGlobal::locale()->formatByteSize(_t*1024);
t = KLocale::global()->formatByteSize(_t*1024);
t.append("/s");
}
......@@ -240,10 +241,10 @@ void TrafficMonitor::updateTraffic()
temp = QString("<qt><table align=\"left\" border=\"0\"><tr>");
temp += QString("<td width=\"20pt\" bgcolor=\"%1\">&nbsp;&nbsp;").arg(m_rxColor.name());
temp += QString("</td><td width=\"50%\">");
temp += QString(format).arg(i18n("Received"), KGlobal::locale()->formatByteSize(m_rxTotal*1000, 2));
temp += QString(format).arg(i18n("Received"), KLocale::global()->formatByteSize(m_rxTotal*1000, 2));
temp += QString("&nbsp;&nbsp;</td></tr><tr><td width=\"20pt\" bgcolor=\"%1\">&nbsp;&nbsp;").arg(m_txColor.name());
temp += QString("</td><td width=\"50%\">");
temp += QString(format).arg(i18n("Transmitted"), KGlobal::locale()->formatByteSize(m_txTotal*1000, 2));
temp += QString(format).arg(i18n("Transmitted"), KLocale::global()->formatByteSize(m_txTotal*1000, 2));
temp += QString("</td></tr></table></qt>");
m_traffic->setText(temp);
}
......@@ -22,10 +22,9 @@
#include <QFile>
#include <QTextStream>
#include <QDebug>
#include <KLocale>
#include <KGlobal>
const QString MobileProviders::ProvidersFile = "/usr/share/mobile-broadband-provider-info/serviceproviders.xml";
......@@ -35,10 +34,10 @@ bool localeAwareCompare(const QString & one, const QString & two) {
MobileProviders::MobileProviders()
{
const QStringList allCountries = KGlobal::locale()->allCountriesList();
const QStringList allCountries = KLocale::global()->allCountriesList();
foreach (const QString & cc, allCountries) {
//qDebug() << "Inserting" << cc.toUpper() << KGlobal::locale()->countryCodeToName(cc);
mCountries.insert(cc.toUpper(), KGlobal::locale()->countryCodeToName(cc));
//qDebug() << "Inserting" << cc.toUpper() << KLocale::global()->countryCodeToName(cc);
mCountries.insert(cc.toUpper(), KLocale::global()->countryCodeToName(cc));
}
mError = Success;
......@@ -86,7 +85,7 @@ QStringList MobileProviders::getCountryList() const
QString MobileProviders::countryFromLocale() const
{
return KGlobal::locale()->country().toUpper();
return KLocale::global()->country().toUpper();
}
QStringList MobileProviders::getProvidersList(QString country, NetworkManager::ConnectionSettings::ConnectionType type)
......@@ -304,7 +303,7 @@ QVariantMap MobileProviders::getCdmaInfo(const QString & provider)
QString MobileProviders::getNameByLocale(const QMap<QString, QString> & localizedNames) const
{
QString name;
const QStringList locales = KGlobal::locale()->languageList();
const QStringList locales = KLocale::global()->languageList();
foreach(const QString & locale, locales) {
QString language, country, modifier, charset;
KLocale::splitLocale(locale, language, country, modifier, charset);
......
......@@ -34,7 +34,6 @@
#include <NetworkManagerQt/WirelessDevice>
#include <NetworkManagerQt/WirelessSetting>
#include <KGlobal>
#include <KLocale>
#include <KLocalizedString>
......@@ -151,7 +150,7 @@ void NetworkModelItem::setDeviceState(const NetworkManager::Device::State state)
QString NetworkModelItem::download() const
{
double download = m_download.toDouble();
return KGlobal::locale()->formatByteSize(download*1024) + "/s";
return KLocale::global()->formatByteSize(download*1024) + "/s";
}
bool NetworkModelItem::duplicate() const
......@@ -373,7 +372,7 @@ QString NetworkModelItem::uni() const
QString NetworkModelItem::upload() const
{
double upload = m_upload.toDouble();
return KGlobal::locale()->formatByteSize(upload*1024) + "/s";
return KLocale::global()->formatByteSize(upload*1024) + "/s";
}
QString NetworkModelItem::uuid() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment