Merge lp:~darcy-develin/scratch/fix-1046534 into lp:~elementary-apps/scratch/scratch

Proposed by Darcy Luís Neves Brás da Silva
Status: Merged
Merged at revision: 867
Proposed branch: lp:~darcy-develin/scratch/fix-1046534
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 30 lines (+12/-2)
1 file modified
src/Scratch.vala (+12/-2)
To merge this branch: bzr merge lp:~darcy-develin/scratch/fix-1046534
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve
Review via email: mp+123164@code.launchpad.net

Description of the change

fix bug #1046534 by using a File to get a display_name that is appropriate for presentation opposed to the original one that is still encoded as uri

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

Approved on the ML by mefrio.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Scratch.vala'
--- src/Scratch.vala 2012-08-07 14:20:48 +0000
+++ src/Scratch.vala 2012-09-06 20:39:21 +0000
@@ -127,14 +127,24 @@
127 }127 }
128 }128 }
129129
130 /* Is not open
131 * filename is still encoded as uri, so a file is created
132 * to extract a decoded version/display_name
133 */
134
135 var f = File.new_for_uri(filename);
136 string decoded_filename = f.query_info(FileAttribute.STANDARD_DISPLAY_NAME, FileQueryInfoFlags.NONE).get_display_name();
137 f.unref();
138
130 current_directory = Path.get_dirname (filename);139 current_directory = Path.get_dirname (filename);
131 var document = new Document(filename, window);140 /* use the decoded version for presentation */
141 var document = new Document(decoded_filename, window);
132 document.create_sourceview ();142 document.create_sourceview ();
133 documents.append (document);143 documents.append (document);
134 document.closed.connect( (doc) => { documents.remove(doc); });144 document.closed.connect( (doc) => { documents.remove(doc); });
135 document.tab.make_backup ();145 document.tab.make_backup ();
136 window.current_notebook.set_tab ();146 window.current_notebook.set_tab ();
137 window.set_window_title (filename);147 window.set_window_title (decoded_filename);
138 return document;148 return document;
139149
140 }150 }

Subscribers

People subscribed via source and target branches