From d77cba7a3a03d1fbbc4f3b51d303667f1f4fddbd Mon Sep 17 00:00:00 2001
From: Andrea Diamantini <adjam7@gmail.com>
Date: Wed, 29 Sep 2010 16:40:48 +0200
Subject: WARNING: This commit changes rekonq behaviour

After debating with Martin Grablin & Jani-Matti Hatinen it has been pointed
out that we have to change rekonq broken behavior about external links handling
It now opens links in tab or in new windows following the "Open Links in tab or in window"
settings NO MORE stealing focus to the other apps.

BUG: 250502
BUG: 243572
---
 src/application.cpp | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/src/application.cpp b/src/application.cpp
index bb32953d..ce353912 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -158,28 +158,17 @@ int Application::newInstance()
             // No windows in the current desktop? No windows at all?
             // Create a new one and load there sites...
             loadUrl(urlList.at(0), Rekonq::CurrentTab);
-            for (int i = 1; i < urlList.count(); ++i)
-                loadUrl( urlList.at(i), Rekonq::NewTab);
         }
         else
         {
-            // are there any windows there? use it
-            int index = m_mainWindows.size();
-            if (index > 0)
-            {
-                MainWindow *m = m_mainWindows.at(index - 1).data();
-                if(m->isMinimized())
-                    m->showNormal();
-                if( !m->isActiveWindow() )
-                {
-                    m->activateWindow();
-                    m->raise();
-                }
-
-                Q_FOREACH(const KUrl &u, urlList)
-                    loadUrl(u, Rekonq::NewFocusedTab);
-            }
+            if(ReKonfig::openTabNoWindow())
+                loadUrl(urlList.at(0), Rekonq::NewTab);
+            else
+                loadUrl(urlList.at(0), Rekonq::NewWindow);
         }
+        
+        for (int i = 1; i < urlList.count(); ++i)
+            loadUrl( urlList.at(i), Rekonq::NewTab);
     }
     else
     {
-- 
cgit v1.2.1