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

« back to all changes in this revision

Viewing changes to Do.Addins/src/Do.Universe/FileItem.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:
33
33
        /// </summary>
34
34
        public class FileItem : IFileItem, IOpenableItem {
35
35
                
 
36
                static FileItem ()
 
37
                {
 
38
                        Gnome.Vfs.Vfs.Initialize ();
 
39
                }
 
40
 
36
41
                /// <summary>
37
42
                /// Abbreviates an absolute path by replacing $HOME with ~.
38
43
                /// </summary>
44
49
                /// </returns>
45
50
                public static string ShortPath (string path)
46
51
                {
47
 
                        string home;
48
 
                        
49
 
                        path = path ?? "";
50
 
                        home = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
51
 
                        path = path.Replace (home, "~");
52
 
                        return path;
 
52
                        if (null == path)
 
53
                                throw new ArgumentNullException ();
 
54
 
 
55
                        return path.Replace (Paths.UserHome, "~");
53
56
                }
54
57
                
55
58
                public static bool IsExecutable (IFileItem fi)
65
68
                        if (Directory.Exists (path)) return false;
66
69
 
67
70
                        info = new UnixFileInfo (path);
68
 
                        return (info.FileAccessPermissions & FileAccessPermissions.UserExecute) != 0;
 
71
                        return (info.FileAccessPermissions &
 
72
                                FileAccessPermissions.UserExecute) != 0;
69
73
                }
70
74
                
71
75
                public static bool IsHidden (IFileItem fi)