summaryrefslogtreecommitdiff
path: root/qutebrowser/browser/history.py
diff options
context:
space:
mode:
Diffstat (limited to 'qutebrowser/browser/history.py')
-rw-r--r--qutebrowser/browser/history.py28
1 files changed, 11 insertions, 17 deletions
diff --git a/qutebrowser/browser/history.py b/qutebrowser/browser/history.py
index c0b23040c..45bfeddbf 100644
--- a/qutebrowser/browser/history.py
+++ b/qutebrowser/browser/history.py
@@ -1,19 +1,6 @@
-# Copyright 2015-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
+# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
-# This file is part of qutebrowser.
-#
-# qutebrowser is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# qutebrowser is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with qutebrowser. If not, see <https://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-3.0-or-later
"""Simple history which gets written to disk."""
@@ -23,8 +10,9 @@ import contextlib
import pathlib
from typing import cast, Mapping, MutableSequence, Optional
+from qutebrowser.qt import machinery
from qutebrowser.qt.core import pyqtSlot, QUrl, QObject, pyqtSignal
-from qutebrowser.qt.widgets import QProgressDialog, QApplication
+from qutebrowser.qt.widgets import QProgressDialog, QApplication, QPushButton
from qutebrowser.config import config
from qutebrowser.api import cmdutils
@@ -54,7 +42,13 @@ class HistoryProgress:
self._progress.setMaximum(0) # unknown
self._progress.setMinimumDuration(0)
self._progress.setLabelText(text)
- self._progress.setCancelButton(None)
+
+ no_button = None
+ if machinery.IS_QT6:
+ # FIXME:mypy PyQt6 stubs issue
+ no_button = cast(QPushButton, None)
+
+ self._progress.setCancelButton(no_button)
self._progress.setAutoClose(False)
self._progress.show()
QApplication.processEvents()