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

port away from deprecated KComponentData and KGlobal::locale()

parent f9b6fe54
......@@ -78,7 +78,7 @@ ConnectionEditor::ConnectionEditor(QWidget* parent, Qt::WindowFlags flags)
m_editor->messageWidget->setCloseButtonVisible(false);
m_editor->messageWidget->setWordWrap(true);
// m_editor->ktreewidgetsearchline->lineEdit()->setClickMessage(i18n("Type here to search connections..."));
//m_editor->ktreewidgetsearchline->lineEdit()->setClickMessage(i18n("Type here to search connections..."));
initializeConnections();
initializeMenu();
......
......@@ -294,8 +294,7 @@ void Notification::stateChanged(NetworkManager::Device::State newstate, NetworkM
KNotification *notify = new KNotification("DeviceFailed", KNotification::CloseOnTimeout, this);
connect(notify, SIGNAL(closed()), this, SLOT(notificationClosed()));
notify->setProperty("uni", device->uni());
#warning "port away from KComponentData"
//notify->setComponentData(KComponentData("networkmanagement"));
notify->setComponentName("networkmanagement");
notify->setPixmap(KIcon("dialog-warning").pixmap(64, 64));
notify->setTitle(identifier);
notify->setText(text);
......@@ -353,8 +352,7 @@ void Notification::onActiveConnectionStateChanged(NetworkManager::ActiveConnecti
KNotification *notify = new KNotification("AcStateChanged", KNotification::CloseOnTimeout, this);
connect(notify, SIGNAL(closed()), this, SLOT(notificationClosed()));
notify->setProperty("uni", nId);
#warning "port away from KComponentData"
//notify->setComponentData(KComponentData("networkmanagement"));
notify->setComponentName("networkmanagement");
if (state == NetworkManager::ActiveConnection::Activated) {
notify->setPixmap(KIcon("dialog-information").pixmap(64, 64));
} else {
......@@ -435,8 +433,7 @@ void Notification::onVpnConnectionStateChanged(NetworkManager::VpnConnection::St
KNotification *notify = new KNotification("VpnStateChanged", KNotification::CloseOnTimeout, this);
connect(notify, SIGNAL(closed()), this, SLOT(notificationClosed()));
notify->setProperty("uni", nId);
#warning "port away from KComponentData"
//notify->setComponentData(KComponentData("networkmanagement"));
notify->setComponentName("networkmanagement");
if (state == NetworkManager::VpnConnection::Activated) {
notify->setPixmap(KIcon("dialog-information").pixmap(64, 64));
} else {
......
......@@ -65,7 +65,7 @@ NMVariantMapMap SecretAgent::GetSecrets(const NMVariantMapMap &connection, const
qDebug() << "Hints:" << hints;
qDebug() << "Flags:" << flags;
QString callId = connection_path.path() % setting_name;
const QString callId = connection_path.path() % setting_name;
foreach (const SecretsRequest & request, m_calls) {
if (request == callId) {
qWarning() << "GetSecrets was called again! This should not happen, cancelling first call" << connection_path.path() << setting_name;
......
......@@ -74,10 +74,10 @@ public:
virtual ~SecretAgent();
public Q_SLOTS:
virtual NMVariantMapMap GetSecrets(const NMVariantMapMap&, const QDBusObjectPath&, const QString&, const QStringList&, uint);
virtual void SaveSecrets(const NMVariantMapMap &connection, const QDBusObjectPath &connection_path);
virtual void DeleteSecrets(const NMVariantMapMap &, const QDBusObjectPath &);
virtual void CancelGetSecrets(const QDBusObjectPath &, const QString &);
virtual NMVariantMapMap GetSecrets(const NMVariantMapMap&, const QDBusObjectPath&, const QString&, const QStringList&, uint) Q_DECL_OVERRIDE;
virtual void SaveSecrets(const NMVariantMapMap &connection, const QDBusObjectPath &connection_path) Q_DECL_OVERRIDE;
virtual void DeleteSecrets(const NMVariantMapMap &, const QDBusObjectPath &) Q_DECL_OVERRIDE;
virtual void CancelGetSecrets(const QDBusObjectPath &, const QString &) Q_DECL_OVERRIDE;
private Q_SLOTS:
void dialogAccepted();
......
......@@ -38,6 +38,9 @@
#include <QDBusConnectionInterface>
#include <QDBusReply>
#define TRANSLATION_DOMAIN "plasmanetworkmanagement-kded"
#include <KLocalizedString>
K_PLUGIN_FACTORY(NetworkManagementServiceFactory, registerPlugin<NetworkManagementService>();)
class NetworkManagementServicePrivate
......@@ -51,8 +54,9 @@ NetworkManagementService::NetworkManagementService(QObject * parent, const QVari
{
Q_D(NetworkManagementService);
KLocalizedString::setApplicationDomain("plasmanetworkmanagement-kded");
#warning "port translatin catalog away from KGlobal::insertCatalog"
//KGlobal::insertCatalog("plasma_applet_org.kde.plasma.networkmanagement"); // mobile wizard
KGlobal::locale()->insertCatalog("plasma_applet_org.kde.plasma.networkmanagement"); // mobile wizard
// QDBusReply<bool> reply = QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.plasma-desktop");
// if (reply.value()) {
......@@ -80,7 +84,7 @@ void NetworkManagementService::doInitialization()
{
Q_D(NetworkManagementService);
qDebug() << "Doing inicialization";
qDebug() << "Doing initialization";
d->agent = new SecretAgent(this);
new Notification(this);
#if WITH_MODEMMANAGER_SUPPORT
......
......@@ -24,7 +24,6 @@
// KDE
#include <KDebug>
#include <KLocale>
#include <KGlobal>
#include <NetworkManagerQt/BluetoothDevice>
#include <NetworkManagerQt/Manager>
......@@ -976,7 +975,7 @@ QString UiUtils::formatDateRelative(const QDateTime & lastUsed)
} else if (lastUsed.daysTo(now) == 1) {
lastUsedText = i18nc("Label for last used time for a network connection used the previous day", "Yesterday");
} else {
lastUsedText = KGlobal::locale()->formatDate(lastUsed.date(), KLocale::ShortDate);
lastUsedText = KLocale::global()->formatDate(lastUsed.date(), KLocale::ShortDate);
}
} else {
lastUsedText = i18nc("Label for last used time for a "
......@@ -1010,7 +1009,7 @@ QString UiUtils::formatLastUsedDateRelative(const QDateTime & lastUsed)
} else if (lastUsed.daysTo(now) == 1) {
lastUsedText = i18nc("Label for last used time for a network connection used the previous day", "Last used yesterday");
} else {
lastUsedText = i18n("Last used on %1", KGlobal::locale()->formatDate(lastUsed.date(), KLocale::ShortDate));
lastUsedText = i18n("Last used on %1", KLocale::global()->formatDate(lastUsed.date(), KLocale::ShortDate));
}
} else {
lastUsedText = i18nc("Label for last used time for a "
......
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