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

List:       kfm-devel
Subject:    Re: PATCH: Entering the same url in Konqueror's location bar...
From:       "Dawit A." <adawit () kde ! org>
Date:       2009-11-05 19:41:58
Message-ID: 200911051441.58978.adawit () kde ! org
[Download RAW message or body]

On Wednesday 04 November 2009 10:37:45 Dawit A. wrote:
> 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.
> 

Updated patch based on issues pointed out by Maks. For details, see 
http://lists.kde.org/?l=kde-core-devel&m=125744641812425&w=2

["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))
+      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