mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-13 10:32:11 +01:00
Merge branch 'Falkon/3.0'
This commit is contained in:
commit
1cc053c7f1
|
@ -268,10 +268,7 @@ void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
|
||||||
QString downloadPath;
|
QString downloadPath;
|
||||||
bool openFile = false;
|
bool openFile = false;
|
||||||
|
|
||||||
QString fileName = QFileInfo(downloadItem->path()).fileName();
|
const QString fileName = QFileInfo(downloadItem->path()).fileName();
|
||||||
fileName = QUrl::fromPercentEncoding(fileName.toUtf8());
|
|
||||||
// Filename may have been percent encoded and actually containing path
|
|
||||||
fileName = QFileInfo(fileName).fileName();
|
|
||||||
|
|
||||||
const bool forceAsk = downloadItem->savePageFormat() != QWebEngineDownloadItem::UnknownSaveFormat
|
const bool forceAsk = downloadItem->savePageFormat() != QWebEngineDownloadItem::UnknownSaveFormat
|
||||||
|| downloadItem->type() == QWebEngineDownloadItem::UserRequested;
|
|| downloadItem->type() == QWebEngineDownloadItem::UserRequested;
|
||||||
|
|
|
@ -230,19 +230,24 @@ void NavigationBar::setCurrentView(TabbedWebView *view)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto updateButton = [](ToolButton *button, QAction *action) {
|
auto connectPageActions = [this](QWebEnginePage *page) {
|
||||||
button->setEnabled(action->isEnabled());
|
auto updateButton = [](ToolButton *button, QAction *action) {
|
||||||
|
button->setEnabled(action->isEnabled());
|
||||||
|
};
|
||||||
|
auto updateBackButton = std::bind(updateButton, m_buttonBack, page->action(QWebEnginePage::Back));
|
||||||
|
auto updateForwardButton = std::bind(updateButton, m_buttonForward, page->action(QWebEnginePage::Forward));
|
||||||
|
|
||||||
|
updateBackButton();
|
||||||
|
updateForwardButton();
|
||||||
|
|
||||||
|
disconnect(m_backConnection);
|
||||||
|
disconnect(m_forwardConnection);
|
||||||
|
m_backConnection = connect(page->action(QWebEnginePage::Back), &QAction::changed, this, updateBackButton);
|
||||||
|
m_forwardConnection = connect(page->action(QWebEnginePage::Forward), &QAction::changed, this, updateForwardButton);
|
||||||
};
|
};
|
||||||
auto updateBackButton = std::bind(updateButton, m_buttonBack, view->pageAction(QWebEnginePage::Back));
|
|
||||||
auto updateForwardButton = std::bind(updateButton, m_buttonForward, view->pageAction(QWebEnginePage::Forward));
|
|
||||||
|
|
||||||
updateBackButton();
|
connectPageActions(view->page());
|
||||||
updateForwardButton();
|
connect(view, &TabbedWebView::pageChanged, this, connectPageActions);
|
||||||
|
|
||||||
disconnect(m_backConnection);
|
|
||||||
disconnect(m_forwardConnection);
|
|
||||||
m_backConnection = connect(view->pageAction(QWebEnginePage::Back), &QAction::changed, this, updateBackButton);
|
|
||||||
m_forwardConnection = connect(view->pageAction(QWebEnginePage::Forward), &QAction::changed, this, updateForwardButton);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigationBar::showReloadButton()
|
void NavigationBar::showReloadButton()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user