diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-03-02 01:20:04 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-03-02 01:20:04 +0100 |
commit | f959cfb603baea26f6e7c7d9414d0d06ee4acd0a (patch) | |
tree | d8dee180ac62086d2cef7e6282883df70ebbf2f4 | |
parent | Added shortlink to GreenBytes HTTP tests (diff) | |
download | rekonq-f959cfb603baea26f6e7c7d9414d0d06ee4acd0a.tar.xz |
This will fix rekonq behaviour on opening external links.
It's a bit "less functional" than before, but it always works :)
-rw-r--r-- | src/application.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/application.cpp b/src/application.cpp index e5b76745..270cd87f 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -53,7 +53,6 @@ #include <KToolInvocation> #include <KUriFilter> #include <KMessageBox> -#include <KWindowInfo> #include <KUrl> #include <ThreadWeaver/Weaver> @@ -153,21 +152,17 @@ int Application::newInstance() // are there args? load them.. if (args->count() > 0) { - // is there a window open on the current desktop ? use it! - for (int i = 0; i < m_mainWindows.size(); ++i) + // are there any windows there? use it + int index = m_mainWindows.size(); + if(index > 0) { - MainWindow *m = m_mainWindows.at(i).data(); - KWindowInfo w = KWindowInfo(m->winId(), NET::WMDesktop); - if(w.isOnCurrentDesktop()) - { - m->activateWindow(); - m->raise(); + MainWindow *m = m_mainWindows.at(index - 1).data(); + m->activateWindow(); - for (int i = 0; i < args->count(); ++i) - loadUrl(args->arg(i), Rekonq::NewCurrentTab); + for (int i = 0; i < args->count(); ++i) + loadUrl(args->arg(i), Rekonq::NewCurrentTab); - return 2; - } + return 2; } // No windows in the current desktop? No windows at all? |