Remove @pyqtSlot for functions and non-QObjects

Fixes #1669
This commit is contained in:
Florian Bruhin 2016-07-23 11:39:29 +02:00
parent 63e466f019
commit 76eab7617b
11 changed files with 4 additions and 20 deletions

View File

@ -47,6 +47,7 @@ Changed
Fixed
-----
- Copmpatibility with PyQt 5.7
- Fixed some configuration values being lost when a config option gets removed
from qutebrowser's code.

View File

@ -337,7 +337,6 @@ def _save_version():
state_config['general']['version'] = qutebrowser.__version__
@pyqtSlot('QWidget*', 'QWidget*')
def on_focus_changed(_old, new):
"""Register currently focused main window in the object registry."""
if not isinstance(new, QWidget):
@ -355,7 +354,6 @@ def on_focus_changed(_old, new):
_maybe_hide_mouse_cursor()
@pyqtSlot(QUrl)
def open_desktopservices_url(url):
"""Handler to open a URL via QDesktopServices."""
win_id = mainwindow.get_window(via_ipc=True, force_window=False)

View File

@ -24,7 +24,6 @@ import itertools
from PyQt5.QtCore import pyqtSignal, pyqtSlot, QUrl, QObject, QPoint
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QWidget, QLayout
from PyQt5.QtPrintSupport import QPrinter
from qutebrowser.keyinput import modeman
from qutebrowser.config import config
@ -122,7 +121,6 @@ class AbstractPrinting:
def to_pdf(self, filename):
raise NotImplementedError
@pyqtSlot(QPrinter)
def to_printer(self, printer):
raise NotImplementedError

View File

@ -52,7 +52,6 @@ class WordHintingError(Exception):
"""Exception raised on errors during word hinting."""
@pyqtSlot(usertypes.KeyMode)
def on_mode_entered(mode, win_id):
"""Stop hinting when insert mode was entered."""
if mode == usertypes.KeyMode.insert:

View File

@ -25,7 +25,6 @@
from PyQt5.QtCore import pyqtSlot, Qt, QEvent, QPoint
from PyQt5.QtGui import QKeyEvent, QIcon
from PyQt5.QtWidgets import QApplication
from PyQt5.QtPrintSupport import QPrinter
# pylint: disable=no-name-in-module,import-error,useless-suppression
from PyQt5.QtWebEngineWidgets import QWebEnginePage
# pylint: enable=no-name-in-module,import-error,useless-suppression
@ -51,7 +50,6 @@ class WebEnginePrinting(browsertab.AbstractPrinting):
def to_pdf(self, filename):
self._widget.page().printToPdf(filename)
@pyqtSlot(QPrinter)
def to_printer(self, printer):
# Should never be called
assert False

View File

@ -55,7 +55,6 @@ class WebKitPrinting(browsertab.AbstractPrinting):
printer.setOutputFileName(filename)
self.to_printer(printer)
@pyqtSlot(QPrinter)
def to_printer(self, printer):
self._widget.print(printer)

View File

@ -27,8 +27,6 @@ Module attributes:
import functools
from PyQt5.QtCore import pyqtSlot
from qutebrowser.completion.models import (miscmodels, urlmodel, configmodel,
base)
from qutebrowser.utils import objreg, usertypes, log, debug
@ -84,7 +82,6 @@ def _init_setting_completions():
_instances[usertypes.Completion.value][sectname][opt] = val_model
@pyqtSlot()
def init_quickmark_completions():
"""Initialize quickmark completion models."""
log.completion.debug("Initializing quickmark completion.")
@ -96,7 +93,6 @@ def init_quickmark_completions():
_instances[usertypes.Completion.quickmark_by_name] = model
@pyqtSlot()
def init_bookmark_completions():
"""Initialize bookmark completion models."""
log.completion.debug("Initializing bookmark completion.")
@ -108,7 +104,6 @@ def init_bookmark_completions():
_instances[usertypes.Completion.bookmark_by_url] = model
@pyqtSlot()
def init_session_completion():
"""Initialize session completion model."""
log.completion.debug("Initializing session completion.")

View File

@ -673,7 +673,6 @@ class TabbedBrowser(tabwidget.TabWidget):
if key in self._global_marks:
point, url = self._global_marks[key]
@pyqtSlot(bool)
def callback(ok):
if ok:
self.cur_load_finished.disconnect(callback)

View File

@ -26,7 +26,7 @@ import datetime
import collections
import traceback
from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject
from PyQt5.QtCore import pyqtSignal, QObject
from PyQt5.QtWidgets import QApplication
from qutebrowser.utils import usertypes, log, objreg, utils
@ -108,7 +108,6 @@ def _get_bridge(win_id):
return objreg.get('message-bridge', scope='window', window=win_id)
@pyqtSlot()
def on_focus_changed():
"""Show queued messages when a new window has been focused.

View File

@ -24,7 +24,7 @@ import pytest
from qutebrowser.misc import msgbox
from PyQt5.QtCore import pyqtSlot, Qt
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMessageBox, QWidget
@ -64,7 +64,6 @@ def test_finished_signal(qtbot):
"""Make sure we can pass a slot to be called when the dialog finished."""
signal_triggered = False
@pyqtSlot()
def on_finished():
nonlocal signal_triggered
signal_triggered = True

View File

@ -26,7 +26,7 @@ import pytest
from qutebrowser.utils import error
from qutebrowser.misc import ipc
from PyQt5.QtCore import pyqtSlot, QTimer
from PyQt5.QtCore import QTimer
from PyQt5.QtWidgets import QMessageBox
@ -81,7 +81,6 @@ def test_no_err_windows(caplog, exc, name, exc_text, fake_args):
], ids=repr)
def test_err_windows(qtbot, qapp, fake_args, pre_text, post_text, expected):
@pyqtSlot()
def err_window_check():
w = qapp.activeModalWidget()
try: