X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/c7ef72de5563ae33e9342526cb33d67498de0759..c8a2db7d4e79422ee3301e855ac5f6bb0a09e710:/src/views/dolphinremoteencoding.cpp diff --git a/src/views/dolphinremoteencoding.cpp b/src/views/dolphinremoteencoding.cpp index 8644f5cc2..bf00e33fe 100644 --- a/src/views/dolphinremoteencoding.cpp +++ b/src/views/dolphinremoteencoding.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include @@ -52,8 +51,8 @@ DolphinRemoteEncoding::DolphinRemoteEncoding(QObject* parent, DolphinViewActionH { m_menu = new KActionMenu(KIcon("character-set"), i18n("Select Remote Charset"), this); m_actionHandler->actionCollection()->addAction("change_remote_encoding", m_menu); - connect(m_menu->menu(), SIGNAL(aboutToShow()), - this, SLOT(slotAboutToShow())); + connect(m_menu->menu(), &QMenu::aboutToShow, + this, &DolphinRemoteEncoding::slotAboutToShow); m_menu->setEnabled(false); m_menu->setDelayed(false); @@ -102,7 +101,7 @@ void DolphinRemoteEncoding::slotAboutToOpenUrl() void DolphinRemoteEncoding::fillMenu() { - KMenu* menu = m_menu->menu(); + QMenu* menu = m_menu->menu(); menu->clear(); @@ -118,7 +117,7 @@ void DolphinRemoteEncoding::fillMenu() menu->addAction(i18n("Default"), this, SLOT(slotDefault()), 0)->setCheckable(true); m_idDefault = m_encodingDescriptions.size() + 2; - connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(slotItemSelected(QAction*))); + connect(menu, &QMenu::triggered, this, &DolphinRemoteEncoding::slotItemSelected); } void DolphinRemoteEncoding::updateMenu() @@ -132,14 +131,12 @@ void DolphinRemoteEncoding::updateMenu() m_menu->menu()->actions().at(i)->setChecked(false); } - QString charset = KIO::SlaveConfig::self()->configData(m_currentURL.protocol(), - m_currentURL.host(), DATA_KEY); - + const QString charset = KGlobal::charsets()->descriptionForEncoding(KProtocolManager::charsetFor(m_currentURL)); if (!charset.isEmpty()) { int id = 0; bool isFound = false; for (int i = 0; i < m_encodingDescriptions.size(); i++) { - if (m_encodingDescriptions.at(i).contains(charset)) { + if (m_encodingDescriptions.at(i) == charset) { isFound = true; id = i; break;