[Xfce4-commits] <squeeze:master> Compiles with --enable-debug=full
Peter de Ridder
noreply at xfce.org
Sun Aug 21 11:22:03 CEST 2011
Updating branch refs/heads/master
to df82a4963e017ac0a94b6e12e45ba899d8c86f18 (commit)
from 38dcd3b879eacd3e1b090023f97dd52bf82e6426 (commit)
commit df82a4963e017ac0a94b6e12e45ba899d8c86f18
Author: Peter de Ridder <peter at xfce.org>
Date: Sun Aug 21 01:43:36 2011 +0200
Compiles with --enable-debug=full
libsqueeze/archive-command.c | 2 +-
libsqueeze/archive-iter-pool.c | 8 +-
libsqueeze/archive-iter-pool.h | 2 +-
libsqueeze/archive-iter.c | 224 ++++++++++++++++++++++--------------
libsqueeze/archive-tempfs.c | 31 ++++--
libsqueeze/archive.c | 27 +++--
libsqueeze/command-option.c | 9 +-
libsqueeze/command-queue.c | 5 +-
libsqueeze/internals.c | 3 +-
libsqueeze/libsqueeze.c | 22 ++--
libsqueeze/libsqueeze.h | 4 +-
libsqueeze/scanf-parser.c | 135 +++++++++++-----------
libsqueeze/support-factory.c | 2 +-
libsqueeze/support-reader.c | 47 +++++---
libsqueeze/support-template.c | 3 +-
src/application.c | 11 +-
src/archive_store.c | 246 +++++++++++++++++++++++++---------------
src/button_drag_box.c | 2 +-
src/extract_dialog.c | 11 +-
src/main.c | 5 +-
src/main_window.c | 45 +++++---
src/message_dialog.c | 11 +-
src/navigation_bar.c | 2 +-
src/new_dialog.c | 11 +-
src/notebook.c | 57 ++++++----
src/path_bar.c | 6 +-
src/preferences_dialog.c | 4 +-
src/properties_dialog.c | 2 +-
src/settings.c | 4 +-
src/tool_bar.c | 2 +-
src/widget_factory.c | 40 ++++---
31 files changed, 591 insertions(+), 392 deletions(-)
diff --git a/libsqueeze/archive-command.c b/libsqueeze/archive-command.c
index d12fb3e..11e87ee 100644
--- a/libsqueeze/archive-command.c
+++ b/libsqueeze/archive-command.c
@@ -51,7 +51,7 @@ enum
static gint lsq_archive_command_signals[LSQ_ARCHIVE_COMMAND_SIGNAL_COUNT];
GType
-lsq_archive_command_get_type ()
+lsq_archive_command_get_type (void)
{
static GType lsq_archive_command_type = 0;
diff --git a/libsqueeze/archive-iter-pool.c b/libsqueeze/archive-iter-pool.c
index 0dc6c99..04e6d95 100644
--- a/libsqueeze/archive-iter-pool.c
+++ b/libsqueeze/archive-iter-pool.c
@@ -36,7 +36,7 @@ struct _LSQArchiveIterPool
};
LSQArchiveIterPool *
-lsq_archive_iter_pool_new()
+lsq_archive_iter_pool_new(void)
{
return g_new0(LSQArchiveIterPool, 1);
}
@@ -61,7 +61,7 @@ lsq_archive_iter_pool_free(LSQArchiveIterPool *pool)
#else
g_free(pool->pool[i]);
#endif
-#elif USE_GSLICES
+#elif defined(USE_GSLICES)
g_slice_free(LSQArchiveIter, pool->pool[i]);
#else
g_free(pool->pool[i]);
@@ -202,7 +202,7 @@ lsq_archive_iter_pool_get_reserved(LSQArchiveIterPool *pool)
}
LSQArchiveIter *
-lsq_archive_iter_pool_get_iter(LSQArchiveIterPool *pool, gint index)
+lsq_archive_iter_pool_get_iter(LSQArchiveIterPool *pool, gint index_)
{
- return pool->pool[index];
+ return pool->pool[index_];
}
diff --git a/libsqueeze/archive-iter-pool.h b/libsqueeze/archive-iter-pool.h
index 0661681..715cd61 100644
--- a/libsqueeze/archive-iter-pool.h
+++ b/libsqueeze/archive-iter-pool.h
@@ -21,7 +21,7 @@ typedef struct _LSQArchiveIter LSQArchiveIter;
typedef struct _LSQArchiveEntry LSQArchiveEntry;
typedef struct _LSQArchiveIterPool LSQArchiveIterPool;
-LSQArchiveIterPool *lsq_archive_iter_pool_new();
+LSQArchiveIterPool *lsq_archive_iter_pool_new(void);
void lsq_archive_iter_pool_free(LSQArchiveIterPool *pool);
gint lsq_archive_iter_pool_get_size(LSQArchiveIterPool *);
diff --git a/libsqueeze/archive-iter.c b/libsqueeze/archive-iter.c
index abd95fa..b5f36bd 100644
--- a/libsqueeze/archive-iter.c
+++ b/libsqueeze/archive-iter.c
@@ -73,16 +73,24 @@ lsq_archive_entry_get_prop_uint(const LSQArchive *, const LSQArchiveEntry *, gui
inline static guint64
lsq_archive_entry_get_prop_uint64(const LSQArchive *, const LSQArchiveEntry *, guint);
+#if 0
static void
lsq_archive_entry_set_prop_str(const LSQArchive *, LSQArchiveEntry *, guint, const gchar *);
+#endif
+#if 0
static void
lsq_archive_entry_set_prop_uint(const LSQArchive *, LSQArchiveEntry *, guint, guint);
+#endif
+#if 0
static void
lsq_archive_entry_set_prop_uint64(const LSQArchive *, LSQArchiveEntry *, guint, guint64);
+#endif
static void
lsq_archive_entry_set_propsv(const LSQArchive *, LSQArchiveEntry *, gpointer *);
+#if 0
static void
lsq_archive_entry_set_propsva(const LSQArchive *, LSQArchiveEntry *, va_list);
+#endif
struct _LSQArchiveEntry
{
@@ -134,7 +142,7 @@ lsq_archive_iter_new(LSQArchiveEntry *entry, LSQArchiveIter *parent, LSQArchive
iter = g_new(LSQArchiveIter, 1);
#endif
}
-#elif USE_GSLICES
+#elif defined(USE_GSLICES)
iter = g_slice_new(LSQArchiveIter);
#else
iter = g_new(LSQArchiveIter, 1);
@@ -150,12 +158,12 @@ lsq_archive_iter_new(LSQArchiveEntry *entry, LSQArchiveIter *parent, LSQArchive
static LSQArchiveIter *
lsq_archive_iter_get_for_path(LSQArchive *archive, GSList *path)
{
- if(!path)
- return NULL;
-
LSQArchiveIter *iter;
guint pos;
+ if(!path)
+ return NULL;
+
/* iter has been found */
if(lsq_archive_iter_pool_find_iter(archive->pool, path->data, &iter, &pos))
{
@@ -176,13 +184,13 @@ lsq_archive_iter_get_for_path(LSQArchive *archive, GSList *path)
static LSQArchiveIter *
lsq_archive_iter_get_with_archive(LSQArchiveEntry *entry, LSQArchiveIter *parent, LSQArchive *archive)
{
+ LSQArchiveIter *iter;
+ guint pos;
+
#ifdef DEBUG
g_return_val_if_fail(entry, NULL);
#endif
- LSQArchiveIter *iter;
- guint pos;
-
/* iter has been found */
if(lsq_archive_iter_pool_find_iter(archive->pool, entry, &iter, &pos))
{
@@ -205,13 +213,13 @@ lsq_archive_iter_get_with_archive(LSQArchiveEntry *entry, LSQArchiveIter *parent
static LSQArchiveIter *
lsq_archive_iter_get_with_parent(LSQArchiveEntry *entry, LSQArchiveIter *parent)
{
+ LSQArchiveIter *iter;
+ guint pos;
+
#ifdef DEBUG
g_return_val_if_fail(entry, NULL);
#endif
- LSQArchiveIter *iter;
- guint pos;
-
/* iter has been found */
if(lsq_archive_iter_pool_find_iter(parent->archive->pool, entry, &iter, &pos))
{
@@ -248,7 +256,7 @@ lsq_archive_iter_free(LSQArchiveIter *iter)
lsq_archive_iter_unref(iter->parent);
#ifdef USE_LSQITER_SLICES
/* We don't free the poiter we moved it */
-#elif USE_GSLICES
+#elif defined(USE_GSLICES)
g_slice_free(LSQArchiveIter, iter);
#else
g_free(iter);
@@ -324,11 +332,12 @@ lsq_archive_iter_ref(LSQArchiveIter* iter)
gboolean
lsq_archive_iter_is_real(const LSQArchiveIter *iter)
{
+ const LSQArchiveIter *parent;
#ifdef DEBUG
g_return_val_if_fail(iter, FALSE);
#endif
/* reverse the parent list */
- const LSQArchiveIter *parent = iter->parent;
+ parent = iter->parent;
if(G_UNLIKELY(!parent))
{
/* the root entry is archive root entry */
@@ -347,13 +356,16 @@ lsq_archive_iter_is_real(const LSQArchiveIter *iter)
LSQArchiveIter *
lsq_archive_iter_get_real_parent(LSQArchiveIter *iter)
{
+ GSList *back_stack = NULL;
+ GSList *back_iter;
+ LSQArchiveIter *parent;
+ LSQArchiveEntry *entry;
+ GSList *list;
#ifdef DEBUG
g_return_val_if_fail(iter, NULL);
#endif
/* reverse the parent list */
- GSList *back_stack = NULL;
- GSList *back_iter;
- LSQArchiveIter *parent = iter;
+ parent = iter;
while(parent)
{
back_stack = g_slist_prepend(back_stack, parent);
@@ -366,8 +378,7 @@ lsq_archive_iter_get_real_parent(LSQArchiveIter *iter)
g_slist_free(back_stack);
return lsq_archive_iter_get_with_archive(iter->archive->root_entry, NULL, iter->archive);
}
- LSQArchiveEntry *entry;
- GSList *list = g_slist_prepend(NULL, entry = iter->archive->root_entry);
+ list = g_slist_prepend(NULL, entry = iter->archive->root_entry);
/* find the childeren */
for(back_iter = g_slist_next(back_stack); back_iter; back_iter = g_slist_next(back_iter))
{
@@ -422,15 +433,14 @@ lsq_archive_iter_n_children(const LSQArchiveIter *iter)
LSQArchiveIter *
lsq_archive_iter_nth_child(LSQArchiveIter *parent, guint n)
{
+ LSQArchiveEntry *entry;
+ LSQArchiveIter *iter;
#ifdef DEBUG
g_return_val_if_fail(parent, NULL);
- g_return_val_if_fail(n >= 0, NULL); /* this can never be, it's unsigned */
#endif
if(n >= lsq_archive_entry_n_children(parent->entry))
return NULL;
- LSQArchiveEntry *entry;
- LSQArchiveIter *iter;
lsq_archive_entry_flush_buffer(parent->entry);
entry = lsq_archive_entry_nth_child(parent->entry, n);
iter = lsq_archive_iter_get_with_parent(entry, parent);
@@ -440,17 +450,18 @@ lsq_archive_iter_nth_child(LSQArchiveIter *parent, guint n)
LSQArchiveIter *
lsq_archive_iter_get_child(LSQArchiveIter *parent, const gchar *filename)
{
+ LSQArchiveEntry *entry;
+ LSQArchiveIter *iter;
#ifdef DEBUG
g_return_val_if_fail(parent, NULL);
g_return_val_if_fail(filename, NULL);
#endif
- LSQArchiveEntry *entry;
- LSQArchiveIter *iter;
entry = lsq_archive_entry_get_child(parent->entry, filename);
iter = lsq_archive_iter_get_with_parent(entry, parent);
return iter;
}
+#if 0
LSQArchiveIter *
lsq_archive_iter_add_file(LSQArchiveIter *parent, const gchar *filename)
{
@@ -466,16 +477,18 @@ lsq_archive_iter_add_file(LSQArchiveIter *parent, const gchar *filename)
iter = lsq_archive_iter_get_with_parent(entry, parent);
return iter;
}
+#endif
void
lsq_archive_iter_remove(LSQArchiveIter *iter, gboolean recursive)
{
+ LSQArchiveIter *prev_iter;
#ifdef DEBUG
g_return_if_fail(iter);
/* don't remove root entry */
g_return_if_fail(iter->parent);
#endif
- LSQArchiveIter *prev_iter = iter;
+ prev_iter = iter;
iter = iter->parent;
if(lsq_archive_entry_n_children(iter->entry) == 0)
@@ -483,6 +496,7 @@ lsq_archive_iter_remove(LSQArchiveIter *iter, gboolean recursive)
if(recursive)
{
+ gboolean result;
while(iter->parent)
{
if(iter->entry->props || lsq_archive_entry_n_children(iter->entry) > 1)
@@ -492,7 +506,7 @@ lsq_archive_iter_remove(LSQArchiveIter *iter, gboolean recursive)
iter = iter->parent;
}
- gboolean result = lsq_archive_entry_remove_child(iter->entry, lsq_archive_entry_get_filename(prev_iter->entry));
+ result = lsq_archive_entry_remove_child(iter->entry, lsq_archive_entry_get_filename(prev_iter->entry));
if(result && !lsq_archive_iter_pool_find_iter(prev_iter->archive->pool, prev_iter->entry, NULL, NULL))
{
lsq_archive_entry_free(prev_iter->archive, prev_iter->entry);
@@ -511,10 +525,12 @@ lsq_archive_iter_remove(LSQArchiveIter *iter, gboolean recursive)
guint
lsq_archive_iter_get_depth(const LSQArchiveIter *iter)
{
+ guint depth = 0;
+
#ifdef DEBUG
g_return_val_if_fail(iter, 0);
#endif
- guint depth = 0;
+
while(iter)
{
iter = iter->parent;
@@ -526,12 +542,15 @@ lsq_archive_iter_get_depth(const LSQArchiveIter *iter)
gchar*
lsq_archive_iter_get_path(const LSQArchiveIter *iter)
{
+ const gchar **list;
+ gchar *path;
+ guint depth;
+
#ifdef DEBUG
g_return_val_if_fail(iter, NULL);
#endif
- const gchar **list;
- gchar *path;
- guint depth = lsq_archive_iter_get_depth(iter);
+
+ depth = lsq_archive_iter_get_depth(iter);
if(lsq_archive_iter_is_directory(iter))
{
@@ -610,6 +629,7 @@ lsq_archive_iter_get_prop_value(const LSQArchiveIter *iter, guint n, GValue *val
return TRUE;
}
+#if 0
void
lsq_archive_iter_set_prop_value(LSQArchiveIter *iter, guint n, const GValue *value)
{
@@ -633,7 +653,9 @@ lsq_archive_iter_set_prop_value(LSQArchiveIter *iter, guint n, const GValue *val
break;
}
}
+#endif
+#if 0
void
lsq_archive_iter_set_prop(LSQArchiveIter *iter, guint n, gconstpointer value)
{
@@ -656,18 +678,21 @@ lsq_archive_iter_set_prop(LSQArchiveIter *iter, guint n, gconstpointer value)
break;
}
}
+#endif
+#if 0
void
lsq_archive_iter_set_props(LSQArchiveIter *iter, ...)
{
+ va_list ap;
#ifdef DEBUG
g_return_if_fail(iter);
#endif
- va_list ap;
va_start(ap, iter);
lsq_archive_entry_set_propsva(iter->archive, iter->entry, ap);
va_end(ap);
}
+#endif
void
lsq_archive_iter_set_propsv(LSQArchiveIter *iter, gpointer *props)
@@ -683,17 +708,21 @@ lsq_archive_iter_set_propsv(LSQArchiveIter *iter, gpointer *props)
LSQArchiveIter *
lsq_archive_get_iter(LSQArchive *archive, const gchar *path)
{
+ gchar **buf;
+ gchar **iter;
+ LSQArchiveEntry *entry;
+ GSList *list;
+ LSQArchiveIter *aiter;
#ifdef debug
g_return_val_if_fail(archive, NULL);
#endif
if(!path)
return lsq_archive_iter_get_with_archive(archive->root_entry, NULL, archive);
- gchar **buf = g_strsplit_set(path, "/\n", -1);
- gchar **iter = buf;
- LSQArchiveEntry *entry = archive->root_entry;
- GSList *list = g_slist_prepend(NULL, entry);
- LSQArchiveIter *aiter;
+ buf = g_strsplit_set(path, "/\n", -1);
+ iter = buf;
+ entry = archive->root_entry;
+ list = g_slist_prepend(NULL, entry);
/* ignore '/' if we have no '/' in archive */
if(path[0] == '/' && lsq_archive_entry_get_child(archive->root_entry, "/"))
@@ -730,37 +759,41 @@ lsq_archive_get_iter(LSQArchive *archive, const gchar *path)
LSQArchiveIter *
lsq_archive_add_file(LSQArchive *archive, const gchar *path)
{
+ gchar **buf;
+ gchar **iter;
+ LSQArchiveEntry *parent;
+ LSQArchiveEntry *child;
+ gchar *basefname;
+ GSList *list;
+ LSQArchiveIter *aiter;
#ifdef debug
g_return_val_if_fail(archive, NULL);
#endif
if(!path)
return lsq_archive_iter_get_with_archive(archive->root_entry, NULL, archive);
- gchar **buf = g_strsplit_set(path, "/\n", -1);
- gchar **iter = buf;
- LSQArchiveEntry *parent = archive->root_entry;
- LSQArchiveEntry *child;
- gchar *basename;
- GSList *list = g_slist_prepend(NULL, parent);
- LSQArchiveIter *aiter;
+ buf = g_strsplit_set(path, "/\n", -1);
+ iter = buf;
+ parent = archive->root_entry;
+ list = g_slist_prepend(NULL, parent);
while(*iter)
{
- basename = g_strconcat(*iter, *(iter+1)?"/":NULL, NULL);
+ basefname = g_strconcat(*iter, *(iter+1)?"/":NULL, NULL);
- if(basename[0] != '\0')
+ if(basefname[0] != '\0')
{
- child = lsq_archive_entry_get_child(parent, basename);
+ child = lsq_archive_entry_get_child(parent, basefname);
if(!child)
- child = lsq_archive_entry_add_child(parent, basename);
+ child = lsq_archive_entry_add_child(parent, basefname);
list = g_slist_prepend(list, child);
parent = child;
}
- g_free(basename);
+ g_free(basefname);
iter++;
}
@@ -776,15 +809,20 @@ lsq_archive_add_file(LSQArchive *archive, const gchar *path)
gboolean
lsq_archive_remove_file(LSQArchive *archive, const gchar *path)
{
+ gchar **buf;
+ gchar **iter;
+ LSQArchiveEntry *entry;
+ GSList *prev_iter, *stack_iter, *stack = NULL;
+ gboolean result;
+
#ifdef DEBUG
g_return_val_if_fail(archive, FALSE);
g_return_val_if_fail(path, FALSE);
#endif
- gchar **buf = g_strsplit_set(path, "/\n", -1);
- gchar **iter = buf;
- LSQArchiveEntry *entry = archive->root_entry;
- GSList *prev_iter, *stack_iter, *stack = NULL;
+ buf = g_strsplit_set(path, "/\n", -1);
+ iter = buf;
+ entry = archive->root_entry;
if(path[0] == '/' && lsq_archive_entry_get_child(archive->root_entry, "/"))
{
@@ -829,7 +867,7 @@ lsq_archive_remove_file(LSQArchive *archive, const gchar *path)
entry = archive->root_entry;
}
- gboolean result = lsq_archive_entry_remove_child(entry, lsq_archive_entry_get_filename((LSQArchiveEntry*)prev_iter->data));
+ result = lsq_archive_entry_remove_child(entry, lsq_archive_entry_get_filename((LSQArchiveEntry*)prev_iter->data));
if(result && !lsq_archive_iter_pool_find_iter(archive->pool, prev_iter->data, NULL, NULL))
{
lsq_archive_entry_free(archive, entry);
@@ -892,14 +930,14 @@ lsq_archive_entry_props_free(const LSQArchive *archive, LSQArchiveEntry *entry)
case(G_TYPE_STRING):
/* free only strings */
g_free(*(gchar **)props_iter);
- *(gchar **)props_iter = (gchar *)0x1;
- props_iter += sizeof(gchar *);
+ *(gchar **)props_iter = NULL;
+ props_iter = ((gchar **)props_iter) + 1;
break;
case(G_TYPE_UINT):
- props_iter += sizeof(guint);
+ props_iter = ((guint *)props_iter) + 1;
break;
case(G_TYPE_UINT64):
- props_iter += sizeof(guint64);
+ props_iter = ((guint64 *)props_iter) + 1;
break;
}
}
@@ -1014,20 +1052,24 @@ lsq_archive_entry_nth_child(const LSQArchiveEntry *entry, guint n)
inline static void
lsq_archive_entry_flush_buffer(LSQArchiveEntry *entry)
{
- if(!entry->buffer)
- return;
-
- guint max_children = 0;
+ guint max_children;
guint begin = 1;
guint pos = 0;
gint cmp = 1;
guint old_i = 1;
guint new_i = 1;
- /* the first element of the array (*entry->children) contains the size of the array */
- guint size = entry->children?GPOINTER_TO_UINT(*entry->children):0;
- guint n_children = size;
+ guint size;
+ guint n_children;
LSQSList *buffer_iter = NULL;
- LSQArchiveEntry **children_old = (LSQArchiveEntry **)entry->children;
+ LSQArchiveEntry **children_old;
+
+ if(!entry->buffer)
+ return;
+
+ /* the first element of the array (*entry->children) contains the size of the array */
+ size = entry->children?GPOINTER_TO_UINT(*entry->children):0;
+ n_children = size;
+ children_old = (LSQArchiveEntry **)entry->children;
max_children = (n_children + lsq_slist_length(entry->buffer));
@@ -1268,13 +1310,13 @@ lsq_archive_entry_get_prop_str(const LSQArchive *archive, const LSQArchiveEntry
switch(lsq_archive_get_entry_property_type(archive, n+LSQ_ARCHIVE_PROP_USER))
{
case G_TYPE_STRING:
- props_iter += sizeof(gchar *);
+ props_iter = ((gchar **)props_iter) + 1;;
break;
case G_TYPE_UINT:
- props_iter += sizeof(guint);
+ props_iter = ((guint *)props_iter) + 1;;
break;
case G_TYPE_UINT64:
- props_iter += sizeof(guint64);
+ props_iter = ((guint64 *)props_iter) + 1;;
break;
}
}
@@ -1297,13 +1339,13 @@ lsq_archive_entry_get_prop_uint(const LSQArchive *archive, const LSQArchiveEntry
switch(lsq_archive_get_entry_property_type(archive, n))
{
case G_TYPE_STRING:
- props_iter += sizeof(gchar *);
+ props_iter = ((gchar **)props_iter) + 1;;
break;
case G_TYPE_UINT:
- props_iter += sizeof(guint);
+ props_iter = ((guint *)props_iter) + 1;;
break;
case G_TYPE_UINT64:
- props_iter += sizeof(guint64);
+ props_iter = ((guint64 *)props_iter) + 1;;
break;
}
}
@@ -1322,13 +1364,13 @@ lsq_archive_entry_get_prop_uint64(const LSQArchive *archive, const LSQArchiveEnt
switch(lsq_archive_get_entry_property_type(archive, n+LSQ_ARCHIVE_PROP_USER))
{
case G_TYPE_STRING:
- props_iter += sizeof(gchar *);
+ props_iter = ((gchar **)props_iter) + 1;;
break;
case G_TYPE_UINT:
- props_iter += sizeof(guint);
+ props_iter = ((guint *)props_iter) + 1;;
break;
case G_TYPE_UINT64:
- props_iter += sizeof(guint64);
+ props_iter = ((guint64 *)props_iter) + 1;;
break;
}
}
@@ -1365,6 +1407,7 @@ lsq_archive_entry_get_props(const LSQArchive *archive, LSQArchiveEntry *entry)
return entry->props;
}
+#if 0
static void
lsq_archive_entry_set_prop_str(const LSQArchive *archive, LSQArchiveEntry *entry, guint n, const gchar *str_val)
{
@@ -1376,20 +1419,22 @@ lsq_archive_entry_set_prop_str(const LSQArchive *archive, LSQArchiveEntry *entry
switch(lsq_archive_get_entry_property_type(archive, i+LSQ_ARCHIVE_PROP_USER))
{
case G_TYPE_STRING:
- props_iter += sizeof(gchar *);
+ props_iter = ((gchar **)props_iter) + 1;;
break;
case G_TYPE_UINT:
- props_iter += sizeof(guint);
+ props_iter = ((guint *)props_iter) + 1;;
break;
case G_TYPE_UINT64:
- props_iter += sizeof(guint64);
+ props_iter = ((guint64 *)props_iter) + 1;;
break;
}
}
g_free(*((gchar **)props_iter));
(*((gchar **)props_iter)) = g_strdup(str_val);
}
+#endif
+#if 0
static void
lsq_archive_entry_set_prop_uint(const LSQArchive *archive, LSQArchiveEntry *entry, guint n, guint int_val)
{
@@ -1401,19 +1446,21 @@ lsq_archive_entry_set_prop_uint(const LSQArchive *archive, LSQArchiveEntry *entr
switch(lsq_archive_get_entry_property_type(archive, i+LSQ_ARCHIVE_PROP_USER))
{
case G_TYPE_STRING:
- props_iter += sizeof(gchar *);
+ props_iter = ((gchar **)props_iter) + 1;;
break;
case G_TYPE_UINT:
- props_iter += sizeof(guint);
+ props_iter = ((guint *)props_iter) + 1;;
break;
case G_TYPE_UINT64:
- props_iter += sizeof(guint64);
+ props_iter = ((guint64 *)props_iter) + 1;;
break;
}
}
(*((guint *)props_iter)) = int_val;
}
+#endif
+#if 0
static void
lsq_archive_entry_set_prop_uint64(const LSQArchive *archive, LSQArchiveEntry *entry, guint n, guint64 int64_val)
{
@@ -1425,18 +1472,19 @@ lsq_archive_entry_set_prop_uint64(const LSQArchive *archive, LSQArchiveEntry *en
switch(lsq_archive_get_entry_property_type(archive, i+LSQ_ARCHIVE_PROP_USER))
{
case G_TYPE_STRING:
- props_iter += sizeof(gchar *);
+ props_iter = ((gchar **)props_iter) + 1;;
break;
case G_TYPE_UINT:
- props_iter += sizeof(guint);
+ props_iter = ((guint *)props_iter) + 1;;
break;
case G_TYPE_UINT64:
- props_iter += sizeof(guint64);
+ props_iter = ((guint64 *)props_iter) + 1;;
break;
}
}
(*((guint64 *)props_iter)) = int64_val;
}
+#endif
static void
lsq_archive_entry_set_propsv(const LSQArchive *archive, LSQArchiveEntry *entry, gpointer *props)
@@ -1452,20 +1500,21 @@ lsq_archive_entry_set_propsv(const LSQArchive *archive, LSQArchiveEntry *entry,
g_free(*((gchar **)props_iter));
//(*((gchar **)props_iter)) = g_strdup((const gchar*)props[i]);
(*((gchar **)props_iter)) = (gchar*)props[i];
- props_iter += sizeof(gchar *);
+ props_iter = ((gchar **)props_iter) + 1;;
break;
case G_TYPE_UINT:
(*((guint *)props_iter)) = *((const guint *)props[i]);
- props_iter += sizeof(guint);
+ props_iter = ((guint *)props_iter) + 1;;
break;
case G_TYPE_UINT64:
(*((guint64 *)props_iter)) = *((const guint64 *)props[i]);
- props_iter += sizeof(guint64);
+ props_iter = ((guint64 *)props_iter) + 1;;
break;
}
}
}
+#if 0
static void
lsq_archive_entry_set_propsva(const LSQArchive *archive, LSQArchiveEntry *entry, va_list ap)
{
@@ -1479,19 +1528,20 @@ lsq_archive_entry_set_propsva(const LSQArchive *archive, LSQArchiveEntry *entry,
case G_TYPE_STRING:
g_free(*((gchar **)props_iter));
(*((gchar **)props_iter)) = g_strdup(va_arg(ap, gchar*));
- props_iter += sizeof(gchar *);
+ props_iter = ((gchar **)props_iter) + 1;;
break;
case G_TYPE_UINT:
(*((guint *)props_iter)) = va_arg(ap, guint);
- props_iter += sizeof(guint);
+ props_iter = ((guint *)props_iter) + 1;;
break;
case G_TYPE_UINT64:
(*((guint64 *)props_iter)) = va_arg(ap, guint64);
- props_iter += sizeof(guint64);
+ props_iter = ((guint64 *)props_iter) + 1;;
break;
}
}
}
+#endif
/******************************
* Other iter/entry functions *
diff --git a/libsqueeze/archive-tempfs.c b/libsqueeze/archive-tempfs.c
index 2f33fb2..38280bc 100644
--- a/libsqueeze/archive-tempfs.c
+++ b/libsqueeze/archive-tempfs.c
@@ -48,11 +48,12 @@ typedef struct
static void lsq_tempfs_clean_dir(const gchar *path)
{
const gchar *file;
+ GDir *dir;
if(!path)
return;
- GDir *dir = g_dir_open(path, 0, NULL);
+ dir = g_dir_open(path, 0, NULL);
if(dir)
{
@@ -74,6 +75,8 @@ static void lsq_tempfs_clean_dir(const gchar *path)
void lsq_tempfs_clean_root_dir(LSQArchive *archive)
{
+ GSList *iter;
+
if(!archive->temp_dir)
return;
@@ -83,7 +86,7 @@ void lsq_tempfs_clean_root_dir(LSQArchive *archive)
g_debug("clean %s", archive->temp_dir);
#endif
- GSList *iter = archive->monitor_list;
+ iter = archive->monitor_list;
while(iter)
{
/* g_free(((LSQTempFileMonitor*)iter->data)->filename); */
@@ -108,12 +111,12 @@ const gchar* lsq_tempfs_get_root_dir(LSQArchive *archive)
gboolean lsq_tempfs_make_root_dir(LSQArchive *archive)
{
- if(archive->temp_dir)
- return TRUE;
-
gboolean error = FALSE;
gchar dirname[256];
+ if(archive->temp_dir)
+ return TRUE;
+
g_snprintf(dirname, 256, "%s/" PACKAGE "-%s/", g_get_tmp_dir(), g_get_user_name());
if(g_mkdir_with_parents(dirname, 0700))
return FALSE;
@@ -134,7 +137,7 @@ gboolean lsq_tempfs_make_root_dir(LSQArchive *archive)
return FALSE;
}
-gchar *lsq_archive_request_temp_file(LSQArchive *archive, const gchar *suffix)
+gchar *lsq_archive_request_temp_file(LSQArchive *archive, const gchar *sfx)
{
gchar dirname[256];
gint handle;
@@ -143,7 +146,7 @@ gchar *lsq_archive_request_temp_file(LSQArchive *archive, const gchar *suffix)
if(g_mkdir_with_parents(dirname, 0700))
return FALSE;
- g_snprintf(dirname, 256, "%s/" PACKAGE "-%s/file-XXXXXX%s", g_get_tmp_dir(), g_get_user_name(), suffix?suffix:"");
+ g_snprintf(dirname, 256, "%s/" PACKAGE "-%s/file-XXXXXX%s", g_get_tmp_dir(), g_get_user_name(), sfx?sfx:"");
handle = g_mkstemp(dirname);
if(handle == -1)
@@ -155,13 +158,16 @@ gchar *lsq_archive_request_temp_file(LSQArchive *archive, const gchar *suffix)
gboolean lsq_tempfs_make_dir(LSQArchive *archive, const gchar *path, gint mode)
{
+ gchar *full_path;
+ gboolean error ;
+
if(!archive->temp_dir)
if(!lsq_tempfs_make_root_dir(archive))
return FALSE;
- gchar *full_path = g_strconcat(archive->temp_dir, "/", path, NULL);
+ full_path = g_strconcat(archive->temp_dir, "/", path, NULL);
- gboolean error = g_mkdir_with_parents(full_path, mode);
+ error = g_mkdir_with_parents(full_path, mode);
g_free(full_path);
@@ -170,13 +176,16 @@ gboolean lsq_tempfs_make_dir(LSQArchive *archive, const gchar *path, gint mode)
gboolean lsq_tempfs_chmod(LSQArchive *archive, const gchar *path, gint mode)
{
+ gchar *full_path;
+ gboolean error;
+
if(!archive->temp_dir)
if(!lsq_tempfs_make_root_dir(archive))
return FALSE;
- gchar *full_path = g_strconcat(archive->temp_dir, "/", path, NULL);
+ full_path = g_strconcat(archive->temp_dir, "/", path, NULL);
- gboolean error = g_chmod(full_path, mode);
+ error = g_chmod(full_path, mode);
g_free(full_path);
diff --git a/libsqueeze/archive.c b/libsqueeze/archive.c
index bae643a..b591ecd 100644
--- a/libsqueeze/archive.c
+++ b/libsqueeze/archive.c
@@ -66,7 +66,7 @@ enum
static gint lsq_archive_signals[LSQ_ARCHIVE_SIGNAL_COUNT];
GType
-lsq_archive_get_type ()
+lsq_archive_get_type (void)
{
static GType lsq_archive_type = 0;
@@ -137,8 +137,9 @@ lsq_archive_init(LSQArchive *archive)
static void
lsq_archive_finalize(GObject *object)
{
+ LSQArchive *archive;
g_return_if_fail(LSQ_IS_ARCHIVE(object));
- LSQArchive *archive = (LSQArchive *)(object);
+ archive = (LSQArchive *)(object);
lsq_archive_free_iter(archive);
lsq_tempfs_clean_root_dir(archive);
@@ -160,31 +161,31 @@ lsq_archive_new (GFile *file)
LSQArchive *archive;
GFileInfo *file_info;
const gchar *content_type;
+ GSList *iter;
archive = g_object_new(lsq_archive_get_type(), NULL);
if(file)
{
- archive->priv->file = file;
- g_object_ref (archive->priv->file);
+ archive->priv->file = file;
+ g_object_ref (archive->priv->file);
}
else
- {
+ {
archive->priv->file= NULL;
- }
+ }
file_info = g_file_query_info (file, "standard::content-type,standard::type", 0, NULL, NULL);
if(file_info)
{
- content_type = g_file_info_get_attribute_string (file_info, "standard::content-type");
- archive->priv->content_type = g_strdup (content_type);
+ content_type = g_file_info_get_attribute_string (file_info, "standard::content-type");
+ archive->priv->content_type = g_strdup (content_type);
}
#ifdef DEBUG
- g_debug("mime: %s\n", thunar_vfs_mime_info_get_name(archive->priv->mime_info));
+ g_debug("mime: %s\n", archive->priv->content_type);
#endif
- GSList *iter;
for(iter = lsq_mime_support_list; iter; iter = iter->next)
{
if(0 == strcmp(((LSQSupportTemplate*)iter->data)->content_type, archive->priv->content_type))
@@ -197,7 +198,7 @@ lsq_archive_new (GFile *file)
}
}
- return archive;
+ return archive;
}
/*
@@ -356,9 +357,11 @@ lsq_archive_get_support_mask(const LSQArchive *archive)
gboolean
lsq_archive_operate(LSQArchive *archive, LSQCommandType type, const gchar **files, const gchar *directory)
{
+ LSQSupportTemplate *s_template;
+
g_return_val_if_fail(archive, FALSE);
- LSQSupportTemplate *s_template = archive->priv->s_template;
+ s_template = archive->priv->s_template;
switch (type)
{
diff --git a/libsqueeze/command-option.c b/libsqueeze/command-option.c
index 002e101..92e582e 100644
--- a/libsqueeze/command-option.c
+++ b/libsqueeze/command-option.c
@@ -136,10 +136,11 @@ lsq_command_option_create_list(XfceRc *rc, gchar **option_names)
gchar **option_iter;
for(option_iter = option_names; *option_iter; option_iter++)
{
+ const gchar *type;
gchar *option_group = g_strconcat("Squeeze-Option-", *option_iter, NULL);
xfce_rc_set_group(rc, option_group);
- const gchar *type = xfce_rc_read_entry(rc, "X-Squeeze-Type", "");
+ type = xfce_rc_read_entry(rc, "X-Squeeze-Type", "");
if(0==g_ascii_strcasecmp("Bool", type))
{
*cmd_opt_iter = LSQ_COMMAND_OPTION(g_type_create_instance(LSQ_TYPE_COMMAND_OPTION_BOOL));
@@ -189,14 +190,16 @@ lsq_command_option_create_pair(LSQCommandOption **option_list)
{
int length = 0;
LSQCommandOption **option_iter;
+ LSQCommandOptionPair **option_pair;
+ LSQCommandOptionPair **pair_iter;
for(option_iter = option_list; *option_iter; option_iter++)
{
length++;
}
- LSQCommandOptionPair **option_pair = g_new0(LSQCommandOptionPair*, length);
- LSQCommandOptionPair **pair_iter = option_pair;
+ option_pair = g_new0(LSQCommandOptionPair*, length);
+ pair_iter = option_pair;
for(option_iter = option_list; *option_iter; option_iter++)
{
diff --git a/libsqueeze/command-queue.c b/libsqueeze/command-queue.c
index 0133762..ee674f4 100644
--- a/libsqueeze/command-queue.c
+++ b/libsqueeze/command-queue.c
@@ -154,8 +154,8 @@ static gchar **lsq_command_entry_to_argv(LSQCommandEntry *entry, LSQExecuteConte
for(iter = entry->args; iter; iter = iter->next)
{
- file = lsq_archive_get_file(ctx->archive);
const gchar *arg = (const gchar*)iter->data;
+ file = lsq_archive_get_file(ctx->archive);
if((arg[0] == '%') && (arg[2] == '\0'))
{
switch(arg[1])
@@ -303,6 +303,7 @@ static void lsq_command_entry_start(LSQCommandEntry *entry, LSQExecuteContext *c
gchar **argv;
GPid pid;
GSpawnFlags flags = G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL;
+ gchar **argvi;
if(entry->redirect_out)
{
gchar *file = format_get_filename(entry->redirect_out, ctx);
@@ -326,7 +327,7 @@ static void lsq_command_entry_start(LSQCommandEntry *entry, LSQExecuteContext *c
g_debug("command: %s", argv[0]);
- gchar **argvi = argv;
+ argvi = argv;
while (argvi[1])
{
g_debug("arg: '%s'", argvi[1]);
diff --git a/libsqueeze/internals.c b/libsqueeze/internals.c
index 6619298..06d4476 100644
--- a/libsqueeze/internals.c
+++ b/libsqueeze/internals.c
@@ -73,10 +73,11 @@ lsq_opened_archive_get_archive(gchar *path)
static gint
lsq_opened_archives_lookup_archive(gconstpointer open_archive, gconstpointer uri)
{
+ GFile *file;
#ifdef DEBUG
g_return_val_if_fail(open_archive, 1);
#endif
- GFile *file = g_file_new_for_path (uri);
+ file = g_file_new_for_path (uri);
if(g_file_equal (lsq_archive_get_file(LSQ_ARCHIVE(open_archive)), file))
{
diff --git a/libsqueeze/libsqueeze.c b/libsqueeze/libsqueeze.c
index 0a1c447..ecc89f8 100644
--- a/libsqueeze/libsqueeze.c
+++ b/libsqueeze/libsqueeze.c
@@ -33,16 +33,18 @@
#include "internals.h"
void
-lsq_init()
+lsq_init(void)
{
- support_factory_list = NULL;
-
const gchar *filename = NULL;
+ gchar *data_squeeze;
+ GDir *data_dir;
+
+ support_factory_list = NULL;
lsq_opened_archive_list = NULL;
- gchar *data_squeeze = g_strconcat(DATADIR, "/squeeze", NULL);
- GDir *data_dir = g_dir_open(data_squeeze, 0, NULL);
+ data_squeeze = g_strconcat(DATADIR, "/squeeze", NULL);
+ data_dir = g_dir_open(data_squeeze, 0, NULL);
if(data_dir)
{
while((filename = g_dir_read_name(data_dir)) != NULL)
@@ -68,7 +70,7 @@ lsq_init()
}
void
-lsq_shutdown()
+lsq_shutdown(void)
{
g_slist_foreach(lsq_opened_archive_list, (GFunc)lsq_close_archive, NULL);
}
@@ -80,6 +82,8 @@ lsq_shutdown()
gint
lsq_new_archive(GFile *file, gboolean overwrite, LSQArchive **lp_archive)
{
+ LSQArchive *archive;
+
if(overwrite)
{
g_file_trash (file, NULL, NULL);
@@ -91,7 +95,7 @@ lsq_new_archive(GFile *file, gboolean overwrite, LSQArchive **lp_archive)
return 1;
}
- LSQArchive *archive = lsq_archive_new(file);
+ archive = lsq_archive_new(file);
(*lp_archive) = archive;
if(!archive)
return 1;
@@ -106,13 +110,14 @@ lsq_new_archive(GFile *file, gboolean overwrite, LSQArchive **lp_archive)
gint
lsq_open_archive(GFile *file, LSQArchive **lp_archive)
{
+ LSQArchive *archive = NULL; /*lsq_opened_archive_get_archive(path); */
+
if(!g_file_query_exists (file, NULL))
{
(*lp_archive) = NULL;
return 1;
}
- LSQArchive *archive = NULL; /*lsq_opened_archive_get_archive(path); */
if(!archive)
{
archive = lsq_archive_new(file);
@@ -153,7 +158,6 @@ lsq_iter_list_to_strv(GSList *list)
while(list)
{
- g_debug(list->data);
strv[i++] = lsq_archive_iter_get_filename(list->data);
list = g_slist_next(list);
}
diff --git a/libsqueeze/libsqueeze.h b/libsqueeze/libsqueeze.h
index 0aa5b1f..e86ed79 100644
--- a/libsqueeze/libsqueeze.h
+++ b/libsqueeze/libsqueeze.h
@@ -33,13 +33,13 @@ G_BEGIN_DECLS
* void
* lsq_init()
*/
-void lsq_init();
+void lsq_init(void);
/*
* void
* lsq_shutdown()
*/
-void lsq_shutdown();
+void lsq_shutdown(void);
/*
* gint
diff --git a/libsqueeze/scanf-parser.c b/libsqueeze/scanf-parser.c
index 22496f5..c8e080d 100644
--- a/libsqueeze/scanf-parser.c
+++ b/libsqueeze/scanf-parser.c
@@ -42,7 +42,7 @@ struct _parse_part
parse_part *next;
gchar *delimiter;
LSQParseFunc function;
- guint index;
+ guint index_;
guint width;
};
@@ -71,6 +71,8 @@ struct _LSQScanfParserContextClass
LSQParserContextClass parent;
};
+GType lsq_scanf_parser_context_get_type(void);
+
struct _LSQScanfParser
{
LSQParser parent;
@@ -98,9 +100,10 @@ lsq_scanf_parser_context_class_init(LSQScanfParserContextClass *klass)
static LSQParserContext *lsq_scanf_parser_context_new(LSQScanfParser *parser, LSQArchive *archive)
{
LSQScanfParserContext *ctx;
+ guint n_props;
ctx = g_object_new(lsq_scanf_parser_context_get_type(), "archive", archive, NULL);
- guint n_props = lsq_parser_n_properties(LSQ_PARSER(parser));
+ n_props = lsq_parser_n_properties(LSQ_PARSER(parser));
ctx->data_store = g_new0(union _data_store, n_props);
ctx->props_store = g_new0(gpointer, n_props+1);
@@ -138,7 +141,7 @@ LSQParser *lsq_scanf_parser_new(const gchar *parser_string)
}
/*{{{ skip functions*/
-guint skip_byte(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint skip_byte(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
if(lng < 1)
return 0;
@@ -146,7 +149,7 @@ guint skip_byte(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *
return 1;
}
-guint skip_word(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint skip_word(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
if(lng < 2)
return 0;
@@ -154,7 +157,7 @@ guint skip_word(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *
return 2;
}
-guint skip_dword(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint skip_dword(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
if(lng < 4)
return 0;
@@ -162,7 +165,7 @@ guint skip_dword(gchar *str, guint lng, parse_part *part, LSQScanfParserContext
return 4;
}
-guint skip_qword(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint skip_qword(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
if(lng < 8)
return 0;
@@ -170,7 +173,7 @@ guint skip_qword(gchar *str, guint lng, parse_part *part, LSQScanfParserContext
return 8;
}
-guint skip_char(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint skip_char(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
const gchar *ptr;
const gchar *delim;
@@ -195,7 +198,7 @@ guint skip_char(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *
return ptr - str;
}
-guint skip_decimal(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint skip_decimal(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
gchar *ptr;
#ifdef DO_EXSTENSIVE_CHECKING
@@ -231,7 +234,7 @@ guint skip_decimal(gchar *str, guint lng, parse_part *part, LSQScanfParserContex
return ptr - str;
}
-guint skip_floatingpoint(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint skip_floatingpoint(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
gchar *ptr;
#ifdef DO_EXSTENSIVE_CHECKING
@@ -267,7 +270,7 @@ guint skip_floatingpoint(gchar *str, guint lng, parse_part *part, LSQScanfParser
return ptr - str;
}
-guint skip_octal(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint skip_octal(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
gchar *ptr;
#ifdef DO_EXSTENSIVE_CHECKING
@@ -303,7 +306,7 @@ guint skip_octal(gchar *str, guint lng, parse_part *part, LSQScanfParserContext
return ptr - str;
}
-guint skip_string(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint skip_string(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
gchar *ptr;
const gchar *delim;
@@ -328,7 +331,7 @@ guint skip_string(gchar *str, guint lng, parse_part *part, LSQScanfParserContext
return ptr - str;
}
-guint skip_unsigned(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint skip_unsigned(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
gchar *ptr;
#ifdef DO_EXSTENSIVE_CHECKING
@@ -362,7 +365,7 @@ guint skip_unsigned(gchar *str, guint lng, parse_part *part, LSQScanfParserConte
return ptr - str;
}
-guint skip_hexadecimal(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint skip_hexadecimal(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
gchar *ptr;
#ifdef DO_EXSTENSIVE_CHECKING
@@ -399,19 +402,19 @@ guint skip_hexadecimal(gchar *str, guint lng, parse_part *part, LSQScanfParserCo
/*{{{ parse functions*/
#define DEF_PARSE_BIN(func, bytes, type, ptype, pname) \
-guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx) { \
+static guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx) { \
type val; \
ptype *pval; \
if(lng < bytes) return 0; \
val = *((type*)str); \
- pval = &ctx->data_store[part->index].pname; \
+ pval = &ctx->data_store[part->index_].pname; \
*pval = val; \
- ctx->props_store[part->index] = pval; \
+ ctx->props_store[part->index_] = pval; \
return bytes; \
}
#define DEF_PARSE_NUM(func, base, type, ptype, pname) \
-guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx) { \
+static guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx) { \
gchar *ptr; \
gchar *ptr2; \
type val; \
@@ -420,8 +423,8 @@ guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContex
if(!lng) return 0; \
delim = part->delimiter; \
if(!delim && !part->next) delim = "\n"; \
- pval = &ctx->data_store[part->index].pname; \
- ctx->props_store[part->index] = pval; \
+ pval = &ctx->data_store[part->index_].pname; \
+ ctx->props_store[part->index_] = pval; \
if(!delim[0]) { \
val = g_ascii_strtoll(str, &ptr, base); \
*pval = val; \
@@ -437,7 +440,7 @@ guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContex
}
#define DEF_PARSE_FLOAT(func, type, pname) \
-guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx) { \
+static guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx) { \
gchar *ptr; \
gchar *ptr2; \
type val; \
@@ -446,8 +449,8 @@ guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContex
if(!lng) return 0; \
delim = part->delimiter; \
if(!delim && !part->next) delim = "\n"; \
- pval = &ctx->data_store[part->index].pname; \
- ctx->props_store[part->index] = pval; \
+ pval = &ctx->data_store[part->index_].pname; \
+ ctx->props_store[part->index_] = pval; \
if(!delim[0]) { \
val = g_ascii_strtod(str, &ptr); \
*pval = val; \
@@ -463,7 +466,7 @@ guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContex
}
#define DEF_PARSE_UNS(func, base, type, ptype, pname) \
-guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx) { \
+static guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx) { \
gchar *ptr; \
gchar *ptr2; \
type val; \
@@ -472,8 +475,8 @@ guint parse_##func(gchar *str, guint lng, parse_part *part, LSQScanfParserContex
if(!lng) return 0; \
delim = part->delimiter; \
if(!delim && !part->next) delim = "\n"; \
- pval = &ctx->data_store[part->index].pname; \
- ctx->props_store[part->index] = pval; \
+ pval = &ctx->data_store[part->index_].pname; \
+ ctx->props_store[part->index_] = pval; \
if(!delim[0]) { \
val = g_ascii_strtoull(str, &ptr, base); \
*pval = val; \
@@ -493,7 +496,7 @@ DEF_PARSE_BIN(word, 2, gushort, guint, u)
DEF_PARSE_BIN(dword, 4, gulong, gulong, ul)
DEF_PARSE_BIN(qword, 8, guint64, guint64, ull)
-guint parse_char(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint parse_char(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
const gchar *ptr;
gchar val;
@@ -507,8 +510,8 @@ guint parse_char(gchar *str, guint lng, parse_part *part, LSQScanfParserContext
if(!delim && !part->next)
delim = "\n";
- pval = &ctx->data_store[part->index].c;
- ctx->props_store[part->index] = pval;
+ pval = &ctx->data_store[part->index_].c;
+ ctx->props_store[part->index_] = pval;
if(!delim[0])
{
@@ -544,7 +547,7 @@ DEF_PARSE_UNS(octal16, 010, gushort, guint, u)
DEF_PARSE_UNS(octal32, 010, gulong, gulong, ul)
DEF_PARSE_UNS(octal64, 010, guint64, guint64, ull)
-guint parse_string(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint parse_string(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
gchar *ptr;
gchar *cur;
@@ -580,7 +583,7 @@ DEF_PARSE_UNS(hexadecimal16, 0x10, gushort, guint, u)
DEF_PARSE_UNS(hexadecimal32, 0x10, gulong, gulong, ul)
DEF_PARSE_UNS(hexadecimal64, 0x10, guint64, guint64, ull)
-guint parse_filename(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
+static guint parse_filename(gchar *str, guint lng, parse_part *part, LSQScanfParserContext *ctx)
{
gchar *ptr;
const gchar *delim;
@@ -754,7 +757,7 @@ static void build_parser(LSQScanfParser *parser, const gchar *parser_string)
gboolean skip_flag;
guint width_flag;
guint index_flag;
- guint index;
+ guint index_;
parse_part *part = g_new0(parse_part, 1);
parse_part *parts = part;
@@ -777,7 +780,7 @@ static void build_parser(LSQScanfParser *parser, const gchar *parser_string)
skip_flag = FALSE;
size_flag = SIZE_NORMAL;
width_flag = 0;
- index = part_count;
+ index_ = part_count;
if(!(ch = *ptr++))
break;
@@ -787,14 +790,14 @@ static void build_parser(LSQScanfParser *parser, const gchar *parser_string)
part->delimiter = strdup_escaped(cur, ptr-cur-2);
- /*{{{ check differend index %.$*/
+ /*{{{ check differend index_ %.$*/
if(g_ascii_isdigit(ch))
{
index_flag = g_ascii_strtoull(ptr-1, &pos, 10);
if(*pos == '$')
{
ptr = pos+1;
- index = index_flag-1;
+ index_ = index_flag-1;
if(!(ch = *ptr++))
break;
}
@@ -869,24 +872,24 @@ static void build_parser(LSQScanfParser *parser, const gchar *parser_string)
else
{
part_count++;
- part->index = index;
+ part->index_ = index_;
switch(size_flag)
{
case SIZE_NORMAL:
part->function = parse_byte;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_UINT);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_UINT);
break;
case SIZE_SHORT:
part->function = parse_word;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_UINT);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_UINT);
break;
case SIZE_LONG:
part->function = parse_dword;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_ULONG);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_ULONG);
break;
case SIZE_LONGLONG:
part->function = parse_qword;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_UINT64);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_UINT64);
break;
}
}
@@ -904,9 +907,9 @@ static void build_parser(LSQScanfParser *parser, const gchar *parser_string)
else
{
part_count++;
- part->index = index;
+ part->index_ = index_;
part->function = parse_char;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_CHAR);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_CHAR);
}
break;
/*}}}*/
@@ -923,24 +926,24 @@ static void build_parser(LSQScanfParser *parser, const gchar *parser_string)
else
{
part_count++;
- part->index = index;
+ part->index_ = index_;
switch(size_flag)
{
case SIZE_NORMAL:
part->function = parse_decimal;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_INT);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_INT);
break;
case SIZE_SHORT:
part->function = parse_decimal16;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_INT);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_INT);
break;
case SIZE_LONG:
part->function = parse_decimal32;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_LONG);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_LONG);
break;
case SIZE_LONGLONG:
part->function = parse_decimal64;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_INT64);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_INT64);
break;
}
}
@@ -959,16 +962,16 @@ static void build_parser(LSQScanfParser *parser, const gchar *parser_string)
else
{
part_count++;
- part->index = index;
+ part->index_ = index_;
switch(size_flag)
{
case SIZE_NORMAL:
part->function = parse_floatingpoint;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_FLOAT);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_FLOAT);
break;
case SIZE_LONGLONG:
part->function = parse_double;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_DOUBLE);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_DOUBLE);
break;
default:
break;
@@ -988,24 +991,24 @@ static void build_parser(LSQScanfParser *parser, const gchar *parser_string)
else
{
part_count++;
- part->index = index;
+ part->index_ = index_;
switch(size_flag)
{
case SIZE_NORMAL:
part->function = parse_octal;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_UINT);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_UINT);
break;
case SIZE_SHORT:
part->function = parse_octal16;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_UINT);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_UINT);
break;
case SIZE_LONG:
part->function = parse_octal32;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_ULONG);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_ULONG);
break;
case SIZE_LONGLONG:
part->function = parse_octal64;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_UINT64);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_UINT64);
break;
}
}
@@ -1024,9 +1027,9 @@ static void build_parser(LSQScanfParser *parser, const gchar *parser_string)
else
{
part_count++;
- part->index = index;
+ part->index_ = index_;
part->function = parse_string;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_STRING);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_STRING);
}
break;
/*}}}*/
@@ -1042,24 +1045,24 @@ static void build_parser(LSQScanfParser *parser, const gchar *parser_string)
else
{
part_count++;
- part->index = index;
+ part->index_ = index_;
switch(size_flag)
{
case SIZE_NORMAL:
part->function = parse_unsigned;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_UINT);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_UINT);
break;
case SIZE_SHORT:
part->function = parse_unsigned16;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_UINT);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_UINT);
break;
case SIZE_LONG:
part->function = parse_unsigned32;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_ULONG);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_ULONG);
break;
case SIZE_LONGLONG:
part->function = parse_unsigned64;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_UINT64);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_UINT64);
break;
}
}
@@ -1078,24 +1081,24 @@ static void build_parser(LSQScanfParser *parser, const gchar *parser_string)
else
{
part_count++;
- part->index = index;
+ part->index_ = index_;
switch(size_flag)
{
case SIZE_NORMAL:
part->function = parse_hexadecimal;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_UINT);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_UINT);
break;
case SIZE_SHORT:
part->function = parse_hexadecimal16;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_UINT);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_UINT);
break;
case SIZE_LONG:
part->function = parse_hexadecimal32;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_ULONG);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_ULONG);
break;
case SIZE_LONGLONG:
part->function = parse_hexadecimal64;
- lsq_parser_set_property_type(LSQ_PARSER(parser), index, G_TYPE_UINT64);
+ lsq_parser_set_property_type(LSQ_PARSER(parser), index_, G_TYPE_UINT64);
break;
}
}
diff --git a/libsqueeze/support-factory.c b/libsqueeze/support-factory.c
index 1ae954a..d520f63 100644
--- a/libsqueeze/support-factory.c
+++ b/libsqueeze/support-factory.c
@@ -45,7 +45,7 @@ lsq_support_factory_finalize(GObject *object);
static GObjectClass *parent_class;
GType
-lsq_support_factory_get_type ()
+lsq_support_factory_get_type (void)
{
static GType lsq_support_factory_type = 0;
diff --git a/libsqueeze/support-reader.c b/libsqueeze/support-reader.c
index 841119f..6d7cae2 100644
--- a/libsqueeze/support-reader.c
+++ b/libsqueeze/support-reader.c
@@ -49,7 +49,7 @@ lsq_support_reader_finalize(GObject *object);
static GObjectClass *parent_class;
GType
-lsq_support_reader_get_type ()
+lsq_support_reader_get_type (void)
{
static GType lsq_support_reader_type = 0;
@@ -104,7 +104,7 @@ lsq_support_reader_finalize(GObject *object)
}
LSQSupportReader *
-lsq_support_reader_new()
+lsq_support_reader_new(void)
{
LSQSupportReader *reader;
@@ -118,19 +118,29 @@ lsq_support_reader_parse_file(const gchar *filename)
{
gint i = 0;
LSQSupportFactory *factory = g_object_new(LSQ_TYPE_SUPPORT_FACTORY, NULL);
+ const gchar *type, *name;
+ gchar **mime_types;
+ LSQCommandOption **add_options = NULL;
+ LSQCommandOption **remove_options = NULL;
+ LSQCommandOption **extract_options = NULL;
+ gchar **option_names;
+ gchar **column_names;
+ LSQParser *parser = NULL;
+ const gchar *parser_string;
+ gchar **_mime_types;
XfceRc *rc = xfce_rc_simple_open(filename, TRUE);
xfce_rc_set_group(rc, "Desktop Entry");
- const gchar *type = xfce_rc_read_entry(rc, "Type", "");
+ type = xfce_rc_read_entry(rc, "Type", "");
if(strcmp(type, "X-Squeeze-Archiver"))
{
g_object_unref(factory);
return NULL;
}
- const gchar *name = xfce_rc_read_entry(rc, "Name", NULL);
+ name = xfce_rc_read_entry(rc, "Name", NULL);
if(name)
factory->id = g_strdup(name);
else
@@ -139,12 +149,11 @@ lsq_support_reader_parse_file(const gchar *filename)
return NULL;
}
- gchar **mime_types = xfce_rc_read_list_entry(rc, "MimeType", ";");
+ mime_types = xfce_rc_read_list_entry(rc, "MimeType", ";");
xfce_rc_set_group(rc, "Squeeze-Add");
- LSQCommandOption **add_options = NULL;
- gchar **option_names = xfce_rc_read_list_entry(rc, "X-Squeeze-Options", ";");
+ option_names = xfce_rc_read_list_entry(rc, "X-Squeeze-Options", ";");
if(option_names)
{
add_options = lsq_command_option_create_list(rc, option_names);
@@ -153,7 +162,6 @@ lsq_support_reader_parse_file(const gchar *filename)
xfce_rc_set_group(rc, "Squeeze-Remove");
- LSQCommandOption **remove_options = NULL;
option_names = xfce_rc_read_list_entry(rc, "X-Squeeze-Options", ";");
if(option_names)
{
@@ -163,7 +171,6 @@ lsq_support_reader_parse_file(const gchar *filename)
xfce_rc_set_group(rc, "Squeeze-Extract");
- LSQCommandOption **extract_options = NULL;
option_names = xfce_rc_read_list_entry(rc, "X-Squeeze-Options", ";");
if(option_names)
{
@@ -172,18 +179,22 @@ lsq_support_reader_parse_file(const gchar *filename)
}
xfce_rc_set_group(rc, "Squeeze-Refresh");
- gchar **column_names = xfce_rc_read_list_entry(rc, "X-Squeeze-Headers", ";");
- LSQParser *parser = NULL;
- const gchar *parser_string = xfce_rc_read_entry(rc, "X-Squeeze-Parse", NULL);
+ column_names = xfce_rc_read_list_entry(rc, "X-Squeeze-Headers", ";");
+ parser_string = xfce_rc_read_entry(rc, "X-Squeeze-Parse", NULL);
if(parser_string)
{
parser = lsq_scanf_parser_new(parser_string);
}
- gchar **_mime_types = mime_types;
+ _mime_types = mime_types;
for(i = 0; _mime_types[i]; ++i)
{
LSQSupportTemplate *s_template = g_new(LSQSupportTemplate, 1);
+ const gchar *new_str_queue;
+ const gchar *add_str_queue;
+ const gchar *remove_str_queue;
+ const gchar *extract_str_queue;
+ const gchar *refresh_str_queue;
xfce_rc_set_group(rc, _mime_types[i]);
/* only add to builder->mime_types if all req. apps are found */
@@ -213,11 +224,11 @@ lsq_support_reader_parse_file(const gchar *filename)
s_template->content_type = g_strdup (_mime_types[i]);
s_template->id = (const gchar *)factory->id;
- const gchar *new_str_queue = xfce_rc_read_entry(rc, "X-Squeeze-New", NULL);
- const gchar *add_str_queue = xfce_rc_read_entry(rc, "X-Squeeze-Add", NULL);
- const gchar *remove_str_queue = xfce_rc_read_entry(rc, "X-Squeeze-Remove", NULL);
- const gchar *extract_str_queue = xfce_rc_read_entry(rc, "X-Squeeze-Extract", NULL);
- const gchar *refresh_str_queue = xfce_rc_read_entry(rc, "X-Squeeze-Refresh", NULL);
+ new_str_queue = xfce_rc_read_entry(rc, "X-Squeeze-New", NULL);
+ add_str_queue = xfce_rc_read_entry(rc, "X-Squeeze-Add", NULL);
+ remove_str_queue = xfce_rc_read_entry(rc, "X-Squeeze-Remove", NULL);
+ extract_str_queue = xfce_rc_read_entry(rc, "X-Squeeze-Extract", NULL);
+ refresh_str_queue = xfce_rc_read_entry(rc, "X-Squeeze-Refresh", NULL);
if (new_str_queue)
diff --git a/libsqueeze/support-template.c b/libsqueeze/support-template.c
index 71ee13f..119f557 100644
--- a/libsqueeze/support-template.c
+++ b/libsqueeze/support-template.c
@@ -45,10 +45,11 @@ lsq_support_template_get_property_name(LSQSupportTemplate *templ, guint nr)
guint
lsq_support_template_get_n_properties (LSQSupportTemplate *templ)
{
+ guint n_props;
#ifdef DEBUG
g_return_val_if_fail(templ, 0);
#endif
- guint n_props = lsq_parser_n_properties(templ->parser);
+ n_props = lsq_parser_n_properties(templ->parser);
if(templ->n_properties > n_props)
n_props = templ->n_properties;
return n_props;
diff --git a/src/application.c b/src/application.c
index 0513edd..2e2688b 100644
--- a/src/application.c
+++ b/src/application.c
@@ -53,7 +53,7 @@ enum
static gint sq_application_signals[SQ_APPLICATION_SIGNAL_COUNT];
GType
-sq_application_get_type ()
+sq_application_get_type (void)
{
static GType sq_application_type = 0;
@@ -150,6 +150,7 @@ sq_application_extract_archive(SQApplication *app, GFile *file, gchar *dest_path
{
GtkWidget *dialog = NULL;
LSQArchive *lp_archive = NULL;
+ GtkWidget *message_dialog;
if(lsq_open_archive(file, &lp_archive))
{
/*
@@ -178,7 +179,7 @@ sq_application_extract_archive(SQApplication *app, GFile *file, gchar *dest_path
lsq_close_archive(lp_archive);
return 1;
}
- GtkWidget *message_dialog = sq_message_dialog_new(GTK_WINDOW_TOPLEVEL, lp_archive);
+ message_dialog = sq_message_dialog_new(GTK_WINDOW_TOPLEVEL, lp_archive);
gtk_widget_show(message_dialog);
if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_EXTRACT, NULL, dest_path))
{
@@ -204,12 +205,14 @@ sq_application_new_archive(SQApplication *app, GFile *file, GSList *files)
GtkWidget *dialog = NULL;
gint result = 0;
LSQArchive *lp_archive = NULL;
+ GtkWidget *message_dialog;
if(!file)
{
+ gchar **filename_components;
dialog = sq_new_archive_dialog_new();
/* FIXME, does not work correctly when there are more dots in a filename then the one identifying the extention */
- gchar **filename_components = g_strsplit(files->data, ".", 2);
+ filename_components = g_strsplit(files->data, ".", 2);
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), filename_components[0]);
g_strfreev(filename_components);
result = gtk_dialog_run (GTK_DIALOG (dialog) );
@@ -252,7 +255,7 @@ sq_application_new_archive(SQApplication *app, GFile *file, GSList *files)
return 1;
}
}
- GtkWidget *message_dialog = sq_message_dialog_new(GTK_WINDOW_TOPLEVEL, lp_archive);
+ message_dialog = sq_message_dialog_new(GTK_WINDOW_TOPLEVEL, lp_archive);
gtk_widget_show(message_dialog);
if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_ADD, NULL, NULL))
diff --git a/src/archive_store.c b/src/archive_store.c
index 25fc7f8..bf162da 100644
--- a/src/archive_store.c
+++ b/src/archive_store.c
@@ -76,7 +76,7 @@ sq_archive_store_get_flags(GtkTreeModel *tree_model);
static gint
sq_archive_store_get_n_columns(GtkTreeModel *tree_model);
static GType
-sq_archive_store_get_column_type(GtkTreeModel *tree_model, gint index);
+sq_archive_store_get_column_type(GtkTreeModel *tree_model, gint index_);
static gboolean
sq_archive_store_get_iter(GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path);
static GtkTreePath *
@@ -142,8 +142,20 @@ cb_sq_archive_store_archive_refreshed(LSQArchive *archive, gpointer user_data);
/* cb_sq_archive_store_archive_path_changed(LSQArchive *archive, const gchar *path, gpointer user_data); */
GType
-sq_archive_store_get_type()
+sq_archive_store_get_type(void)
{
+ static const GInterfaceInfo tree_model_info =
+ {
+ (GInterfaceInitFunc) sq_archive_tree_model_init,
+ NULL,
+ NULL
+ };
+ static const GInterfaceInfo tree_sort_info =
+ {
+ (GInterfaceInitFunc) sq_archive_tree_sortable_init,
+ NULL,
+ NULL
+ };
static GType sq_archive_store_type= 0;
if(sq_archive_store_type)
@@ -167,22 +179,9 @@ sq_archive_store_get_type()
sq_archive_store_type = g_type_register_static (G_TYPE_OBJECT, "SQArchiveStore", &sq_archive_store_info, 0);
}
- static const GInterfaceInfo tree_model_info =
- {
- (GInterfaceInitFunc) sq_archive_tree_model_init,
- NULL,
- NULL
- };
g_type_add_interface_static (sq_archive_store_type, GTK_TYPE_TREE_MODEL, &tree_model_info);
- static const GInterfaceInfo tree_sort_info =
- {
- (GInterfaceInitFunc) sq_archive_tree_sortable_init,
- NULL,
- NULL
- };
-
g_type_add_interface_static (sq_archive_store_type, GTK_TYPE_TREE_SORTABLE, &tree_sort_info);
return sq_archive_store_type;
@@ -380,10 +379,13 @@ sq_archive_store_get_flags(GtkTreeModel *tree_model)
static gint
sq_archive_store_get_n_columns(GtkTreeModel *tree_model)
{
+ SQArchiveStore *store;
+ LSQArchive *archive;
+
g_return_val_if_fail(SQ_IS_ARCHIVE_STORE(tree_model), 0);
- SQArchiveStore *store = SQ_ARCHIVE_STORE(tree_model);
- LSQArchive *archive = store->archive;
+ store = SQ_ARCHIVE_STORE(tree_model);
+ archive = store->archive;
if(!archive)
return 0;
@@ -392,35 +394,45 @@ sq_archive_store_get_n_columns(GtkTreeModel *tree_model)
}
static GType
-sq_archive_store_get_column_type(GtkTreeModel *tree_model, gint index)
+sq_archive_store_get_column_type(GtkTreeModel *tree_model, gint index_)
{
+ SQArchiveStore *store;
+ LSQArchive *archive;
+
g_return_val_if_fail(SQ_IS_ARCHIVE_STORE(tree_model), G_TYPE_INVALID);
- SQArchiveStore *store = SQ_ARCHIVE_STORE(tree_model);
- LSQArchive *archive = store->archive;
- g_return_val_if_fail(index < lsq_archive_n_entry_properties(archive), G_TYPE_INVALID);
+ store = SQ_ARCHIVE_STORE(tree_model);
+ archive = store->archive;
+ g_return_val_if_fail(index_ < (gint)lsq_archive_n_entry_properties(archive), G_TYPE_INVALID);
if(!archive)
return G_TYPE_INVALID;
- switch(index)
+ switch(index_)
{
case SQ_ARCHIVE_STORE_EXTRA_PROP_PATH:
case SQ_ARCHIVE_STORE_EXTRA_PROP_ICON:
return G_TYPE_STRING;
default:
- return lsq_archive_get_entry_property_type(archive, index - SQ_ARCHIVE_STORE_EXTRA_PROP_COUNT);
+ return lsq_archive_get_entry_property_type(archive, index_ - SQ_ARCHIVE_STORE_EXTRA_PROP_COUNT);
}
}
static gboolean
sq_archive_store_get_iter(GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path)
{
+ SQArchiveStore *store;
+ LSQArchiveIter *entry;
+ gint *indices;
+ gint depth;
+ gint index_;
+
+
#ifdef DEBUG
g_return_val_if_fail(SQ_IS_ARCHIVE_STORE(tree_model), FALSE);
#endif
- SQArchiveStore *store = SQ_ARCHIVE_STORE(tree_model);
+ store = SQ_ARCHIVE_STORE(tree_model);
if(!store->navigation.present)
return FALSE;
@@ -429,21 +441,21 @@ sq_archive_store_get_iter(GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePa
#endif
/* get the present history */
- LSQArchiveIter *entry = store->navigation.present->data;
+ entry = store->navigation.present->data;
- gint *indices = gtk_tree_path_get_indices(path);
- gint depth = gtk_tree_path_get_depth(path) - 1;
+ indices = gtk_tree_path_get_indices(path);
+ depth = gtk_tree_path_get_depth(path) - 1;
/* only support list: depth is always 0 */
g_return_val_if_fail(depth == 0, FALSE);
- gint index = indices[depth];
+ index_ = indices[depth];
/* if this is the root entry we don't need the ".." */
if(store->props._show_up_dir && lsq_archive_iter_has_parent(entry))
- index--;
+ index_--;
- if(index == -1)
+ if(index_ == -1)
{
/* it is the ".." */
entry = NULL;
@@ -452,7 +464,7 @@ sq_archive_store_get_iter(GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePa
{
/* as long as it is a list depth is 0 other wise current_entry should be synced ? */
if(store->sort_list)
- entry = store->sort_list[index];
+ entry = store->sort_list[index_];
else
entry = NULL;
@@ -462,8 +474,8 @@ sq_archive_store_get_iter(GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePa
iter->stamp = store->stamp;
iter->user_data = entry;
- /* the index in the child list */
- iter->user_data3 = GINT_TO_POINTER(index);
+ /* the index_ in the child list */
+ iter->user_data3 = GINT_TO_POINTER(index_);
return TRUE;
}
@@ -471,20 +483,26 @@ sq_archive_store_get_iter(GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePa
static GtkTreePath *
sq_archive_store_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter)
{
+ SQArchiveStore *store;
+ LSQArchive *archive;
+ LSQArchiveIter *entry;
+ gint pos;
+ GtkTreePath *path;
+
g_return_val_if_fail(SQ_IS_ARCHIVE_STORE(tree_model), NULL);
- SQArchiveStore *store = SQ_ARCHIVE_STORE(tree_model);
- LSQArchive *archive = store->archive;
+ store = SQ_ARCHIVE_STORE(tree_model);
+ archive = store->archive;
g_return_val_if_fail(archive, NULL);
- LSQArchiveIter *entry = (LSQArchiveIter*)iter->user_data;
- gint pos = GPOINTER_TO_INT(iter->user_data3);
+ entry = (LSQArchiveIter*)iter->user_data;
+ pos = GPOINTER_TO_INT(iter->user_data3);
if(store->props._show_up_dir && lsq_archive_iter_has_parent(entry))
pos++;
- GtkTreePath *path = gtk_tree_path_new();
+ path = gtk_tree_path_new();
gtk_tree_path_append_index(path, pos);
return path;
@@ -494,11 +512,15 @@ sq_archive_store_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter)
static void
sq_archive_store_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint column, GValue *value)
{
+ SQArchiveStore *store;
+ LSQArchive *archive;
+ LSQArchiveIter *parent, *entry;
+
g_return_if_fail (SQ_IS_ARCHIVE_STORE (tree_model));
- SQArchiveStore *store = SQ_ARCHIVE_STORE(tree_model);
- LSQArchive *archive = store->archive;
- LSQArchiveIter *parent, *entry = iter->user_data;
+ store = SQ_ARCHIVE_STORE(tree_model);
+ archive = store->archive;
+ entry = iter->user_data;
g_return_if_fail(archive);
@@ -561,14 +583,18 @@ sq_archive_store_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint co
static gboolean
sq_archive_store_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter)
{
+ SQArchiveStore *store;
+ LSQArchiveIter *entry;
+ gint pos;
+
g_return_val_if_fail(SQ_IS_ARCHIVE_STORE(tree_model), FALSE);
- SQArchiveStore *store = SQ_ARCHIVE_STORE(tree_model);
+ store = SQ_ARCHIVE_STORE(tree_model);
if(iter->stamp != store->stamp)
return FALSE;
- LSQArchiveIter *entry = iter->user_data;
- gint pos = GPOINTER_TO_INT(iter->user_data3);
+ entry = iter->user_data;
+ pos = GPOINTER_TO_INT(iter->user_data3);
pos++;
if(store->sort_list)
@@ -589,19 +615,23 @@ sq_archive_store_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter)
static gboolean
sq_archive_store_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent)
{
+ SQArchiveStore *store;
+ LSQArchive *archive;
+ LSQArchiveIter *entry;
+
#ifdef DEBUG
g_return_val_if_fail(SQ_IS_ARCHIVE_STORE(tree_model), FALSE);
#endif
- SQArchiveStore *store = SQ_ARCHIVE_STORE(tree_model);
- LSQArchive *archive = store->archive;
+ store = SQ_ARCHIVE_STORE(tree_model);
+ archive = store->archive;
#ifdef DEBUG
g_return_val_if_fail(store->navigation.present, FALSE);
g_return_val_if_fail(store->navigation.present->data, FALSE);
#endif
- LSQArchiveIter *entry = store->navigation.present->data;
+ entry = store->navigation.present->data;
#ifdef DEBUG
g_return_val_if_fail(archive, FALSE);
@@ -643,19 +673,23 @@ sq_archive_store_iter_has_child (GtkTreeModel *tree_model, GtkTreeIter *iter)
static gint
sq_archive_store_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter)
{
+ SQArchiveStore *store;
+ LSQArchive *archive;
+ LSQArchiveIter *entry;
+
#ifdef DEBUG
g_return_val_if_fail(SQ_IS_ARCHIVE_STORE(tree_model), 0);
#endif
- SQArchiveStore *store = SQ_ARCHIVE_STORE(tree_model);
- LSQArchive *archive = store->archive;
+ store = SQ_ARCHIVE_STORE(tree_model);
+ archive = store->archive;
#ifdef DEBUG
g_return_val_if_fail(store->navigation.present, 0);
g_return_val_if_fail(store->navigation.present->data, 0);
#endif
- LSQArchiveIter *entry = store->navigation.present->data;
+ entry = store->navigation.present->data;
#ifdef DEBUG
g_return_val_if_fail(archive, 0);
@@ -671,19 +705,23 @@ sq_archive_store_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter)
static gboolean
sq_archive_store_iter_nth_child (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent, gint n)
{
+ SQArchiveStore *store;
+ LSQArchive *archive;
+ LSQArchiveIter *entry;
+
#ifdef DEBUG
g_return_val_if_fail(SQ_IS_ARCHIVE_STORE(tree_model), FALSE);
#endif
- SQArchiveStore *store = SQ_ARCHIVE_STORE(tree_model);
- LSQArchive *archive = store->archive;
+ store = SQ_ARCHIVE_STORE(tree_model);
+ archive = store->archive;
#ifdef DEBUG
g_return_val_if_fail(store->navigation.present, FALSE);
g_return_val_if_fail(store->navigation.present->data, FALSE);
#endif
- LSQArchiveIter *entry = store->navigation.present->data;
+ entry = store->navigation.present->data;
#ifdef DEBUG
g_return_val_if_fail(archive, FALSE);
@@ -729,9 +767,11 @@ sq_archive_store_iter_parent (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTr
static gboolean
sq_archive_store_get_sort_column_id(GtkTreeSortable *sortable, gint *sort_col_id, GtkSortType *order)
{
+ SQArchiveStore *store;
+
g_return_val_if_fail(SQ_IS_ARCHIVE_STORE(sortable), FALSE);
- SQArchiveStore *store = SQ_ARCHIVE_STORE(sortable);
+ store = SQ_ARCHIVE_STORE(sortable);
if(sort_col_id)
*sort_col_id = store->sort_column;
@@ -739,15 +779,17 @@ sq_archive_store_get_sort_column_id(GtkTreeSortable *sortable, gint *sort_col_id
if(order)
*order = store->sort_order;
- return store->sort_order >= 0;
+ return TRUE; /*store->sort_order >= 0;*/
}
static void
sq_archive_store_set_sort_column_id(GtkTreeSortable *sortable, gint sort_col_id, GtkSortType order)
{
+ SQArchiveStore *store;
+
g_return_if_fail(SQ_IS_ARCHIVE_STORE(sortable));
- SQArchiveStore *store = SQ_ARCHIVE_STORE(sortable);
+ store = SQ_ARCHIVE_STORE(sortable);
if(store->sort_column == sort_col_id && store->sort_order == order)
return;
@@ -791,6 +833,8 @@ sq_archive_entry_compare(SQArchiveStore *store, LSQArchiveIter *a, LSQArchiveIte
gboolean cmp_b = 0;
GValue prop_a;
GValue prop_b;
+ LSQArchiveIter *swap;
+ LSQArchive *archive;
memset(&prop_a, 0, sizeof(GValue));
memset(&prop_b, 0, sizeof(GValue));
if(store->props._sort_folders_first)
@@ -804,14 +848,14 @@ sq_archive_entry_compare(SQArchiveStore *store, LSQArchiveIter *a, LSQArchiveIte
return 1;
}
- LSQArchiveIter *swap = b;
+ swap = b;
if(store->sort_order == GTK_SORT_DESCENDING)
{
b = a;
a = swap;
}
- LSQArchive *archive = store->archive;
+ archive = store->archive;
column = store->sort_column - SQ_ARCHIVE_STORE_EXTRA_PROP_COUNT;
lsq_archive_iter_get_prop_value(a, column, &prop_a);
@@ -855,6 +899,10 @@ sq_archive_entry_compare(SQArchiveStore *store, LSQArchiveIter *a, LSQArchiveIte
static void
sq_archive_store_sort(SQArchiveStore *store)
{
+ LSQArchiveIter *pentry;
+ guint psize;
+ guint i = 0;
+
if(store->sort_list)
{
LSQArchiveIter **iter;
@@ -871,9 +919,8 @@ sq_archive_store_sort(SQArchiveStore *store)
g_return_if_fail(store->navigation.present->data);
#endif
- LSQArchiveIter *pentry = store->navigation.present->data;
- guint psize = lsq_archive_iter_n_children(pentry);
- guint i = 0;
+ pentry = store->navigation.present->data;
+ psize = lsq_archive_iter_n_children(pentry);
store->sort_list = g_new(LSQArchiveIter*, psize+1);
@@ -900,12 +947,16 @@ swap(LSQArchiveIter **left, LSQArchiveIter **right)
static void
sq_archive_quicksort(SQArchiveStore *store, gint left, gint right)
{
+ gint i;
+ gint j;
+ LSQArchiveIter *value = NULL;
+ LSQArchiveIter **list;
+
if(right-left < 30) return;
- gint i = (left+right)/2;
- gint j = right-1;
- LSQArchiveIter *value = NULL;
- LSQArchiveIter **list = store->sort_list;
+ i = (left+right)/2;
+ j = right-1;
+ list = store->sort_list;
if(sq_archive_entry_compare(store, list[left], list[i]) > 0)
swap(list+left, list+i);
@@ -997,6 +1048,12 @@ static void
sq_archive_store_refresh(SQArchiveStore *store)
{
LSQArchive *archive = store->archive;
+ LSQArchiveIter *entry;
+ guint prev_size;
+ guint new_size;
+ guint i = 0;
+ GtkTreePath *path_ = NULL;
+ GtkTreeIter iter;
if(!store->navigation.present)
return;
@@ -1004,16 +1061,13 @@ sq_archive_store_refresh(SQArchiveStore *store)
g_return_if_fail(store->navigation.present->data);
#endif
- LSQArchiveIter *entry = store->navigation.present->data;
+ entry = store->navigation.present->data;
g_return_if_fail(archive);
g_return_if_fail(entry);
- guint prev_size = store->list_size;
- guint new_size = lsq_archive_iter_n_children(entry);
- guint i = 0;
- GtkTreePath *path_ = NULL;
- GtkTreeIter iter;
+ prev_size = store->list_size;
+ new_size = lsq_archive_iter_n_children(entry);
/* if(store->treeview) */
{
@@ -1087,27 +1141,33 @@ cb_sq_archive_store_row_activated(GtkTreeView *treeview, GtkTreePath *path, GtkT
static void
sq_archive_store_file_activated(SQArchiveStore *store, GtkTreePath *path)
{
+ LSQArchive *archive;
+ LSQArchiveIter *entry;
+ gint *indices;
+ gint depth;
+ gint index_;
+
g_return_if_fail(store->navigation.present);
g_return_if_fail(store->navigation.present->data);
- LSQArchive *archive = store->archive;
- LSQArchiveIter *entry = store->navigation.present->data;
+ archive = store->archive;
+ entry = store->navigation.present->data;
g_return_if_fail(archive);
g_return_if_fail(entry);
- gint *indices = gtk_tree_path_get_indices(path);
- gint depth = gtk_tree_path_get_depth(path) - 1;
+ indices = gtk_tree_path_get_indices(path);
+ depth = gtk_tree_path_get_depth(path) - 1;
/* only support list: depth is always 0 */
g_return_if_fail(depth == 0);
- gint index = indices[depth];
+ index_ = indices[depth];
if(store->props._show_up_dir && lsq_archive_iter_has_parent(entry))
- index--;
+ index_--;
- if(index == -1)
+ if(index_ == -1)
{
entry = lsq_archive_iter_get_parent(entry);
sq_archive_store_append_history(store, entry);
@@ -1115,7 +1175,7 @@ sq_archive_store_file_activated(SQArchiveStore *store, GtkTreePath *path)
else
{
if(store->sort_list)
- entry = store->sort_list[index];
+ entry = store->sort_list[index_];
else
entry = NULL;
@@ -1143,13 +1203,14 @@ void
sq_archive_store_go_up(SQArchiveStore *store)
{
LSQArchive *archive = store->archive;
+ LSQArchiveIter *entry;
#ifdef DEBUG
g_return_if_fail(store->navigation.present);
g_return_if_fail(store->navigation.present->data);
#endif
- LSQArchiveIter *entry = store->navigation.present->data;
+ entry = store->navigation.present->data;
g_return_if_fail(archive);
g_return_if_fail(entry);
@@ -1166,24 +1227,24 @@ sq_archive_store_go_up(SQArchiveStore *store)
void
sq_archive_store_set_archive(SQArchiveStore *store, LSQArchive *archive)
{
- g_return_if_fail(store);
-
- if(store->archive == archive)
- return;
-
guint i = 0;
GtkTreePath *path_ = NULL;
GtkTreeIter iter;
GList *list_iter;
LSQArchiveIter *root_entry;
+ g_return_if_fail(store);
+
+ if(store->archive == archive)
+ return;
+
/* free the sort data */
if(store->sort_list)
{
- LSQArchiveIter **iter;
- for(iter = store->sort_list; *iter; iter++)
+ LSQArchiveIter **_iter;
+ for(_iter = store->sort_list; *_iter; _iter++)
{
- lsq_archive_iter_unref(*iter);
+ lsq_archive_iter_unref(*_iter);
}
g_free(store->sort_list);
store->sort_list = NULL;
@@ -1276,6 +1337,8 @@ sq_archive_store_set_archive(SQArchiveStore *store, LSQArchive *archive)
LSQArchiveIter *
sq_archive_store_get_pwd(SQArchiveStore *store)
{
+ LSQArchiveIter *iter;
+
#ifdef DEBUG
g_return_val_if_fail(store, NULL);
g_return_val_if_fail(SQ_IS_ARCHIVE_STORE(store), NULL);
@@ -1284,7 +1347,7 @@ sq_archive_store_get_pwd(SQArchiveStore *store)
if(!store->navigation.present)
return NULL;
- LSQArchiveIter *iter = store->navigation.present->data;
+ iter = store->navigation.present->data;
return lsq_archive_iter_ref(iter);
}
@@ -1555,12 +1618,14 @@ sq_archive_store_check_trailing(SQArchiveStore *store)
LSQArchiveIter *
sq_archive_store_get_trailing(SQArchiveStore *store)
{
+ LSQArchiveIter *iter;
+
#ifdef DEBUG
g_return_val_if_fail(store, NULL);
g_return_val_if_fail(SQ_IS_ARCHIVE_STORE(store), NULL);
#endif
- LSQArchiveIter *iter = store->navigation.trailing;
+ iter = store->navigation.trailing;
return lsq_archive_iter_ref(iter);
}
@@ -1588,7 +1653,6 @@ sq_archive_store_dispose(GObject *object)
static void
cb_sq_archive_store_archive_refreshed(LSQArchive *archive, gpointer user_data)
{
- g_debug("%s", __FUNCTION__);
SQArchiveStore *store = SQ_ARCHIVE_STORE(user_data);
GList *iter;
LSQArchiveIter *aIter;
diff --git a/src/button_drag_box.c b/src/button_drag_box.c
index dadc08d..6f3ca93 100644
--- a/src/button_drag_box.c
+++ b/src/button_drag_box.c
@@ -106,7 +106,7 @@ sq_button_drag_box_init(SQButtonDragBox *box)
}
GtkWidget *
-sq_button_drag_box_new()
+sq_button_drag_box_new(void)
{
GtkWidget *box;
diff --git a/src/extract_dialog.c b/src/extract_dialog.c
index 2e3105c..0e34477 100644
--- a/src/extract_dialog.c
+++ b/src/extract_dialog.c
@@ -39,7 +39,7 @@ void
sq_extract_dialog_option_child_notify(GtkWidget *widget, GParamSpec *, gpointer data);
GType
-sq_extract_archive_dialog_get_type ()
+sq_extract_archive_dialog_get_type (void)
{
static GType sq_extract_archive_dialog_type = 0;
@@ -75,10 +75,11 @@ sq_extract_archive_dialog_init(SQExtractArchiveDialog *dialog)
GtkWidget *hbox = gtk_hbox_new(TRUE, 5);
GtkWidget *l_label = gtk_label_new(_("<b>Extract files:</b>"));
GtkWidget *r_label = gtk_label_new(_("<b>Options:</b>"));
+ GtkWidget *l_vbox;
gtk_label_set_use_markup(GTK_LABEL(l_label), TRUE);
gtk_label_set_use_markup(GTK_LABEL(r_label), TRUE);
- GtkWidget *l_vbox = gtk_vbox_new(FALSE, 0);
+ l_vbox = gtk_vbox_new(FALSE, 0);
dialog->l_frame = gtk_frame_new( NULL );
gtk_frame_set_label_widget(GTK_FRAME(dialog->l_frame), l_label);
@@ -106,13 +107,15 @@ GtkWidget *
sq_extract_archive_dialog_new(LSQArchive *archive, gboolean sel_option)
{
SQExtractArchiveDialog *dialog;
+ GtkWidget *r_vbox;
+ gchar **filename_components;
dialog = g_object_new(sq_extract_archive_dialog_get_type(), "title", _("Extract archive"), "action", GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER, "do-overwrite-confirmation", TRUE, NULL);
/* Handle 'extract selected files' option */
gtk_widget_set_sensitive(dialog->sel_files_radio, sel_option);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->sel_files_radio), sel_option);
- GtkWidget *r_vbox = gtk_vbox_new(FALSE, 0);
+ r_vbox = gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(dialog->r_frame), r_vbox);
if((dialog->command_options = lsq_archive_get_command_options(archive, LSQ_COMMAND_TYPE_EXTRACT)))
@@ -127,7 +130,7 @@ sq_extract_archive_dialog_new(LSQArchive *archive, gboolean sel_option)
}
/* FIXME, does not work correctly when there are more dots in a filename then the one identifying the extention */
- gchar **filename_components = g_strsplit(g_file_get_basename(lsq_archive_get_file(archive)), ".", 2);
+ filename_components = g_strsplit(g_file_get_basename(lsq_archive_get_file(archive)), ".", 2);
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), filename_components[0]);
g_strfreev(filename_components);
diff --git a/src/main.c b/src/main.c
index d0192ec..6353075 100644
--- a/src/main.c
+++ b/src/main.c
@@ -71,11 +71,13 @@ static GOptionEntry entries[] =
{ NULL }
};
+#if 0
void
cb_main_window_destroy(SQMainWindow *window, gpointer data)
{
gtk_main_quit();
}
+#endif
int main(int argc, char **argv)
{
@@ -85,6 +87,7 @@ int main(int argc, char **argv)
GError *cli_error = NULL;
gint i = 0;
GFile *file = NULL;
+ gchar *current_dir;
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
@@ -101,7 +104,7 @@ int main(int argc, char **argv)
return 1;
}
}
- gchar *current_dir = g_get_current_dir();
+ current_dir = g_get_current_dir();
lsq_init();
diff --git a/src/main_window.c b/src/main_window.c
index d55040d..3dd1ef5 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -114,7 +114,7 @@ sq_main_window_set_navigation(SQMainWindow *window);
static GObjectClass *parent_class;
GType
-sq_main_window_navigation_style_get_type()
+sq_main_window_navigation_style_get_type(void)
{
static GType nav_style_type = 0;
guint i = 0;
@@ -146,7 +146,7 @@ sq_main_window_navigation_style_get_type()
}
GType
-sq_main_window_get_type ()
+sq_main_window_get_type (void)
{
static GType sq_main_window_type = 0;
@@ -274,6 +274,7 @@ sq_main_window_init(SQMainWindow *window)
gboolean up_dir = TRUE;
gboolean use_tabs = TRUE;
gboolean show_menubar = TRUE;
+ GtkWidget *item;
window->accel_group = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(window), window->accel_group);
@@ -413,7 +414,7 @@ sq_main_window_init(SQMainWindow *window)
gtk_menu_bar_append(GTK_MENU_BAR(window->menu_bar), window->menubar.menu_item_view);
gtk_menu_bar_append(GTK_MENU_BAR(window->menu_bar), window->menubar.menu_item_help);
- GtkWidget *item = gtk_menu_item_new ();
+ item = gtk_menu_item_new ();
gtk_widget_set_sensitive (item, FALSE);
gtk_menu_item_set_right_justified (GTK_MENU_ITEM (item), TRUE);
gtk_menu_shell_append (GTK_MENU_SHELL (window->menu_bar), item);
@@ -632,11 +633,12 @@ sq_main_window_find_image(gchar *filename, GtkIconSize size)
gint height = 0;
GtkWidget *file_image;
gchar *path;
+ GdkPixbuf *file_pixbuf;
path = g_strconcat(DATADIR, "/pixmaps/squeeze/", filename, NULL);
gtk_icon_size_lookup(size, &width, &height);
- GdkPixbuf *file_pixbuf = gdk_pixbuf_new_from_file_at_size(path, width, height, &error);
+ file_pixbuf = gdk_pixbuf_new_from_file_at_size(path, width, height, &error);
if(file_pixbuf)
{
file_image = gtk_image_new_from_pixbuf(file_pixbuf);
@@ -827,8 +829,9 @@ cb_sq_main_extract_archive(GtkWidget *widget, gpointer userdata)
strv = lsq_iter_list_to_strv(filenames);
if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_EXTRACT, strv, extract_archive_path))
{
+ GtkWidget *warning_dialog;
g_free(strv);
- GtkWidget *warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
+ warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_CLOSE,
@@ -879,8 +882,9 @@ cb_sq_main_add_files_to_archive(GtkWidget *widget, gpointer userdata)
const gchar **strv = lsq_iter_list_to_strv(filenames);
if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_ADD, strv, NULL))
{
+ GtkWidget *warning_dialog;
g_free(strv);
- GtkWidget *warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
+ warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_CLOSE,
@@ -925,8 +929,9 @@ cb_sq_main_add_folders_to_archive(GtkWidget *widget, gpointer userdata)
const gchar **strv = lsq_iter_list_to_strv(filenames);
if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_ADD, strv, NULL))
{
+ GtkWidget *warning_dialog;
g_free(strv);
- GtkWidget *warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
+ warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_CLOSE,
@@ -964,8 +969,9 @@ cb_sq_main_remove_from_archive(GtkWidget *widget, gpointer userdata)
strv = lsq_iter_list_to_strv(filenames);
if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_REMOVE, strv, NULL))
{
+ GtkWidget *warning_dialog;
g_free(strv);
- GtkWidget *warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
+ warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_CLOSE,
@@ -1147,18 +1153,22 @@ static void
cb_sq_main_window_notebook_page_switched(SQNotebook *notebook, GtkNotebookPage *page, guint page_nr, gpointer data)
{
LSQArchive *lp_archive;
- sq_notebook_page_get_archive(notebook, &lp_archive, page_nr);
SQMainWindow *window = SQ_MAIN_WINDOW(data);
+ guint context_id;
+ const gchar *message;
+ GFile *file;
+ gchar *filename;
+ sq_notebook_page_get_archive(notebook, &lp_archive, page_nr);
- GFile *file = lsq_archive_get_file(lp_archive);
- gchar *filename = g_file_get_basename (file);
+ file = lsq_archive_get_file(lp_archive);
+ filename = g_file_get_basename (file);
gtk_window_set_title(GTK_WINDOW(window), g_strconcat(PACKAGE_NAME, " - ", filename , NULL));
g_free (filename);
sq_main_window_new_action_menu(window, lp_archive);
- guint context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(window->statusbar), "Window Statusbar");
- const gchar *message = lsq_archive_get_state_msg(lp_archive);
+ context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(window->statusbar), "Window Statusbar");
+ message = lsq_archive_get_state_msg(lp_archive);
if(!message)
{
message = _("Done");
@@ -1207,6 +1217,7 @@ static void
cb_sq_main_window_notebook_page_removed(SQNotebook *notebook, gpointer data)
{
SQMainWindow *window = SQ_MAIN_WINDOW(data);
+ guint context_id;
if(!gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook)))
{
@@ -1231,7 +1242,7 @@ cb_sq_main_window_notebook_page_removed(SQNotebook *notebook, gpointer data)
}
gtk_window_set_title(GTK_WINDOW(window), PACKAGE_STRING);
- guint context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(window->statusbar), "Window Statusbar");
+ context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(window->statusbar), "Window Statusbar");
gtk_statusbar_push(GTK_STATUSBAR(window->statusbar), context_id, _("Done"));
}
}
@@ -1245,12 +1256,14 @@ cb_sq_main_window_notebook_file_activated(SQNotebook *notebook, LSQArchiveIter *
GtkWidget *label = gtk_label_new(_("Which action do you want to perform on the selected file(s)?"));
GtkWidget *dialog = gtk_dialog_new_with_buttons("",window,GTK_DIALOG_DESTROY_WITH_PARENT, _("Open"), GTK_RESPONSE_OK, _("Extract"), GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
GtkWidget *extr_dialog = NULL;
+ gint result;
+ const gchar **strv;
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), label, TRUE, TRUE, 20);
gtk_widget_show(label);
- gint result = gtk_dialog_run(GTK_DIALOG(dialog));
+ result = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_hide(dialog);
- const gchar **strv = g_new(const gchar*, 2);
+ strv = g_new(const gchar*, 2);
strv[0] = lsq_archive_iter_get_filename(iter);
strv[1] = NULL;
diff --git a/src/message_dialog.c b/src/message_dialog.c
index b649b92..55e8819 100644
--- a/src/message_dialog.c
+++ b/src/message_dialog.c
@@ -41,7 +41,7 @@ cb_sq_message_dialog_close(GtkButton *button, SQMessageDialog *dialog);
static GObjectClass *parent_class = NULL;
GType
-sq_message_dialog_get_type ()
+sq_message_dialog_get_type (void)
{
static GType sq_message_dialog_type = 0;
@@ -80,13 +80,16 @@ static void
sq_message_dialog_init(SQMessageDialog *dialog)
{
GtkWidget *vbox = gtk_vbox_new(FALSE, 3);
+ GtkWidget *separator;
+ GtkWidget *button_box;
+ GtkWidget *cancel_button;
dialog->message_label = gtk_label_new("being silly here");
dialog->progress_bar = gtk_progress_bar_new();
gtk_label_set_ellipsize(GTK_LABEL(dialog->message_label), PANGO_ELLIPSIZE_MIDDLE);
- GtkWidget *separator = gtk_hseparator_new();
- GtkWidget *button_box= gtk_hbutton_box_new();
+ separator = gtk_hseparator_new();
+ button_box = gtk_hbutton_box_new();
gtk_box_pack_end(GTK_BOX(vbox), button_box, FALSE, FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbox), separator, FALSE, FALSE, 0);
@@ -96,7 +99,7 @@ sq_message_dialog_init(SQMessageDialog *dialog)
gtk_button_box_set_layout(GTK_BUTTON_BOX(button_box), GTK_BUTTONBOX_END);
- GtkWidget *cancel_button = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
+ cancel_button = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
g_signal_connect(cancel_button, "clicked", G_CALLBACK(cb_sq_message_dialog_close), dialog);
diff --git a/src/navigation_bar.c b/src/navigation_bar.c
index 0e2604b..1b71d0b 100644
--- a/src/navigation_bar.c
+++ b/src/navigation_bar.c
@@ -47,7 +47,7 @@ enum {
static GObjectClass *parent_class;
GType
-sq_navigation_bar_get_type ()
+sq_navigation_bar_get_type (void)
{
static GType sq_navigation_bar_type = 0;
diff --git a/src/new_dialog.c b/src/new_dialog.c
index 8ac17ce..13624bc 100644
--- a/src/new_dialog.c
+++ b/src/new_dialog.c
@@ -33,7 +33,7 @@ static void
sq_new_archive_dialog_init(SQNewArchiveDialog *archive);
GType
-sq_new_archive_dialog_get_type ()
+sq_new_archive_dialog_get_type (void)
{
static GType sq_new_archive_dialog_type = 0;
@@ -67,6 +67,7 @@ static void
sq_new_archive_dialog_init(SQNewArchiveDialog *dialog)
{
GtkWidget *hbox = gtk_hbox_new(FALSE, 10);
+ GSList *_supported_mime_types;
gtk_box_pack_start (GTK_BOX (hbox),gtk_label_new (_("Archive type:")),FALSE, FALSE, 0);
dialog->archive_types_combo = gtk_combo_box_new_text();
@@ -75,7 +76,7 @@ sq_new_archive_dialog_init(SQNewArchiveDialog *dialog)
gtk_widget_show_all(hbox);
dialog->supported_mime_types = lsq_get_supported_mime_types(LSQ_COMMAND_TYPE_ADD);
- GSList *_supported_mime_types = dialog->supported_mime_types;
+ _supported_mime_types = dialog->supported_mime_types;
dialog->file_filter = gtk_file_filter_new();
gtk_file_filter_set_name(dialog->file_filter, _("Archives"));
@@ -101,7 +102,7 @@ sq_new_archive_dialog_init(SQNewArchiveDialog *dialog)
}
GtkWidget *
-sq_new_archive_dialog_new()
+sq_new_archive_dialog_new(void)
{
GtkWidget *dialog;
@@ -122,14 +123,14 @@ sq_new_archive_dialog_get_file(SQNewArchiveDialog *dialog)
if (file)
{
+ const gchar *mime_type = ""; //lsq_mime_support_get_name(((LSQMimeSupport *)_supported_mime_types->data));
+ gchar *suffix = NULL;
gint i;
GSList *_supported_mime_types = dialog->supported_mime_types;
for(i = 0; i < gtk_combo_box_get_active(GTK_COMBO_BOX(dialog->archive_types_combo)); i++)
{
_supported_mime_types = g_slist_next(_supported_mime_types);
}
- const gchar *mime_type = ""; //lsq_mime_support_get_name(((LSQMimeSupport *)_supported_mime_types->data));
- gchar *suffix = NULL;
if(!strcmp(mime_type, "application/x-tar")) suffix = ".tar";
if(!strcmp(mime_type, "application/x-compressed-tar")) suffix = ".tar.gz";
if(!strcmp(mime_type, "application/x-bzip-compressed-tar")) suffix = ".tar.bz2";
diff --git a/src/notebook.c b/src/notebook.c
index 25487bd..05ba718 100644
--- a/src/notebook.c
+++ b/src/notebook.c
@@ -95,7 +95,7 @@ static gint sq_notebook_signals[SQ_NOTEBOOK_SIGNAL_COUNT];
static GObjectClass *parent_class;
GType
-sq_notebook_get_type ()
+sq_notebook_get_type (void)
{
static GType sq_notebook_type = 0;
@@ -246,6 +246,8 @@ sq_notebook_dispose(GObject *object)
/* TODO: unref archive_stores */
GtkNotebook *notebook = GTK_NOTEBOOK(object);
SQNotebook *sq_notebook = SQ_NOTEBOOK(object);
+ gint n;
+ gint i = 0;
if(sq_notebook->settings)
{
@@ -261,8 +263,7 @@ sq_notebook_dispose(GObject *object)
sq_notebook->settings = NULL;
}
- gint n = gtk_notebook_get_n_pages(notebook);
- gint i = 0;
+ n = gtk_notebook_get_n_pages(notebook);
for(i = n-1; i >= 0; --i)
{
GtkWidget *scrolledwindow = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), i);
@@ -429,10 +430,12 @@ static SQArchiveStore *
sq_notebook_get_store(SQNotebook *notebook, gint page_nr)
{
GtkWidget *scrolledwindow = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), page_nr);
+ GtkWidget *treeview;
+ GtkTreeModel *archive_store;
if(!scrolledwindow)
return NULL;
- GtkWidget *treeview = gtk_bin_get_child(GTK_BIN(scrolledwindow));
- GtkTreeModel *archive_store = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview));
+ treeview = gtk_bin_get_child(GTK_BIN(scrolledwindow));
+ archive_store = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview));
return SQ_ARCHIVE_STORE(archive_store);
}
@@ -448,9 +451,10 @@ static GtkTreeView *
sq_notebook_get_tree_view(SQNotebook *notebook, gint page_nr)
{
GtkWidget *scrolledwindow = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), page_nr);
+ GtkWidget *treeview;
if(!scrolledwindow)
return NULL;
- GtkWidget *treeview = gtk_bin_get_child(GTK_BIN(scrolledwindow));
+ treeview = gtk_bin_get_child(GTK_BIN(scrolledwindow));
return GTK_TREE_VIEW(treeview);
}
@@ -504,15 +508,22 @@ sq_notebook_add_archive(SQNotebook *notebook, LSQArchive *archive, gboolean new_
GtkWidget *archive_image = gtk_image_new_from_icon_name("unknown", GTK_ICON_SIZE_MENU);
GtkWidget *throbber = sq_throbber_new();
GtkWidget *alignment = gtk_alignment_new(0.5,0.5,1,1);
+ GtkWidget *close_button;
+ GtkWidget *close_image;
+ GtkWidget *scroll_window;
+ GtkWidget *tree_view;
+ GtkTreeSelection *selection;
+ GtkTreeModel *tree_model;
+ gint page_nr;
gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 4, 0, 0, 0);
gtk_container_add(GTK_CONTAINER(alignment), throbber);
/*thunar_vfs_mime_info_lookup_icon_name(lsq_archive_get_mimetype(archive), notebook->icon_theme), GTK_ICON_SIZE_MENU);*/
- GtkWidget *close_button = gtk_button_new();
- GtkWidget *close_image = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
- GtkWidget *scroll_window = gtk_scrolled_window_new(NULL, NULL);
+ close_button = gtk_button_new();
+ close_image = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
+ scroll_window = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@@ -526,14 +537,14 @@ sq_notebook_add_archive(SQNotebook *notebook, LSQArchive *archive, gboolean new_
gtk_tooltips_set_tip(notebook->tool_tips, label, g_file_get_basename(lsq_archive_get_file(archive)), NULL);
- GtkWidget *tree_view = gtk_tree_view_new();
+ tree_view = gtk_tree_view_new();
g_signal_connect(G_OBJECT(tree_view), "notify", G_CALLBACK(cb_sq_notebook_notify_proxy), notebook);
gtk_tree_view_set_enable_search(GTK_TREE_VIEW(tree_view), TRUE);
- GtkTreeSelection *selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (tree_view) );
+ selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (tree_view) );
gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
- GtkTreeModel *tree_model = sq_archive_store_new(archive, notebook->props._show_icons, notebook->props._up_dir, notebook->icon_theme);
+ tree_model = sq_archive_store_new(archive, notebook->props._show_icons, notebook->props._up_dir, notebook->icon_theme);
sq_archive_store_set_show_full_path(SQ_ARCHIVE_STORE(tree_model), notebook->props._show_full_path);
sq_archive_store_set_sort_folders_first(SQ_ARCHIVE_STORE(tree_model), notebook->props._sort_folders_first);
sq_archive_store_set_sort_case_sensitive(SQ_ARCHIVE_STORE(tree_model), notebook->props._sort_case_sensitive);
@@ -570,7 +581,7 @@ sq_notebook_add_archive(SQNotebook *notebook, LSQArchive *archive, gboolean new_
gtk_container_add(GTK_CONTAINER(scroll_window), tree_view);
- gint page_nr = gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scroll_window, lbl_hbox);
+ page_nr = gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scroll_window, lbl_hbox);
if(page_nr >= 0)
{
gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), page_nr);
@@ -589,6 +600,7 @@ static void
cb_notebook_close_archive(GtkButton *button, GtkWidget *child)
{
GtkNotebook *notebook = GTK_NOTEBOOK(gtk_widget_get_parent(child));
+ gint n;
GtkWidget *treeview = gtk_bin_get_child(GTK_BIN(child));
GtkTreeModel *archive_store = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview));
@@ -605,7 +617,7 @@ cb_notebook_close_archive(GtkButton *button, GtkWidget *child)
lsq_close_archive(archive);
- gint n = gtk_notebook_page_num(notebook, child);
+ n = gtk_notebook_page_num(notebook, child);
gtk_notebook_remove_page(notebook, n);
g_signal_emit(G_OBJECT(notebook), sq_notebook_signals[SQ_NOTEBOOK_SIGNAL_ARCHIVE_REMOVED], 0, NULL);
}
@@ -681,7 +693,7 @@ sq_notebook_treeview_reset_columns(LSQArchive *archive, GtkTreeView *treeview)
{
GtkCellRenderer *renderer = NULL;
GtkTreeViewColumn *column = NULL;
- gint x = 0;
+ guint x = 0;
GList *columns = gtk_tree_view_get_columns(treeview);
gboolean show_only_filenames = FALSE;
@@ -788,9 +800,10 @@ gboolean
sq_notebook_is_active_archive(SQNotebook *notebook, LSQArchive *archive)
{
SQArchiveStore *archive_store = sq_notebook_get_active_store(notebook);
+ LSQArchive * lp_archive;
if(!archive_store)
return FALSE;
- LSQArchive * lp_archive = sq_archive_store_get_archive(archive_store);
+ lp_archive = sq_archive_store_get_archive(archive_store);
if(lp_archive == archive)
return TRUE;
return FALSE;
@@ -839,8 +852,6 @@ sq_notebook_get_selected_items(SQNotebook *notebook)
{
GtkWidget *scrolledwindow = sq_notebook_get_active_child(notebook);
GtkTreeIter iter;
- GValue value;
- memset(&value, 0, sizeof(GValue));
GSList *filenames = NULL;
GtkWidget *treeview = gtk_bin_get_child(GTK_BIN(scrolledwindow));
@@ -850,8 +861,9 @@ sq_notebook_get_selected_items(SQNotebook *notebook)
GList *_rows = rows;
while(_rows)
{
+ LSQArchiveIter *entry;
gtk_tree_model_get_iter(store, &iter, _rows->data);
- LSQArchiveIter *entry = sq_archive_store_get_archive_iter(SQ_ARCHIVE_STORE(store), &iter);
+ entry = sq_archive_store_get_archive_iter(SQ_ARCHIVE_STORE(store), &iter);
lsq_archive_iter_ref(entry);
filenames = g_slist_prepend(filenames, entry);
@@ -878,10 +890,13 @@ cb_sq_notebook_notify_proxy(GObject *obj, GParamSpec *pspec, gpointer user_data)
{
if(strcmp(g_param_spec_get_name(pspec), "show-icons") == 0)
{
+ GtkTreeView *treeview;
+ SQArchiveStore *store;
+
g_object_notify(user_data, g_param_spec_get_name(pspec));
- GtkTreeView *treeview = sq_notebook_get_active_tree_view(SQ_NOTEBOOK(user_data));
- SQArchiveStore *store = SQ_ARCHIVE_STORE(gtk_tree_view_get_model(treeview));
+ treeview = sq_notebook_get_active_tree_view(SQ_NOTEBOOK(user_data));
+ store = SQ_ARCHIVE_STORE(gtk_tree_view_get_model(treeview));
sq_notebook_treeview_reset_columns(sq_archive_store_get_archive(store), treeview);
}
diff --git a/src/path_bar.c b/src/path_bar.c
index ec6d7d3..cd41b6f 100644
--- a/src/path_bar.c
+++ b/src/path_bar.c
@@ -95,7 +95,7 @@ static void
cb_sq_path_bar_right_clicked(GtkWidget *widget, gpointer user_data);
GType
-sq_path_bar_get_type ()
+sq_path_bar_get_type (void)
{
static GType sq_path_bar_type = 0;
@@ -640,10 +640,12 @@ cb_sq_path_bar_pwd_changed(SQArchiveStore *store, LSQArchiveIter *path, SQNaviga
static void
cb_sq_path_bar_path_button_clicked(GtkRadioButton *button, SQPathBar *path_bar)
{
+ LSQArchiveIter *path;
+
if(path_bar->updating)
return;
- LSQArchiveIter *path = g_object_get_data(G_OBJECT(button), SQ_PATH_BAR_PATH_BUTTON_ITER);
+ path = g_object_get_data(G_OBJECT(button), SQ_PATH_BAR_PATH_BUTTON_ITER);
sq_archive_store_set_pwd(SQ_NAVIGATION_BAR(path_bar)->store, path);
}
diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c
index 0550af6..89515d0 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -43,7 +43,7 @@ static GtkWidget *
sq_preferences_dialog_create_support_object_page(SQSupportTuple *tuple);
GType
-sq_preferences_dialog_get_type ()
+sq_preferences_dialog_get_type (void)
{
static GType sq_preferences_dialog_type = 0;
@@ -139,7 +139,7 @@ sq_preferences_dialog_init(SQPreferencesDialog *dialog)
}
GtkWidget *
-sq_preferences_dialog_new()
+sq_preferences_dialog_new(void)
{
GtkWidget *dialog;
diff --git a/src/properties_dialog.c b/src/properties_dialog.c
index 5bc8050..7cd3de3 100644
--- a/src/properties_dialog.c
+++ b/src/properties_dialog.c
@@ -31,7 +31,7 @@ static void
sq_properties_dialog_init(SQPropertiesDialog *archive);
GType
-sq_properties_dialog_get_type ()
+sq_properties_dialog_get_type (void)
{
static GType sq_properties_dialog_type = 0;
diff --git a/src/settings.c b/src/settings.c
index aa4e70c..92f1dc2 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -35,7 +35,7 @@ static GObject *
sq_settings_singleton_constuctor(GType, guint, GObjectConstructParam *);
GType
-sq_settings_get_type ()
+sq_settings_get_type (void)
{
static GType sq_settings_type = 0;
@@ -78,7 +78,7 @@ sq_settings_class_init(SQSettingsClass *object_class)
}
SQSettings *
-sq_settings_new()
+sq_settings_new(void)
{
sq_global_settings = g_object_new(SQ_TYPE_SETTINGS, NULL);
diff --git a/src/tool_bar.c b/src/tool_bar.c
index a4eb185..e45caa5 100644
--- a/src/tool_bar.c
+++ b/src/tool_bar.c
@@ -71,7 +71,7 @@ static void
cb_sq_tool_bar_path_field_activated(GtkWidget *entry, SQToolBar *tool_bar);
GType
-sq_tool_bar_get_type ()
+sq_tool_bar_get_type (void)
{
static GType sq_tool_bar_type = 0;
diff --git a/src/widget_factory.c b/src/widget_factory.c
index b6dc80d..33a3c69 100644
--- a/src/widget_factory.c
+++ b/src/widget_factory.c
@@ -77,7 +77,7 @@ cb_sq_widget_factory_object_destroyed(GtkObject *obj, gpointer user_data);
/* sq_widget_factory_notify(LSQCustomAction *action, const gchar *message); */
GType
-sq_widget_factory_get_type()
+sq_widget_factory_get_type(void)
{
static GType sq_widget_factory_type = 0;
@@ -117,7 +117,7 @@ sq_widget_factory_init(SQWidgetFactory *factory)
}
SQWidgetFactory*
-sq_widget_factory_new()
+sq_widget_factory_new(void)
{
SQWidgetFactory *factory;
@@ -130,6 +130,8 @@ static GtkWidget*
sq_widget_factory_create_boolean_widget(SQWidgetFactory *factory, GObject *obj, GParamSpec *pspec, const GValue *value)
{
GtkWidget *check = gtk_check_button_new_with_label(g_param_spec_get_nick(pspec));
+ const gchar *large_tip;
+ gchar *small_tip = NULL;
g_object_set_data(G_OBJECT(check), SQ_PROPERTY_SPEC_DATA, pspec);
g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(cb_sq_widget_factory_property_changed), obj);
@@ -142,8 +144,7 @@ sq_widget_factory_create_boolean_widget(SQWidgetFactory *factory, GObject *obj,
else
g_object_ref(obj);
- const gchar *large_tip = g_param_spec_get_blurb(pspec);
- gchar *small_tip = NULL;
+ large_tip = g_param_spec_get_blurb(pspec);
if(strchr(large_tip, '\n'))
{
small_tip = g_strndup(large_tip, strchr(large_tip, '\n') - large_tip);
@@ -171,6 +172,8 @@ sq_widget_factory_create_numeric_widget(SQWidgetFactory *factory, GObject *obj,
guint digits = 0;
GtkAdjustment *adjust;
GtkWidget *spin;
+ const gchar *large_tip;
+ gchar *small_tip = NULL;
memset(&double_value, 0, sizeof(GValue));
@@ -257,8 +260,7 @@ sq_widget_factory_create_numeric_widget(SQWidgetFactory *factory, GObject *obj,
gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 3);
gtk_box_pack_end(GTK_BOX(box), spin, TRUE, TRUE, 3);
- const gchar *large_tip = g_param_spec_get_blurb(pspec);
- gchar *small_tip = NULL;
+ large_tip = g_param_spec_get_blurb(pspec);
if(strchr(large_tip, '\n'))
{
small_tip = g_strndup(large_tip, strchr(large_tip, '\n') - large_tip);
@@ -285,6 +287,8 @@ sq_widget_factory_create_enum_widget_group(SQWidgetFactory *factory, GObject *ob
GtkWidget *radio = NULL;
guint i, n = G_PARAM_SPEC_ENUM(pspec)->enum_class->n_values;
GEnumValue *values = G_PARAM_SPEC_ENUM(pspec)->enum_class->values;
+ const gchar *large_tip;
+ gchar *small_tip = NULL;
for(i = 0; i < n; ++i)
{
@@ -308,8 +312,7 @@ sq_widget_factory_create_enum_widget_group(SQWidgetFactory *factory, GObject *ob
gtk_container_add(GTK_CONTAINER(frame), box);
- const gchar *large_tip = g_param_spec_get_blurb(pspec);
- gchar *small_tip = NULL;
+ large_tip = g_param_spec_get_blurb(pspec);
if(strchr(large_tip, '\n'))
{
small_tip = g_strndup(large_tip, strchr(large_tip, '\n') - large_tip);
@@ -331,8 +334,10 @@ sq_widget_factory_create_enum_widget_list(SQWidgetFactory *factory, GObject *obj
GtkWidget *box = gtk_hbox_new(FALSE, 3);
GtkWidget *label = gtk_label_new(g_param_spec_get_nick(pspec));
GtkWidget *combo = gtk_combo_box_new_text();
- guint select = 0, i, n = G_PARAM_SPEC_ENUM(pspec)->enum_class->n_values;
+ guint select_ = 0, i, n = G_PARAM_SPEC_ENUM(pspec)->enum_class->n_values;
GEnumValue *values = G_PARAM_SPEC_ENUM(pspec)->enum_class->values;
+ const gchar *large_tip;
+ gchar *small_tip = NULL;
g_object_set_data(G_OBJECT(combo), SQ_PROPERTY_SPEC_DATA, pspec);
g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(cb_sq_widget_factory_property_changed), obj);
@@ -349,16 +354,15 @@ sq_widget_factory_create_enum_widget_list(SQWidgetFactory *factory, GObject *obj
gtk_combo_box_append_text(GTK_COMBO_BOX(combo), values[i].value_nick);
if(g_value_get_enum(value) == values[i].value)
- select = i;
+ select_ = i;
}
- gtk_combo_box_set_active(GTK_COMBO_BOX(combo), select);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), select_);
gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 3);
gtk_box_pack_end(GTK_BOX(box), combo, TRUE, TRUE, 3);
- const gchar *large_tip = g_param_spec_get_blurb(pspec);
- gchar *small_tip = NULL;
+ large_tip = g_param_spec_get_blurb(pspec);
if(strchr(large_tip, '\n'))
{
small_tip = g_strndup(large_tip, strchr(large_tip, '\n') - large_tip);
@@ -383,6 +387,8 @@ sq_widget_factory_create_flags_widget(SQWidgetFactory *factory, GObject *obj, GP
GtkWidget *check;
guint i, n = G_PARAM_SPEC_FLAGS(pspec)->flags_class->n_values;
GFlagsValue *values = G_PARAM_SPEC_FLAGS(pspec)->flags_class->values;
+ const gchar *large_tip;
+ gchar *small_tip = NULL;
gtk_container_add(GTK_CONTAINER(frame), box);
@@ -405,8 +411,7 @@ sq_widget_factory_create_flags_widget(SQWidgetFactory *factory, GObject *obj, GP
gtk_box_pack_start(GTK_BOX(box), check, FALSE, FALSE, 5);
}
- const gchar *large_tip = g_param_spec_get_blurb(pspec);
- gchar *small_tip = NULL;
+ large_tip = g_param_spec_get_blurb(pspec);
if(strchr(large_tip, '\n'))
{
small_tip = g_strndup(large_tip, strchr(large_tip, '\n') - large_tip);
@@ -428,6 +433,8 @@ sq_widget_factory_create_string_widget(SQWidgetFactory *factory, GObject *obj, G
GtkWidget *box = gtk_hbox_new(FALSE, 3);
GtkWidget *label = gtk_label_new(g_param_spec_get_nick(pspec));
GtkWidget *entry = gtk_entry_new();
+ const gchar *large_tip;
+ gchar *small_tip = NULL;
g_object_set_data(G_OBJECT(entry), SQ_PROPERTY_SPEC_DATA, pspec);
g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(cb_sq_widget_factory_property_changed), obj);
@@ -444,8 +451,7 @@ sq_widget_factory_create_string_widget(SQWidgetFactory *factory, GObject *obj, G
gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 3);
gtk_box_pack_end(GTK_BOX(box), entry, TRUE, TRUE, 3);
- const gchar *large_tip = g_param_spec_get_blurb(pspec);
- gchar *small_tip = NULL;
+ large_tip = g_param_spec_get_blurb(pspec);
if(strchr(large_tip, '\n'))
{
small_tip = g_strndup(large_tip, strchr(large_tip, '\n') - large_tip);
More information about the Xfce4-commits
mailing list