[Cxplorer-cvs 01022] CVS update: cxplorer/src

Back to archive index

Yasumichi Akahoshi yasum****@users*****
2005年 4月 11日 (月) 23:02:44 JST


Index: cxplorer/src/cxp-property-dialog.c
diff -u cxplorer/src/cxp-property-dialog.c:1.1 cxplorer/src/cxp-property-dialog.c:1.2
--- cxplorer/src/cxp-property-dialog.c:1.1	Wed Apr  6 20:05:58 2005
+++ cxplorer/src/cxp-property-dialog.c	Mon Apr 11 23:02:44 2005
@@ -5,7 +5,7 @@
  * A widget of Property dialog
  * @author Yasumichi Akahoshi <yasum****@users*****>
  * @date Sun Apr 3 02:53:00 2005
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
  ****************************************************************************/
 
 #ifdef HAVE_CONFIG_H
@@ -14,6 +14,7 @@
 
 #include <cxp.h>
 #include <glib/gi18n.h>
+#include <magic.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -26,6 +27,7 @@
 	INFO_FILENAME = 0,
 	INFO_DIRECTORY,
 	INFO_SIZE,
+	INFO_FILETYPE,
 	INFO_OWNER,
 	INFO_GROUP,
 	INFO_LAST_STATUS_CHANGE,
@@ -101,6 +103,7 @@
 		N_("Filename:"),
 		N_("Place:"),
 		N_("Size:"),
+		N_("Filetype:"),
 		N_("Owner:"),
 		N_("Group:"),
 		N_("last status change:"),
@@ -256,6 +259,7 @@
 	gchar *filename = self->private->filename;
 	GtkWidget **labels = self->private->info_labels;
 	gchar *value;
+	magic_t cookie;
 	struct stat status;
 	struct passwd *spasswd;
 	struct group *sgroup;
@@ -276,6 +280,11 @@
 	gtk_label_set_text(GTK_LABEL(labels[INFO_SIZE]), value);
 	g_free (value);
 
+	cookie = magic_open (MAGIC_NONE);
+	magic_load (cookie, NULL);
+	gtk_label_set_text(GTK_LABEL(labels[INFO_FILETYPE]), magic_file (cookie, filename));
+	magic_close (cookie);
+
 	if((spasswd = getpwuid (status.st_uid)) != NULL)
 	{
 		value = g_strdup (spasswd->pw_name);


Cxplorer-cvs メーリングリストの案内
Back to archive index