Adjust various comments

This commit is contained in:
Florian Bruhin 2016-07-07 18:03:37 +02:00
parent 3c99436950
commit d9516b9c1d
7 changed files with 22 additions and 18 deletions

View File

@ -484,7 +484,7 @@ class CommandDispatcher:
url = self._current_url().adjusted(QUrl.RemoveFragment) url = self._current_url().adjusted(QUrl.RemoveFragment)
if where in ['prev', 'next']: if where in ['prev', 'next']:
# FIXME:refactor have a proper API for this # FIXME:qtwebengine have a proper API for this
page = widget._widget.page() # pylint: disable=protected-access page = widget._widget.page() # pylint: disable=protected-access
frame = page.currentFrame() frame = page.currentFrame()
if frame is None: if frame is None:
@ -1037,7 +1037,7 @@ class CommandDispatcher:
env['QUTE_SELECTED_TEXT'] = tab.caret.selection() env['QUTE_SELECTED_TEXT'] = tab.caret.selection()
env['QUTE_SELECTED_HTML'] = tab.caret.selection(html=True) env['QUTE_SELECTED_HTML'] = tab.caret.selection(html=True)
# FIXME:refactor: If tab is None, run_async will fail! # FIXME:qtwebengine: If tab is None, run_async will fail!
try: try:
url = self._tabbed_browser.current_url() url = self._tabbed_browser.current_url()
@ -1136,7 +1136,7 @@ class CommandDispatcher:
"Please enable developer-extras before using the " "Please enable developer-extras before using the "
"webinspector!") "webinspector!")
tab.data.inspector = inspector.WebInspector() tab.data.inspector = inspector.WebInspector()
# FIXME:refactor have a proper API for this # FIXME:qtwebengine have a proper API for this
page = tab._widget.page() # pylint: disable=protected-access page = tab._widget.page() # pylint: disable=protected-access
tab.data.inspector.setPage(page) tab.data.inspector.setPage(page)
tab.data.inspector.show() tab.data.inspector.show()
@ -1185,7 +1185,7 @@ class CommandDispatcher:
elif mhtml_: elif mhtml_:
self._download_mhtml(dest) self._download_mhtml(dest)
else: else:
# FIXME:refactor have a proper API for this # FIXME:qtwebengine have a proper API for this
tab = self._current_widget() tab = self._current_widget()
page = tab._widget.page() # pylint: disable=protected-access page = tab._widget.page() # pylint: disable=protected-access
download_manager.get(self._current_url(), page=page, download_manager.get(self._current_url(), page=page,
@ -1330,7 +1330,7 @@ class CommandDispatcher:
The editor which should be launched can be configured via the The editor which should be launched can be configured via the
`general -> editor` config option. `general -> editor` config option.
""" """
# FIXME:refactor have a proper API for this # FIXME:qtwebengine have a proper API for this
tab = self._current_widget() tab = self._current_widget()
page = tab._widget.page() # pylint: disable=protected-access page = tab._widget.page() # pylint: disable=protected-access
try: try:
@ -1375,7 +1375,7 @@ class CommandDispatcher:
needs_js=True) needs_js=True)
def paste_primary(self): def paste_primary(self):
"""Paste the primary selection at cursor position.""" """Paste the primary selection at cursor position."""
# FIXME:refactor have a proper API for this # FIXME:qtwebengine have a proper API for this
tab = self._current_widget() tab = self._current_widget()
page = tab._widget.page() # pylint: disable=protected-access page = tab._widget.page() # pylint: disable=protected-access
try: try:

View File

@ -819,7 +819,7 @@ class HintManager(QObject):
tab = tabbed_browser.currentWidget() tab = tabbed_browser.currentWidget()
if tab is None: if tab is None:
raise cmdexc.CommandError("No WebView available yet!") raise cmdexc.CommandError("No WebView available yet!")
# FIXME:refactor have a proper API for this # FIXME:qtwebengine have a proper API for this
page = tab._widget.page() # pylint: disable=protected-access page = tab._widget.page() # pylint: disable=protected-access
mainframe = page.mainFrame() mainframe = page.mainFrame()
if mainframe is None: if mainframe is None:

View File

@ -154,7 +154,7 @@ class AbstractZoom(QObject):
self._init_neighborlist() self._init_neighborlist()
objreg.get('config').changed.connect(self._on_config_changed) objreg.get('config').changed.connect(self._on_config_changed)
# # FIXME:refactor is this needed? # # FIXME:qtwebengine is this needed?
# # For some reason, this signal doesn't get disconnected automatically # # For some reason, this signal doesn't get disconnected automatically
# # when the WebView is destroyed on older PyQt versions. # # when the WebView is destroyed on older PyQt versions.
# # See https://github.com/The-Compiler/qutebrowser/issues/390 # # See https://github.com/The-Compiler/qutebrowser/issues/390
@ -431,7 +431,7 @@ class AbstractTab(QWidget):
load_progress = pyqtSignal(int) load_progress = pyqtSignal(int)
load_finished = pyqtSignal(bool) load_finished = pyqtSignal(bool)
icon_changed = pyqtSignal(QIcon) icon_changed = pyqtSignal(QIcon)
# FIXME:refactor get rid of this altogether? # FIXME:qtwebengine get rid of this altogether?
url_text_changed = pyqtSignal(str) url_text_changed = pyqtSignal(str)
title_changed = pyqtSignal(str) title_changed = pyqtSignal(str)
load_status_changed = pyqtSignal(str) load_status_changed = pyqtSignal(str)

View File

