From a83c471d00dbacc8c4f77493ee9d81cdff69c056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Stadler?= Date: Wed, 26 Sep 2012 01:41:22 +0200 Subject: [PATCH] Fix crash when copying row to clipboard --- debug-viewer/GstDebugViewer/GUI/window.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/debug-viewer/GstDebugViewer/GUI/window.py b/debug-viewer/GstDebugViewer/GUI/window.py index bad88c7f18..b025fb17c5 100644 --- a/debug-viewer/GstDebugViewer/GUI/window.py +++ b/debug-viewer/GstDebugViewer/GUI/window.py @@ -611,11 +611,14 @@ class Window (object): @action def handle_edit_copy_line_action_activate (self, action): - # TODO: Should probably copy the _exact_ line as taken from the file. + line_index = self.get_active_line_index () + model = self.log_view.get_model () + line_offset = model.line_offsets[line_index] - line = self.get_active_line () - log_line = Data.LogLine (line) - self.clipboard.set_text (log_line.line_string ()) + line_text = model.access_offset (line_offset).strip () + line_text = Data.strip_escape (line_text) + + self.clipboard.set_text (line_text) @action def handle_edit_copy_message_action_activate (self, action):