From d5071f31fcbdb634641b65ad6280d7c23d13f601 Mon Sep 17 00:00:00 2001 From: Méven Car Date: Mon, 10 Nov 2025 09:08:55 +0100 Subject: remoteencoding: updateMenu: check if a charset is found Rather than its description, which for an empty charset is: "Other encoding ()", that can't be empty and will always enter the branch. --- src/views/dolphinremoteencoding.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/views/dolphinremoteencoding.cpp') diff --git a/src/views/dolphinremoteencoding.cpp b/src/views/dolphinremoteencoding.cpp index 33c5868d6..2887ee22d 100644 --- a/src/views/dolphinremoteencoding.cpp +++ b/src/views/dolphinremoteencoding.cpp @@ -114,8 +114,9 @@ void DolphinRemoteEncoding::updateMenu() m_menu->menu()->actions().at(i)->setChecked(false); } - const QString charset = KCharsets::charsets()->descriptionForEncoding(KProtocolManager::charsetFor(m_currentURL)); - if (!charset.isEmpty()) { + const QString charsetFor = KProtocolManager::charsetFor(m_currentURL); + if (!charsetFor.isEmpty()) { + const QString charset = KCharsets::charsets()->descriptionForEncoding(charsetFor); int id = 0; bool isFound = false; for (int i = 0; i < m_encodingDescriptions.size(); i++) { -- cgit v1.3