Bug 238641 - Opening a link in the background changes the URL of the currently active tab
Summary: Opening a link in the background changes the URL of the currently active tab
Status: RESOLVED FIXED
Alias: None
Product: rekonq
Classification: Applications
Component: general (show other bugs)
Version: latest git snapshot
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Andrea Diamantini
URL:
Keywords:
: 238890 (view as bug list)
Depends on:
Blocks: 237890
  Show dependency treegraph
 
Reported: 2010-05-24 03:33 UTC by Panagiotis Papadopoulos
Modified: 2010-09-04 10:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Panagiotis Papadopoulos 2010-05-24 03:33:12 UTC
Version:           latest git snapshot (0.4.xx)
OS:                Linux

Opening a link in the background changes the URL of the currently active tab.

Reproducible: Always

Steps to Reproduce:
Open a website and then open a link in the background.


Actual Results:  
rekonq will change the URL in the URL bar, from the URL of the currently active tab, to the URL of the link, that got opened in the background.
Comment 1 Nikhil Marathe 2010-05-26 01:33:10 UTC
commit 504e1516c0a4ab997a8b71393d51445289315006
Author: Nikhil Marathe <nsm.nikhil@gmail.com>
Date:   Tue May 25 21:32:30 2010 +0530

    Show proper URL on new background tab.
    
    The old behaviour was to target the current url bar, which wasn't the right one when a background tab was opened.
    The new code finds the right bar for the newly opened tab and sets its URL
    
    BUG: 238641

diff --git a/src/application.cpp b/src/application.cpp
index 6525b9a..23e5b09 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -336,7 +336,10 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type)
 
 
     // rapidly show first loading url..
-    w->mainView()->urlBar()->setQUrl(url);
+    int tabIndex = w->mainView()->indexOf(tab);
+    Q_ASSERT( tabIndex != -1 );
+    UrlBar *barForTab = qobject_cast<UrlBar *>(w->mainView()->widgetBar()->widget(tabIndex));
+    barForTab->setQUrl(url);
     
     WebView *view = tab->view();
Comment 2 Panagiotis Papadopoulos 2010-05-26 17:13:03 UTC
*** Bug 238890 has been marked as a duplicate of this bug. ***