[Xfce4-commits] <thunar:master> Fix typos in the item count function; Use 0777 for dirs, 0666 for files.

Jannis Pohlmann jannis at xfce.org
Thu Sep 3 14:50:01 CEST 2009


Updating branch refs/heads/master
         to eac80339bb926e833181878dfea6387e2c4bf9c1 (commit)
       from 5432039399f2c5ba235d9ebefbd6c80e2559de83 (commit)

commit eac80339bb926e833181878dfea6387e2c4bf9c1
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Thu Sep 3 14:47:09 2009 +0200

    Fix typos in the item count function; Use 0777 for dirs, 0666 for files.
    
    We probably don't want to set the executable flag for files if we don't
    know their UNIX mode. Using 0666 for files prevents Thunar from trying
    to execute those files. We still need 0777 for directories though
    because only with the execute bit, one can browse a directory.

 thunar/thunar-file.c |    8 ++++----
 thunar/thunar-file.h |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index 7824047..ee1a232 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -1864,7 +1864,7 @@ thunar_file_get_mode (const ThunarFile *file)
   if (g_file_info_has_attribute (file->info, G_FILE_ATTRIBUTE_UNIX_MODE))
     return g_file_info_get_attribute_uint32 (file->info, G_FILE_ATTRIBUTE_UNIX_MODE);
   else
-    return 0777;
+    return thunar_file_is_directory (file) ? 0777 : 0666;
 }
 
 
@@ -2298,13 +2298,13 @@ thunar_file_get_original_path (const ThunarFile *file)
  * Return value: number of files in the trash if @file is the trash 
  *               root dir, 0 otherwise.
  **/
-const gchar *
+guint32
 thunar_file_get_item_count (const ThunarFile *file)
 {
-  _thunar_return_val_if_fail (THUNAR_IS_FILE (file), NULL);
+  _thunar_return_val_if_fail (THUNAR_IS_FILE (file), 0);
 
   if (file->info == NULL)
-    return NULL;
+    return 0;
 
   return g_file_info_get_attribute_uint32 (file->info, 
                                            G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT);
diff --git a/thunar/thunar-file.h b/thunar/thunar-file.h
index 3a98b57..7bd9887 100644
--- a/thunar/thunar-file.h
+++ b/thunar/thunar-file.h
@@ -204,7 +204,7 @@ const gchar      *thunar_file_get_display_name     (const ThunarFile       *file
 gchar            *thunar_file_get_deletion_date    (const ThunarFile       *file,
                                                     ThunarDateStyle         date_style) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
 const gchar      *thunar_file_get_original_path    (const ThunarFile       *file);
-guint64           thunar_file_get_trash_item_count (const ThunarFile       *file);
+guint32           thunar_file_get_trash_item_count (const ThunarFile       *file);
 
 gboolean          thunar_file_is_chmodable         (const ThunarFile       *file);
 gboolean          thunar_file_is_renameable        (const ThunarFile       *file);



More information about the Xfce4-commits mailing list