@ -31,7 +31,7 @@ from qutebrowser.browser.webengine import webview
from qutebrowser.utils import usertypes, qtutils from qutebrowser.utils import usertypes, qtutils
## FIXME:refactor add stubs for abstract things which aren't implemented yet. ## FIXME:qtwebengine add stubs for abstract things which aren't implemented yet.
## pylint: disable=abstract-method ## pylint: disable=abstract-method
@ -74,11 +74,12 @@ class WebEngineScroller(tab.AbstractScroller):
"""QtWebEngine implementations related to scrolling.""" """QtWebEngine implementations related to scrolling."""
def _key_press(self, key, count=1): def _key_press(self, key, count=1):
# FIXME Abort scrolling if the minimum/maximum was reached. # FIXME:qtwebengine Abort scrolling if the minimum/maximum was reached.
press_evt = QKeyEvent(QEvent.KeyPress, key, Qt.NoModifier, 0, 0, 0) press_evt = QKeyEvent(QEvent.KeyPress, key, Qt.NoModifier, 0, 0, 0)
release_evt = QKeyEvent(QEvent.KeyRelease, key, Qt.NoModifier, 0, 0, 0) release_evt = QKeyEvent(QEvent.KeyRelease, key, Qt.NoModifier, 0, 0, 0)
recipient = self._widget.focusProxy() recipient = self._widget.focusProxy()
for _ in range(count): for _ in range(count):
# If we get a segfault here, we might want to try sendEvent instead.
QApplication.postEvent(recipient, press_evt) QApplication.postEvent(recipient, press_evt)
QApplication.postEvent(recipient, release_evt) QApplication.postEvent(recipient, release_evt)
@ -91,7 +92,7 @@ class WebEngineScroller(tab.AbstractScroller):
# Added in Qt 5.7 # Added in Qt 5.7
return (None, None) return (None, None)
else: else:
# FIXME is this correct? # FIXME:qtwebengine is this correct?
perc_x = 100 / size.width() * pos.x() perc_x = 100 / size.width() * pos.x()
perc_y = 100 / size.height() * pos.y() perc_y = 100 / size.height() * pos.y()
return (perc_x, perc_y) return (perc_x, perc_y)
@ -190,7 +191,7 @@ class WebEngineViewTab(tab.AbstractTab):
@property @property
def progress(self): def progress(self):
return 0 # FIXME:refactor return 0 # FIXME:qtwebengine
@property @property
def load_status(self): def load_status(self):
@ -232,7 +233,8 @@ class WebEngineViewTab(tab.AbstractTab):
self._widget.triggerPageAction(action) self._widget.triggerPageAction(action)
def set_html(self, html, base_url): def set_html(self, html, base_url):
# FIXME check this and raise an exception if too big: # FIXME:qtwebengine
# check this and raise an exception if too big:
# Warning: The content will be percent encoded before being sent to the # Warning: The content will be percent encoded before being sent to the
# renderer via IPC. This may increase its size. The maximum size of the # renderer via IPC. This may increase its size. The maximum size of the
# percent encoded content is 2 megabytes minus 30 bytes. # percent encoded content is 2 megabytes minus 30 bytes.
@ -247,7 +249,7 @@ class WebEngineViewTab(tab.AbstractTab):
page.loadStarted.connect(self._on_load_started) page.loadStarted.connect(self._on_load_started)
view.titleChanged.connect(self.title_changed) view.titleChanged.connect(self.title_changed)
page.loadFinished.connect(self.load_finished) page.loadFinished.connect(self.load_finished)
# FIXME:refactor # FIXME:qtwebengine stub this?
# view.iconChanged.connect(self.icon_changed) # view.iconChanged.connect(self.icon_changed)
# view.scroll.pos_changed.connect(self.scroll.perc_changed) # view.scroll.pos_changed.connect(self.scroll.perc_changed)
# view.url_text_changed.connect(self.url_text_changed) # view.url_text_changed.connect(self.url_text_changed)

View File

@ -254,7 +254,7 @@ class _Downloader:
self._used = True self._used = True
web_url = self.web_view.cur_url web_url = self.web_view.cur_url
# FIXME:refactor have a proper API for this # FIXME:qtwebengine have a proper API for this
page = self.web_view._widget.page() # pylint: disable=protected-access page = self.web_view._widget.page() # pylint: disable=protected-access
web_frame = page.mainFrame() web_frame = page.mainFrame()

View File

@ -310,6 +310,8 @@ class WebViewScroller(tabmod.AbstractScroller):
"""QtWebKit implementations related to scrolling.""" """QtWebKit implementations related to scrolling."""
# FIXME:qtwebengine When to use the main frame, when the current one?
def pos_px(self): def pos_px(self):
return self._widget.page().mainFrame().scrollPosition() return self._widget.page().mainFrame().scrollPosition()
@ -360,7 +362,7 @@ class WebViewScroller(tabmod.AbstractScroller):
release_evt = QKeyEvent(QEvent.KeyRelease, key, Qt.NoModifier, 0, 0, 0) release_evt = QKeyEvent(QEvent.KeyRelease, key, Qt.NoModifier, 0, 0, 0)
getter = None if getter_name is None else getattr(frame, getter_name) getter = None if getter_name is None else getattr(frame, getter_name)
# FIXME needed? # FIXME:qtwebengine needed?
# self._widget.setFocus() # self._widget.setFocus()
for _ in range(count): for _ in range(count):

View File

@ -95,7 +95,7 @@ class WebView(QWebView):
self.progress = 0 self.progress = 0
self.registry = objreg.ObjectRegistry() self.registry = objreg.ObjectRegistry()
self._tab_id = tab_id self._tab_id = tab_id
# FIXME:refactor stop registering it here # FIXME:qtwebengine stop registering it here
tab_registry = objreg.get('tab-registry', scope='window', tab_registry = objreg.get('tab-registry', scope='window',
window=win_id) window=win_id)
tab_registry[self._tab_id] = self tab_registry[self._tab_id] = self