Merge lp:~jeremywootten/pantheon-files/fix-get_display_target_uri into lp:~elementary-apps/pantheon-files/trunk

Proposed by Jeremy Wootten
Status: Merged
Approved by: Corentin Noël
Approved revision: 2391
Merged at revision: 2400
Proposed branch: lp:~jeremywootten/pantheon-files/fix-get_display_target_uri
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 33 lines (+11/-2)
2 files modified
libcore/gof-file.c (+10/-1)
libcore/pantheon-files-core-C.vapi (+1/-1)
To merge this branch: bzr merge lp:~jeremywootten/pantheon-files/fix-get_display_target_uri
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+312414@code.launchpad.net

Commit message

Fix ownership issue with gof_file_get_display_target_uri and pantheon-files-core.vapi

Description of the change

This branch corrects an ownership/nullabilty error in the core .vapi file.

The function gof_file_get_display_target_uri now always returns an owned string (previously null was possible although the .vapi did not recognise this)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libcore/gof-file.c'
2--- libcore/gof-file.c 2016-11-06 14:42:31 +0000
3+++ libcore/gof-file.c 2016-12-03 12:12:57 +0000
4@@ -2598,7 +2598,16 @@
5 char*
6 gof_file_get_display_target_uri (GOFFile *file)
7 {
8- return g_file_info_get_attribute_as_string (file->info, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI);
9+ /* This returns a string that requires freeing */
10+ gchar* uri;
11+
12+ uri = g_file_info_get_attribute_as_string (file->info, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI);
13+
14+ if (uri == NULL) {
15+ uri = strdup (file->uri);
16+ }
17+
18+ return uri;
19 }
20
21 const gchar *
22
23=== modified file 'libcore/pantheon-files-core-C.vapi'
24--- libcore/pantheon-files-core-C.vapi 2016-09-24 15:52:11 +0000
25+++ libcore/pantheon-files-core-C.vapi 2016-12-03 12:12:57 +0000
26@@ -333,7 +333,7 @@
27 public bool is_smb_uri_scheme ();
28 public bool is_connected;
29
30- public unowned string get_display_target_uri ();
31+ public string get_display_target_uri ();
32
33 public GLib.AppInfo get_default_handler ();
34

Subscribers

People subscribed via source and target branches

to all changes: