X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/5c1420fec990f268b9abbbaedbe45b9388f1fddd..5593c252e8d9638c86dcc2bb9edd394ea14f8ba1:/src/views/dolphinremoteencoding.cpp diff --git a/src/views/dolphinremoteencoding.cpp b/src/views/dolphinremoteencoding.cpp index 8fe66b92d..116168a4b 100644 --- a/src/views/dolphinremoteencoding.cpp +++ b/src/views/dolphinremoteencoding.cpp @@ -26,22 +26,20 @@ #include "dolphinremoteencoding.h" #include "dolphinviewactionhandler.h" -#include +#include "dolphindebug.h" #include #include #include -#include -#include -#include +#include #include #include -#include +#include #include #include #include #include -#define DATA_KEY QLatin1String("Charset") +#define DATA_KEY QStringLiteral("Charset") DolphinRemoteEncoding::DolphinRemoteEncoding(QObject* parent, DolphinViewActionHandler* actionHandler) :QObject(parent), @@ -49,8 +47,8 @@ DolphinRemoteEncoding::DolphinRemoteEncoding(QObject* parent, DolphinViewActionH m_loaded(false), m_idDefault(0) { - m_menu = new KActionMenu(QIcon::fromTheme("character-set"), i18n("Select Remote Charset"), this); - m_actionHandler->actionCollection()->addAction("change_remote_encoding", m_menu); + m_menu = new KActionMenu(QIcon::fromTheme(QStringLiteral("character-set")), i18n("Select Remote Charset"), this); + m_actionHandler->actionCollection()->addAction(QStringLiteral("change_remote_encoding"), m_menu); connect(m_menu->menu(), &QMenu::aboutToShow, this, &DolphinRemoteEncoding::slotAboutToShow); @@ -77,10 +75,10 @@ void DolphinRemoteEncoding::loadSettings() void DolphinRemoteEncoding::slotAboutToOpenUrl() { - KUrl oldURL = m_currentURL; + QUrl oldURL = m_currentURL; m_currentURL = m_actionHandler->currentView()->url(); - if (m_currentURL.protocol() != oldURL.protocol()) { + if (m_currentURL.scheme() != oldURL.scheme()) { // This plugin works on ftp, fish, etc. // everything whose type is T_FILESYSTEM except for local files if (!m_currentURL.isLocalFile() && @@ -143,10 +141,10 @@ void DolphinRemoteEncoding::updateMenu() } } - kDebug() << "URL=" << m_currentURL << " charset=" << charset; + qCDebug(DolphinDebug) << "URL=" << m_currentURL << " charset=" << charset; if (!isFound) { - kWarning() << "could not find entry for charset=" << charset ; + qCWarning(DolphinDebug) << "could not find entry for charset=" << charset ; } else { m_menu->menu()->actions().at(id)->setChecked(true); } @@ -169,7 +167,7 @@ void DolphinRemoteEncoding::slotItemSelected(QAction* action) if (action) { int id = action->data().toInt(); - KConfig config(("kio_" + m_currentURL.protocol() + "rc").toLatin1()); + KConfig config(("kio_" + m_currentURL.scheme() + "rc").toLatin1()); QString host = m_currentURL.host(); if (m_menu->menu()->actions().at(id)->isChecked()) { QString charset = KCharsets::charsets()->encodingForName(m_encodingDescriptions.at(id)); @@ -187,7 +185,7 @@ 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.protocol() + "rc").toLatin1()); + KConfig config(("kio_" + m_currentURL.scheme() + "rc").toLatin1()); QStringList partList = m_currentURL.host().split('.', QString::SkipEmptyParts); if (!partList.isEmpty()) { @@ -208,12 +206,12 @@ void DolphinRemoteEncoding::slotDefault() break; } - domains << partList.join("."); + domains << partList.join(QLatin1Char('.')); partList.erase(partList.begin()); } for (QStringList::const_iterator it = domains.constBegin(); it != domains.constEnd();++it) { - kDebug() << "Domain to remove: " << *it; + qCDebug(DolphinDebug) << "Domain to remove: " << *it; if (config.hasGroup(*it)) { config.deleteGroup(*it); } else if (config.group("").hasKey(*it)) {