[Github-comments] [geany/geany] Context menu update (#2550)

Matthew Brush notifications at xxxxx
Sat Jul 18 00:59:45 UTC 2020


@codebrainz commented on this pull request.



> @@ -455,6 +455,30 @@ static void on_close_documents_right_activate(GtkMenuItem *menuitem, GeanyDocume
 }
 
 
+static void on_copy_filename_to_clipboard_activate(GtkMenuItem *menuitem, GeanyDocument *doc)
+{
+		g_return_if_fail(doc->is_valid);
+
+		gtk_clipboard_set_text(gtk_clipboard_get(GDK_NONE), g_path_get_basename(doc->real_path), -1);

Yep, except it needs to be a pointer (`*`) to the first character of the sequence of characters that makes up the string. This should probably do (untested):

```c
gchar *path = g_path_get_base(doc->real_path);
gtk_clipboard_set_text(gtk_clipboard_get(GDK_NONE), path, -1);
g_free(path);
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2550#discussion_r456729110
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20200717/2f958e1d/attachment.htm>


More information about the Github-comments mailing list