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:
parent
efebfb8148
commit
234769e920
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user