Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
path: root/browser.py
diff options
authorManuel Kaufmann <humitos@gmail.com>2012-11-01 16:18:32 (GMT)
committer Manuel QuiƱones <manuq@laptop.org>2012-11-23 13:26:14 (GMT)
commit28967561e9ac277fb37e0ec209d5050cc90f8e38 (patch)
treea3a6a7ffa4eab224e7fb17ff721cda36cd69b3d5 /browser.py
parent2d8178affd16026923c726c2164bb1e2783b8577 (diff)
Title of media files SL #3934
When a plugin handles the request, for example to play an .ogg file, WebKit sets the title as 'None' and '__load_status_changed_cb' is not called when status is 'WebKit.LoadStatus.FINISHED', so the title is not set as 'Untitled'. This patch checks if the title is 'None' (because of the case mentioned above) and sets it as the 'os.path.basename' of the 'WebKit.WebView.props.uri' (the name of the filename). Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Acked-by: Manuel QuiƱones <manuq@laptop.org>
Diffstat (limited to 'browser.py')
1 files changed, 6 insertions, 3 deletions
diff --git a/browser.py b/browser.py
index a97e736..2838528 100644
--- a/browser.py
+++ b/browser.py
@@ -451,9 +451,12 @@ class TabLabel(Gtk.HBox):
def __title_changed_cb(self, widget, param):
- if widget.props.title:
- self._label.set_text(widget.props.title)
- self._title = widget.props.title
+ title = widget.props.title
+ if not title:
+ title = os.path.basename(widget.props.uri)
+ self._label.set_text(title)
+ self._title = title
def __load_status_changed_cb(self, widget, param):
status = widget.get_load_status()