[Xfce4-commits] r25283 - squeeze/trunk/libsqueeze
Stephan Arts
stephan at xfce.org
Sun Mar 25 00:15:42 CET 2007
Author: stephan
Date: 2007-03-24 23:15:42 +0000 (Sat, 24 Mar 2007)
New Revision: 25283
Modified:
squeeze/trunk/libsqueeze/builder-settings.c
squeeze/trunk/libsqueeze/builder-settings.h
squeeze/trunk/libsqueeze/command-builder-gnu-tar.c
squeeze/trunk/libsqueeze/command-builder-rar.c
squeeze/trunk/libsqueeze/command-builder-zip.c
Log:
started on implementing builder-settings
Modified: squeeze/trunk/libsqueeze/builder-settings.c
===================================================================
--- squeeze/trunk/libsqueeze/builder-settings.c 2007-03-24 22:51:33 UTC (rev 25282)
+++ squeeze/trunk/libsqueeze/builder-settings.c 2007-03-24 23:15:42 UTC (rev 25283)
@@ -143,6 +143,39 @@
return settings->property_names[n];
}
+void
+lsq_builder_settings_set_property_types(LSQBuilderSettings *settings, ...)
+{
+ g_return_if_fail(!settings->property_names);
+ g_return_if_fail(!settings->property_types);
+
+ GType type;
+ gchar *name;
+ guint size = 0;
+ va_list ap;
+ va_start(ap, settings);
+ while(va_arg(ap, gchar *) && va_arg(ap, GType))
+ {
+ size++;
+ }
+ va_end(ap);
+ GType *types_iter = g_new(GType, size);
+ gchar **names_iter = g_new(gchar *, size);
+
+ settings->n_properties = size;
+ settings->property_names = names_iter;
+ settings->property_types = types_iter;
+
+ va_start(ap, settings);
+ while((name = va_arg(ap, gchar *)) && (type = va_arg(ap, GType)))
+ {
+ *types_iter = type;
+ *names_iter = name;
+ types_iter++;
+ names_iter++;
+ }
+}
+
/********************
* LSQArchive stuff *
********************/
Modified: squeeze/trunk/libsqueeze/builder-settings.h
===================================================================
--- squeeze/trunk/libsqueeze/builder-settings.h 2007-03-24 22:51:33 UTC (rev 25282)
+++ squeeze/trunk/libsqueeze/builder-settings.h 2007-03-24 23:15:42 UTC (rev 25283)
@@ -43,5 +43,6 @@
guint lsq_builder_settings_get_n_properties(LSQBuilderSettings *settings);
GType lsq_builder_settings_get_property_type(LSQBuilderSettings *settings, guint n);
const gchar *lsq_builder_settings_get_property_name(LSQBuilderSettings *settings, guint n);
+void lsq_builder_settings_set_property_types(LSQBuilderSettings *settings, ...);
#endif /* __LIBSQUEEZE_BUILDER_SETTINGS_H__ */
Modified: squeeze/trunk/libsqueeze/command-builder-gnu-tar.c
===================================================================
--- squeeze/trunk/libsqueeze/command-builder-gnu-tar.c 2007-03-24 22:51:33 UTC (rev 25282)
+++ squeeze/trunk/libsqueeze/command-builder-gnu-tar.c 2007-03-24 23:15:42 UTC (rev 25283)
@@ -111,6 +111,19 @@
command_builder->mime_types[3] = "application/x-bzip-compressed-tar";
command_builder->mime_types[4] = "application/x-bzip2-compressed-tar";
command_builder->mime_types[5] = "application/x-tzo";
+
+ lsq_builder_settings_set_property_types(command_builder->settings,
+ _("Rights"), /* rights*/
+ G_TYPE_STRING,
+ _("Owner"), /* owner */
+ G_TYPE_STRING,
+ _("Size"), /* size */
+ G_TYPE_UINT64,
+ _("Date"), /* date */
+ G_TYPE_STRING,
+ _("Time"), /* time */
+ G_TYPE_STRING,
+ NULL);
}
/**
@@ -374,7 +387,7 @@
return FALSE;
}
- if(!TRUE) /*LSQ_ARCHIVE_SUPPORT_GNU_TAR(support)->_view_rights*/
+ if(TRUE) /*LSQ_ARCHIVE_SUPPORT_GNU_TAR(support)->_view_rights*/
{
line[10] = '\0';
props[i] = line;
@@ -383,7 +396,7 @@
for(n=13; n < linesize; ++n)
if(line[n] == ' ') break;
- if(!TRUE) /*LSQ_ARCHIVE_SUPPORT_GNU_TAR(support)->_view_owner*/
+ if(TRUE) /*LSQ_ARCHIVE_SUPPORT_GNU_TAR(support)->_view_owner*/
{
line[n] = '\0';
props[i] = line+11;
@@ -398,7 +411,7 @@
for(; n < linesize; ++n)
if(line[n] == ' ') break;
- if(!TRUE) /*LSQ_ARCHIVE_SUPPORT_GNU_TAR(support)->_view_size*/
+ if(TRUE) /*LSQ_ARCHIVE_SUPPORT_GNU_TAR(support)->_view_size*/
{
line[n] = '\0';
size = g_ascii_strtoull(line + a, NULL, 0);
@@ -411,7 +424,7 @@
for(; n < linesize; n++) // DATE
if(line[n] == ' ') break;
- if(!TRUE) /*LSQ_ARCHIVE_SUPPORT_GNU_TAR(support)->_view_date*/
+ if(TRUE) /*LSQ_ARCHIVE_SUPPORT_GNU_TAR(support)->_view_date*/
{
line[n] = '\0';
props[i] = line + a;
@@ -422,7 +435,7 @@
for (; n < linesize; n++) // TIME
if (line[n] == ' ') break;
- if(!TRUE) /*LSQ_ARCHIVE_SUPPORT_GNU_TAR(support)->_view_time*/
+ if(TRUE) /*LSQ_ARCHIVE_SUPPORT_GNU_TAR(support)->_view_time*/
{
line[n] = '\0';
props[i] = line + a;
Modified: squeeze/trunk/libsqueeze/command-builder-rar.c
===================================================================
--- squeeze/trunk/libsqueeze/command-builder-rar.c 2007-03-24 22:51:33 UTC (rev 25282)
+++ squeeze/trunk/libsqueeze/command-builder-rar.c 2007-03-24 23:15:42 UTC (rev 25283)
@@ -97,6 +97,27 @@
command_builder->mime_types = g_new0(gchar *, 2);
command_builder->mime_types[0] = "application/x-rar";
+
+ lsq_builder_settings_set_property_types(command_builder->settings,
+ _("Compressed"), /* length */
+ G_TYPE_UINT64,
+ _("Size"), /* size */
+ G_TYPE_UINT64,
+ _("Ratio"), /* ratio */
+ G_TYPE_STRING,
+ _("Date"), /* date */
+ G_TYPE_STRING,
+ _("Time"), /* time */
+ G_TYPE_STRING,
+ _("Rights"), /* rights */
+ G_TYPE_STRING,
+ "CRC-32", /* crc-32 */
+ G_TYPE_STRING,
+ _("Method"), /* method */
+ G_TYPE_STRING,
+ _("Version"), /* version*/
+ G_TYPE_STRING,
+ NULL);
}
/**
Modified: squeeze/trunk/libsqueeze/command-builder-zip.c
===================================================================
--- squeeze/trunk/libsqueeze/command-builder-zip.c 2007-03-24 22:51:33 UTC (rev 25282)
+++ squeeze/trunk/libsqueeze/command-builder-zip.c 2007-03-24 23:15:42 UTC (rev 25283)
@@ -102,6 +102,23 @@
command_builder->mime_types = g_new0(gchar *, 3);
command_builder->mime_types[0] = "application/zip";
command_builder->mime_types[1] = "application/x-zip";
+
+ lsq_builder_settings_set_property_types(command_builder->settings,
+ _("Compressed"), /* length */
+ G_TYPE_UINT64,
+ _("Method"), /* method */
+ G_TYPE_STRING,
+ _("Size"), /* size */
+ G_TYPE_UINT64,
+ _("Ratio"), /* ratio */
+ G_TYPE_STRING,
+ _("Date"), /* date */
+ G_TYPE_STRING,
+ _("Time"), /* time */
+ G_TYPE_STRING,
+ "CRC-32", /* crc-32 */
+ G_TYPE_STRING,
+ NULL);
}
/**
@@ -204,7 +221,7 @@
a = n;
for(; n < linesize && line[n] != ' '; n++);
- if(!TRUE)/*LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_length*/
+ if(TRUE)/*LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_length*/
{
line[n]='\0';
length = g_ascii_strtoull(line + a, NULL, 0);
@@ -217,7 +234,7 @@
a = n;
for(; n < linesize && line[n] != ' '; n++);
- if(!TRUE) /*LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_method*/
+ if(TRUE) /*LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_method*/
{
line[n] = '\0';
props[i] = line + a;
@@ -229,7 +246,7 @@
a = n;
for(; n < linesize && line[n] != ' '; n++);
- if(!TRUE) /*LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_size*/
+ if(TRUE) /*LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_size*/
{
line[n]='\0';
size = g_ascii_strtoull(line + a, NULL, 0);
@@ -242,7 +259,7 @@
a = n;
for(; n < linesize && line[n] != ' '; n++);
- if(!TRUE) /*LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_ratio*/
+ if(TRUE) /*LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_ratio*/
{
line[n] = '\0';
props[i] = line + a;
@@ -254,7 +271,7 @@
a = n;
for(; n < linesize && line[n] != ' '; n++);
- if(!TRUE) /*LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_date*/
+ if(TRUE) /*LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_date*/
{
line[n] = '\0';
props[i] = line + a;
@@ -266,7 +283,7 @@
a = n;
for(; n < linesize && line[n] != ' '; n++);
- if(!TRUE) /* LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_time */
+ if(TRUE) /* LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_time */
{
line[n] = '\0';
props[i] = line + a;
@@ -278,7 +295,7 @@
a = n;
for(; n < linesize && line[n] != ' '; n++);
- if(!TRUE) /*LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_crc_32 */
+ if(TRUE) /*LSQ_ARCHIVE_SUPPORT_ZIP(support)->_view_crc_32 */
{
line[n] = '\0';
props[i] = line + a;
More information about the Xfce4-commits
mailing list