~ubuntu-branches/ubuntu/precise/gnome-do/precise-backports

« back to all changes in this revision

Viewing changes to Do.Addins/src/Paths.cs

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2008-04-14 21:36:12 UTC
  • mfrom: (0.1.2 lenny) (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080414213612-j6izjrqjsd4f4ulo
* Initial Debian package (closes: #474022)
* debian/patches/02_use_cli_for_wrapper:
  + Patch upstream's wrapper to call /usr/bin/cli rather than mono
* debian/patches/01_fix_libX11_linkage:
  + Link libdo against libX11; fix undefined symbol warnings.
* debian/patches/03_show_in_all_DEs:
  + Show the launcher in all desktop environments; it's useful in XFCE
  and KDE as well as GNOME.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
                static Paths ()
34
34
                {
35
 
                        if (File.Exists (Temp))
36
 
                                File.Delete (Temp);
 
35
                        if (File.Exists (Temp)) {
 
36
                                try {
 
37
                                        File.Delete (Temp);
 
38
                                } catch (Exception e) {
 
39
                                        Console.Error.WriteLine ("Could not delete temporary directory {0}: {1}",
 
40
                                                Temp, e.Message);
 
41
                                }
 
42
                        }
37
43
 
38
 
                        CreateDirs (ApplicationData, Temp);
 
44
                        CreateDirs (ApplicationData, UserData, UserPlugins, Temp);
39
45
                }
40
46
 
41
47
                private static void CreateDirs (string first, params string [] rest)
42
48
                {
43
 
                        if (!Directory.Exists (first))
44
 
                                Directory.CreateDirectory (first);
 
49
                        if (!Directory.Exists (first)) {
 
50
                                try {
 
51
                                        Directory.CreateDirectory (first);
 
52
                                } catch (Exception e) {
 
53
                                        Console.Error.WriteLine ("Failed to create directory {0}: {1}",
 
54
                                                first, e.Message);
 
55
                                }
 
56
                        }
45
57
 
46
 
                        foreach (string dir in rest)
47
 
                                if (!Directory.Exists (dir))
48
 
                                        Directory.CreateDirectory (dir);
 
58
                        foreach (string dir in rest) {
 
59
                                if (!Directory.Exists (dir)) {
 
60
                                        try {
 
61
                                                Directory.CreateDirectory (dir);
 
62
                                        } catch (Exception e) {
 
63
                                                Console.Error.WriteLine ("Failed to create directory {0}: {1}",
 
64
                                                        dir, e.Message);
 
65
                                        }
 
66
                                }
 
67
                        }
49
68
                }
50
69
 
51
70
                public static string ReadXdgUserDir (string key, string fallback)
84
103
                                                        } else if (!path.StartsWith ("/")) {
85
104
                                                                relative = true;
86
105
                                                        }
87
 
 
88
106
                                                        return relative ? Path.Combine (home_dir, path) : path;
89
107
                                                }
90
108
                                        }
91
109
                                }
92
110
                        } catch (FileNotFoundException) {
93
111
                        }
94
 
 
95
112
                        return Path.Combine (home_dir, fallback);
96
113
                }
97
114