Merge lp:~gue5t/midori/menubar-cast into lp:midori

Proposed by gue5t gue5t
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6970
Merged at revision: 6976
Proposed branch: lp:~gue5t/midori/menubar-cast
Merge into: lp:midori
Diff against target: 12 lines (+1/-1)
1 file modified
midori/midori-window.vala (+1/-1)
To merge this branch: bzr merge lp:~gue5t/midori/menubar-cast
Reviewer Review Type Date Requested Status
Paweł Forysiuk Approve
Review via email: mp+262777@code.launchpad.net

Commit message

Fix menubar warning caused by direct cast instead of `as`

Description of the change

With current trunk, Midori prints:

GLib-GObject-WARNING **: invalid cast from 'GtkMenuBar' to 'GtkToolbar'
GLib-GObject-WARNING **: gsignal.c:2451: signal 'popup-context-menu' is invalid for instance '0x97e860' of type 'GtkMenuBar'

because midori-window.vala casts the widget with "(GtkToolbar)" instead of "as GtkToolbar", then checks whether the cast returns null. Only the latter syntax will ever do so, so this changes the code to use it as intended.

To post a comment you must log in.
Revision history for this message
RabbitBot (rabbitbot-a) wrote :

Voting does not meet specified criteria. Required: Approve >= 1. Got: 1 Pending.

Revision history for this message
Paweł Forysiuk (tuxator) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-window.vala'
2--- midori/midori-window.vala 2015-06-13 14:08:59 +0000
3+++ midori/midori-window.vala 2015-06-23 19:07:04 +0000
4@@ -201,7 +201,7 @@
5 }
6
7 public void add_toolbar (Gtk.Widget toolbar) {
8- var _toolbar = (Gtk.Toolbar)toolbar;
9+ var _toolbar = toolbar as Gtk.Toolbar;
10 if (_toolbar != null) {
11 #if HAVE_GTK3
12 get_style_context ().add_class ("secondary-toolbar");

Subscribers

People subscribed via source and target branches

to all changes: