Merge lp:~mterry/unity-greeter/garbage-state into lp:unity-greeter

Proposed by Michael Terry
Status: Merged
Approved by: Robert Ancell
Approved revision: 431
Merged at revision: 431
Proposed branch: lp:~mterry/unity-greeter/garbage-state
Merge into: lp:unity-greeter
Diff against target: 41 lines (+5/-5)
1 file modified
src/unity-greeter.vala (+5/-5)
To merge this branch: bzr merge lp:~mterry/unity-greeter/garbage-state
Reviewer Review Type Date Requested Status
Robert Ancell Approve
Review via email: mp+107829@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unity-greeter.vala'
2--- src/unity-greeter.vala 2012-04-20 16:50:55 +0000
3+++ src/unity-greeter.vala 2012-05-29 16:45:24 +0000
4@@ -36,7 +36,7 @@
5
6 private static Timer log_timer;
7
8- private File state_file;
9+ private string state_file;
10 private KeyFile state;
11
12 private static Cairo.XlibSurface background_surface;
13@@ -119,16 +119,16 @@
14 var state_dir = Path.build_filename (Environment.get_user_cache_dir (), "unity-greeter");
15 DirUtils.create_with_parents (state_dir, 0775);
16
17- state_file = File.new_for_path (Path.build_filename (state_dir, "state"));
18+ state_file = Path.build_filename (state_dir, "state");
19 state = new KeyFile ();
20 try
21 {
22- state.load_from_file (state_file.get_path (), KeyFileFlags.NONE);
23+ state.load_from_file (state_file, KeyFileFlags.NONE);
24 }
25 catch (Error e)
26 {
27 if (!(e is FileError.NOENT))
28- warning ("Failed to load state from %s: %s\n", state_file.get_path (), e.message);
29+ warning ("Failed to load state from %s: %s\n", state_file, e.message);
30 }
31 var last_user = "";
32 try
33@@ -490,7 +490,7 @@
34 var data = state.to_data ();
35 try
36 {
37- state_file.replace_contents ((uint8[])data, null, false, FileCreateFlags.NONE, null);
38+ FileUtils.set_contents (state_file, data);
39 }
40 catch (Error e)
41 {

Subscribers

People subscribed via source and target branches