Merge lp:~niclasl/pantheon-terminal/handle-empty-clipboard into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by Niclas Lockner
Status: Merged
Approved by: David Gomes
Approved revision: 562
Merged at revision: 561
Proposed branch: lp:~niclasl/pantheon-terminal/handle-empty-clipboard
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 16 lines (+5/-2)
1 file modified
src/PantheonTerminalWindow.vala (+5/-2)
To merge this branch: bzr merge lp:~niclasl/pantheon-terminal/handle-empty-clipboard
Reviewer Review Type Date Requested Status
David Gomes (community) Approve
Review via email: mp+215853@code.launchpad.net

Commit message

Currently when a Terminal window is created and there's nothing in the clipboard to paste, GTK logs fatal errors.

In this branch, a non-null and non-empty Atom array is required in update_context_menu_cb before calling Gtk.targets_include_text/uri

Description of the change

Currently when a Terminal window is created and there's nothing in the clipboard to paste, GTK logs fatal errors.
In this branch, a non-null and non-empty Atom array is required in update_context_menu_cb before calling Gtk.targets_include_text/uri

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) wrote :

Nicely spotted! Can you just add an empty newline after diff line 13?

review: Needs Fixing
562. By Niclas Lockner

Code-style fix

Revision history for this message
David Gomes (davidgomes) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/PantheonTerminalWindow.vala'
2--- src/PantheonTerminalWindow.vala 2014-04-14 14:00:48 +0000
3+++ src/PantheonTerminalWindow.vala 2014-04-15 14:17:25 +0000
4@@ -367,8 +367,11 @@
5
6 private void update_context_menu_cb (Gtk.Clipboard clipboard_,
7 Gdk.Atom[] atoms) {
8- bool can_paste;
9- can_paste = Gtk.targets_include_text (atoms) || Gtk.targets_include_uri (atoms);
10+ bool can_paste = false;
11+
12+ if (atoms != null && atoms.length > 0)
13+ can_paste = Gtk.targets_include_text (atoms) || Gtk.targets_include_uri (atoms);
14+
15 main_actions.get_action ("Paste").set_sensitive (can_paste);
16 }
17

Subscribers

People subscribed via source and target branches