]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinremoteencoding.cpp
DolphinStatusbar: Fix background and margins for non-Breeze styles
[dolphin.git] / src / views / dolphinremoteencoding.cpp
index 32dd6bd29086929844623ddd0969389695292f90..33c5868d660df6df55beae52a4b80c1d3d1617b8 100644 (file)
 #include <KCharsets>
 #include <KConfig>
 #include <KConfigGroup>
-#include <KIO/Scheduler>
 #include <KLocalizedString>
 #include <KProtocolInfo>
 #include <KProtocolManager>
 
+#include <QDBusConnection>
+#include <QDBusMessage>
 #include <QMenu>
 
 #define DATA_KEY QStringLiteral("Charset")
@@ -150,7 +151,7 @@ void DolphinRemoteEncoding::slotItemSelected(QAction *action)
     if (action) {
         int id = action->data().toInt();
 
-        KConfig config(("kio_" + m_currentURL.scheme() + "rc").toLatin1());
+        KConfig config(QLatin1String("kio_%1rc").arg(m_currentURL.scheme()));
         QString host = m_currentURL.host();
         if (m_menu->menu()->actions().at(id)->isChecked()) {
             QString charset = KCharsets::charsets()->encodingForName(m_encodingDescriptions.at(id));
@@ -168,9 +169,9 @@ void DolphinRemoteEncoding::slotDefault()
 {
     // We have no choice but delete all higher domain level
     // settings here since it affects what will be matched.
-    KConfig config(("kio_" + m_currentURL.scheme() + "rc").toLatin1());
+    KConfig config(QLatin1String("kio_%1rc").arg(m_currentURL.scheme()));
 
-    QStringList partList = m_currentURL.host().split('.', Qt::SkipEmptyParts);
+    QStringList partList = m_currentURL.host().split(QLatin1Char('.'), Qt::SkipEmptyParts);
     if (!partList.isEmpty()) {
         partList.erase(partList.begin());
 
@@ -197,8 +198,8 @@ void DolphinRemoteEncoding::slotDefault()
             qCDebug(DolphinDebug) << "Domain to remove: " << *it;
             if (config.hasGroup(*it)) {
                 config.deleteGroup(*it);
-            } else if (config.group("").hasKey(*it)) {
-                config.group("").deleteEntry(*it); //don't know what group name is supposed to be XXX
+            } else if (config.group(QString()).hasKey(*it)) {
+                config.group(QString()).deleteEntry(*it); // don't know what group name is supposed to be XXX
             }
         }
     }
@@ -210,7 +211,11 @@ void DolphinRemoteEncoding::slotDefault()
 
 void DolphinRemoteEncoding::updateView()
 {
-    KIO::Scheduler::emitReparseSlaveConfiguration();
+    QDBusMessage message =
+        QDBusMessage::createSignal(QStringLiteral("/KIO/Scheduler"), QStringLiteral("org.kde.KIO.Scheduler"), QStringLiteral("reparseSlaveConfiguration"));
+    message << QString();
+    QDBusConnection::sessionBus().send(message);
+
     // Reload the page with the new charset
     m_actionHandler->currentView()->setUrl(m_currentURL);
     m_actionHandler->currentView()->reload();