1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Now 'switch to tab' searches current window first.

-by ff2000, thank you :)
This commit is contained in:
S. Razi Alavizadeh 2012-12-08 02:04:38 +03:30
parent efebfb8148
commit 234769e920
2 changed files with 10 additions and 3 deletions

View File

@ -206,13 +206,16 @@ TabPosition LocationCompleterModel::tabPositionForUrl(const QUrl& url) const
TabPosition LocationCompleterModel::tabPositionForEncodedUrl(const QString& encodedUrl) const
{
for(int win=0; win < mApp->windowCount(); ++win) {
QupZilla* mainWin = mApp->mainWindows().at(win);
QList<QupZilla*> windows = mApp->mainWindows();
int currentWindowIdx = windows.indexOf(mApp->getWindow());
windows.prepend(mApp->getWindow());
for(int win=0; win < windows.count(); ++win) {
QupZilla* mainWin = windows.at(win);
QList<WebTab*> tabs = mainWin->tabWidget()->allTabs();
for(int tab=0; tab < tabs.count(); ++tab) {
if(tabs[tab]->url().toEncoded() == encodedUrl) {
TabPosition pos;
pos.windowIndex = win;
pos.windowIndex = win == 0 ? currentWindowIdx : win-1;
pos.tabIndex = tab;
return pos;
}

View File

@ -23,6 +23,7 @@
#include "history.h"
#include "tabwidget.h"
#include "qzsettings.h"
#include "tabbedwebview.h"
#include <QKeyEvent>
#include <QApplication>
@ -277,4 +278,7 @@ void LocationCompleterView::activateTab(TabPosition pos)
win->activateWindow();
win->raise();
}
else {
win->weView()->setFocus();
}
}