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

List:       kfm-devel
Subject:    PATCH: Entering the same url in Konqueror's location bar...
From:       "Dawit A." <adawit () kde ! org>
Date:       2009-11-04 15:37:45
Message-ID: 200911041037.45521.adawit () kde ! org
[Download RAW message or body]

The attached patch fixes the problem where typing the same url or simply 
pressing the "Go" button beside the location bar causes addresses to be 
duplicated in the history list. With this patch such requests will simply be 
interpreted as if the user pressed the reload.

["konqmainwindow.patch" (text/x-patch)]

Index: konqmainwindow.cpp
=========================
--- konqmainwindow.cpp	(revision 1044576)
+++ konqmainwindow.cpp	(working copy)
@@ -469,7 +469,7 @@
     if (m_currentDir.isEmpty() && m_currentView)
        m_currentDir = m_currentView->url().path( KUrl::AddTrailingSlash );
 
-    KUrl filteredURL ( KonqMisc::konqFilteredURL( this, url, m_currentDir ) );
+    const QString filteredURL = KonqMisc::konqFilteredURL( this, url, m_currentDir \
);  kDebug(1202) << "url" << url << "filtered into" << filteredURL;
 
     if ( filteredURL.isEmpty() ) // initially empty, or error (e.g. ~unknown_user)
@@ -477,8 +477,16 @@
 
     m_currentDir.clear();
 
-    openUrl(0, filteredURL, QString(), req);
+    const QString prevFilteredURL = KonqMisc::konqFilteredURL(this, \
m_currentView->typedUrl(), m_currentDir); +    kDebug(1202) << "previous url" << \
m_currentView->typedUrl() << "filtered into" << prevFilteredURL;  
+    // If the current url in the view is the same as the one being displayed
+    // simply do a reload instead of calling openUrl...
+    if (urlcmp(filteredURL, prevFilteredURL, KUrl::CompareWithoutTrailingSlash))
+      slotReload();
+    else
+      openUrl(0, KUrl(filteredURL), QString(), req);
+
     // #4070: Give focus to view after URL was entered manually
     // Note: we do it here if the view mode (i.e. part) wasn't changed
     // If it is changed, then it's done in KonqView::changePart



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

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