[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [Konversation] ada670e: A little cleanup.
From:       Eike Hein <hein () kde ! org>
Date:       2010-09-11 12:26:16
Message-ID: 20100911122617.479B3C50471 () projects ! kde ! org
[Download RAW message or body]

commit ada670e14e27cc57aafa03a5971ba7c26f50939b
Author: Eike Hein <hein@kde.org>
Date:   Sat Sep 11 14:28:06 2010 +0200

    A little cleanup.

diff --git a/src/viewer/ircview.cpp b/src/viewer/ircview.cpp
index 64d1f18..30a5f28 100644
--- a/src/viewer/ircview.cpp
+++ b/src/viewer/ircview.cpp
@@ -2422,18 +2422,18 @@ void IRCView::handleContextActions()
 void IRCView::updateWebShortcutMenu()
 {
 #if KDE_IS_VERSION(4,5,0)
-    QString selectedText = textCursor().selectedText();
-
-    if (selectedText.isEmpty())
-    {
-        m_webShortcutMenu->menuAction()->setVisible(false);
+    m_webShortcutMenu->menuAction()->setVisible(false);
+    m_webShortcutMenu->clear();
 
+    if (textCursor().selectedText().isEmpty())
         return;
-    }
 
-    m_webShortcutMenu->clear();
+    QString selectedText = textCursor().selectedText().replace('\n', ' \
').replace('\r', ' ').simplified(); +
+    if (selectedText.isEmpty())
+        return;
 
-    KUriFilterData filterData(selectedText.replace('\n', ' ').replace('\r', ' \
').simplified()); +    KUriFilterData filterData(selectedText);
 
 #if KDE_IS_VERSION(4,5,67)
     filterData.setSearchFilteringOptions(KUriFilterData::RetrievePreferredSearchProvidersOnly);
 @@ -2456,10 +2456,7 @@ void IRCView::updateWebShortcutMenu()
 
         if (!searchProviders.isEmpty())
         {
-            const QString squeezedText = KStringHandler::rsqueeze(selectedText, 21);
-            m_webShortcutMenu->setTitle(i18n("Search for '%1' with", squeezedText));
-
-            m_webShortcutMenu->menuAction()->setVisible(true);
+            m_webShortcutMenu->setTitle(i18n("Search for '%1' with",  \
KStringHandler::rsqueeze(selectedText, 21)));  
             KAction* action = 0;
 
@@ -2479,11 +2476,9 @@ void IRCView::updateWebShortcutMenu()
             connect(action, SIGNAL(triggered()), this, \
SLOT(configureWebShortcuts()));  m_webShortcutMenu->addAction(action);
 
-            return;
+            m_webShortcutMenu->menuAction()->setVisible(true);
         }
     }
-
-    m_webShortcutMenu->menuAction()->setVisible(false);
 #endif
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic