aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/menus
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-08-16 23:25:56 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-09-04 19:34:32 +0800
commitfcbbdfbd18e15b4ee8322a0217cf03a689a5e033 (patch)
treee16cd2a2279558c6a2bfb6ca39fcbaac4c85ba59 /widgets/menus
parentf78417c48861759d7b0c4535ecd3febe4638a7d3 (diff)
downloadgsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.gz
gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.zst
gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'widgets/menus')
-rw-r--r--widgets/menus/gal-define-views-dialog.c59
-rw-r--r--widgets/menus/gal-define-views-model.c44
-rw-r--r--widgets/menus/gal-view-collection.c113
-rw-r--r--widgets/menus/gal-view-collection.h2
-rw-r--r--widgets/menus/gal-view-etable.c55
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.c30
-rw-r--r--widgets/menus/gal-view-instance.c36
-rw-r--r--widgets/menus/gal-view-new-dialog.c47
8 files changed, 224 insertions, 162 deletions
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c
index ec31c44162..1c4ff5172e 100644
--- a/widgets/menus/gal-define-views-dialog.c
+++ b/widgets/menus/gal-define-views-dialog.c
@@ -34,8 +34,8 @@
#include "gal-define-views-model.h"
#include "gal-view-new-dialog.h"
-static void gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void gal_define_views_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+static void gal_define_views_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
+static void gal_define_views_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
static void gal_define_views_dialog_dispose (GObject *object);
/* The properties we support */
@@ -65,7 +65,7 @@ gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass)
{
GObjectClass *object_class;
- object_class = (GObjectClass*) klass;
+ object_class = (GObjectClass *) klass;
object_class->set_property = gal_define_views_dialog_set_property;
object_class->get_property = gal_define_views_dialog_get_property;
@@ -82,7 +82,9 @@ gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass)
/* Button callbacks */
static void
-gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialog *dialog)
+gdvd_button_new_dialog_callback (GtkWidget *widget,
+ gint id,
+ GalDefineViewsDialog *dialog)
{
gchar *name;
GtkTreeIter iter;
@@ -103,7 +105,7 @@ gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialo
view = gal_view_factory_new_view (factory, name);
gal_view_collection_append (dialog->collection, view);
- item = dialog->collection->view_data[dialog->collection->view_count-1];
+ item = dialog->collection->view_data[dialog->collection->view_count - 1];
gtk_list_store_append (GTK_LIST_STORE (dialog->model), &iter);
gtk_list_store_set (GTK_LIST_STORE (dialog->model), &iter,
COL_GALVIEW_NAME, name,
@@ -123,7 +125,8 @@ gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialo
}
static void
-gdvd_button_new_callback (GtkWidget *widget, GalDefineViewsDialog *dialog)
+gdvd_button_new_callback (GtkWidget *widget,
+ GalDefineViewsDialog *dialog)
{
GtkWidget *view_new_dialog = gal_view_new_dialog_new (dialog->collection);
gtk_window_set_transient_for (GTK_WINDOW (view_new_dialog), GTK_WINDOW (dialog));
@@ -133,7 +136,8 @@ gdvd_button_new_callback (GtkWidget *widget, GalDefineViewsDialog *dialog)
}
static void
-gdvd_button_modify_callback (GtkWidget *widget, GalDefineViewsDialog *dialog)
+gdvd_button_modify_callback (GtkWidget *widget,
+ GalDefineViewsDialog *dialog)
{
GtkTreeIter iter;
GalViewCollectionItem *item;
@@ -150,7 +154,8 @@ gdvd_button_modify_callback (GtkWidget *widget, GalDefineViewsDialog *dialog)
}
static void
-gdvd_button_delete_callback (GtkWidget *widget, GalDefineViewsDialog *dialog)
+gdvd_button_delete_callback (GtkWidget *widget,
+ GalDefineViewsDialog *dialog)
{
gint row;
GtkTreeIter iter;
@@ -167,7 +172,7 @@ gdvd_button_delete_callback (GtkWidget *widget, GalDefineViewsDialog *dialog)
g_return_if_fail (item && !item->built_in);
- for (row=0; row<dialog->collection->view_count; row++) {
+ for (row = 0; row < dialog->collection->view_count; row++) {
if (item == dialog->collection->view_data[row]) {
gal_view_collection_delete_view (dialog->collection, row);
path = gtk_tree_model_get_path (dialog->model, &iter);
@@ -187,7 +192,8 @@ gdvd_button_delete_callback (GtkWidget *widget, GalDefineViewsDialog *dialog)
}
static void
-gdvd_selection_changed_callback (GtkTreeSelection *selection, GalDefineViewsDialog *dialog)
+gdvd_selection_changed_callback (GtkTreeSelection *selection,
+ GalDefineViewsDialog *dialog)
{
GtkWidget *button;
GtkTreeIter iter;
@@ -209,7 +215,10 @@ gdvd_selection_changed_callback (GtkTreeSelection *selection, GalDefineViewsDial
}
static void
-gdvd_connect_signal (GalDefineViewsDialog *dialog, const gchar *widget_name, const gchar *signal, GCallback handler)
+gdvd_connect_signal (GalDefineViewsDialog *dialog,
+ const gchar *widget_name,
+ const gchar *signal,
+ GCallback handler)
{
GtkWidget *widget;
@@ -220,7 +229,9 @@ gdvd_connect_signal (GalDefineViewsDialog *dialog, const gchar *widget_name, con
}
static void
-dialog_response (GalDefineViewsDialog *dialog, gint response_id, gpointer data)
+dialog_response (GalDefineViewsDialog *dialog,
+ gint response_id,
+ gpointer data)
{
gal_view_collection_save (dialog->collection);
}
@@ -293,7 +304,7 @@ gal_define_views_dialog_dispose (GObject *object)
static void
gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog,
- GalViewCollection *collection)
+ GalViewCollection *collection)
{
gint i;
GtkListStore *store;
@@ -302,7 +313,7 @@ gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog,
store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
- for (i=0; i<collection->view_count; i++) {
+ for (i = 0; i < collection->view_count; i++) {
GalViewCollectionItem *item = collection->view_data[i];
GtkTreeIter iter;
@@ -368,7 +379,7 @@ gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog,
*
* Returns: The GalDefineViewsDialog.
*/
-GtkWidget*
+GtkWidget *
gal_define_views_dialog_new (GalViewCollection *collection)
{
GtkWidget *widget = g_object_new (GAL_TYPE_DEFINE_VIEWS_DIALOG, NULL);
@@ -377,13 +388,16 @@ gal_define_views_dialog_new (GalViewCollection *collection)
}
static void
-gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+gal_define_views_dialog_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GalDefineViewsDialog *dialog;
dialog = GAL_DEFINE_VIEWS_DIALOG (object);
- switch (prop_id) {
+ switch (property_id) {
case PROP_COLLECTION:
if (g_value_get_object (value))
gal_define_views_dialog_set_collection (dialog, GAL_VIEW_COLLECTION (g_value_get_object (value)));
@@ -392,24 +406,27 @@ gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GVal
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
return;
}
}
static void
-gal_define_views_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+gal_define_views_dialog_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GalDefineViewsDialog *dialog;
dialog = GAL_DEFINE_VIEWS_DIALOG (object);
- switch (prop_id) {
+ switch (property_id) {
case PROP_COLLECTION:
g_value_set_object (value, dialog->collection);
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c
index 14031caf2b..7c69bce720 100644
--- a/widgets/menus/gal-define-views-model.c
+++ b/widgets/menus/gal-define-views-model.c
@@ -126,7 +126,9 @@ gdvm_row_count (ETableModel *etc)
/* This function returns the value at a particular point in our ETableModel. */
static gpointer
-gdvm_value_at (ETableModel *etc, gint col, gint row)
+gdvm_value_at (ETableModel *etc,
+ gint col,
+ gint row)
{
GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc);
const gchar *value;
@@ -138,7 +140,10 @@ gdvm_value_at (ETableModel *etc, gint col, gint row)
/* This function sets the value at a particular point in our ETableModel. */
static void
-gdvm_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val)
+gdvm_set_value_at (ETableModel *etc,
+ gint col,
+ gint row,
+ gconstpointer val)
{
GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc);
if (views->editable) {
@@ -154,44 +159,57 @@ gdvm_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val)
/* This function returns whether a particular cell is editable. */
static gboolean
-gdvm_is_cell_editable (ETableModel *etc, gint col, gint row)
+gdvm_is_cell_editable (ETableModel *etc,
+ gint col,
+ gint row)
{
return GAL_DEFINE_VIEWS_MODEL (etc)->editable;
}
static void
-gdvm_append_row (ETableModel *etm, ETableModel *source, gint row)
+gdvm_append_row (ETableModel *etm,
+ ETableModel *source,
+ gint row)
{
}
/* This function duplicates the value passed to it. */
static gpointer
-gdvm_duplicate_value (ETableModel *etc, gint col, gconstpointer value)
+gdvm_duplicate_value (ETableModel *etc,
+ gint col,
+ gconstpointer value)
{
return g_strdup (value);
}
/* This function frees the value passed to it. */
static void
-gdvm_free_value (ETableModel *etc, gint col, gpointer value)
+gdvm_free_value (ETableModel *etc,
+ gint col,
+ gpointer value)
{
g_free (value);
}
static gpointer
-gdvm_initialize_value (ETableModel *etc, gint col)
+gdvm_initialize_value (ETableModel *etc,
+ gint col)
{
return g_strdup("");
}
static gboolean
-gdvm_value_is_empty (ETableModel *etc, gint col, gconstpointer value)
+gdvm_value_is_empty (ETableModel *etc,
+ gint col,
+ gconstpointer value)
{
return !(value && *(gchar *) value);
}
static gchar *
-gdvm_value_to_string (ETableModel *etc, gint col, gconstpointer value)
+gdvm_value_to_string (ETableModel *etc,
+ gint col,
+ gconstpointer value)
{
return g_strdup (value);
}
@@ -205,7 +223,7 @@ gdvm_value_to_string (ETableModel *etc, gint col, gconstpointer value)
*/
void
gal_define_views_model_append (GalDefineViewsModel *model,
- GalView *view)
+ GalView *view)
{
ETableModel *etm = E_TABLE_MODEL (model);
@@ -287,7 +305,7 @@ gal_define_views_model_new (void)
*/
GalView *
gal_define_views_model_get_view (GalDefineViewsModel *model,
- gint n)
+ gint n)
{
return gal_view_collection_get_view (model->collection, n);
}
@@ -301,7 +319,7 @@ gal_define_views_model_get_view (GalDefineViewsModel *model,
*/
void
gal_define_views_model_delete_view (GalDefineViewsModel *model,
- gint n)
+ gint n)
{
e_table_model_pre_change (E_TABLE_MODEL (model));
gal_view_collection_delete_view (model->collection, n);
@@ -317,7 +335,7 @@ gal_define_views_model_delete_view (GalDefineViewsModel *model,
*/
void
gal_define_views_model_copy_view (GalDefineViewsModel *model,
- gint n)
+ gint n)
{
ETableModel *etm = E_TABLE_MODEL (model);
e_table_model_pre_change (etm);
diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c
index 39ce216ce1..1d565d7c21 100644
--- a/widgets/menus/gal-view-collection.c
+++ b/widgets/menus/gal-view-collection.c
@@ -58,11 +58,9 @@ static guint gal_view_collection_signals[LAST_SIGNAL] = { 0, };
*/
void
gal_view_collection_display_view (GalViewCollection *collection,
- GalView *view)
+ GalView *view)
{
- g_return_if_fail (collection != NULL);
g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
- g_return_if_fail (view != NULL);
g_return_if_fail (GAL_IS_VIEW (view));
g_signal_emit (collection,
@@ -73,7 +71,6 @@ gal_view_collection_display_view (GalViewCollection *collection,
static void
gal_view_collection_changed (GalViewCollection *collection)
{
- g_return_if_fail (collection != NULL);
g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
g_signal_emit (collection,
@@ -95,8 +92,8 @@ gal_view_collection_item_free (GalViewCollectionItem *item)
static gchar *
gal_view_generate_string (GalViewCollection *collection,
- GalView *view,
- gint which)
+ GalView *view,
+ gint which)
{
gchar *ret_val;
gchar *pointer;
@@ -117,7 +114,7 @@ gal_view_generate_string (GalViewCollection *collection,
static gint
gal_view_check_string (GalViewCollection *collection,
- gchar *string)
+ gchar *string)
{
gint i;
@@ -137,7 +134,7 @@ gal_view_check_string (GalViewCollection *collection,
static gchar *
gal_view_generate_id (GalViewCollection *collection,
- GalView *view)
+ GalView *view)
{
gint i;
for (i = 1; TRUE; i++) {
@@ -247,14 +244,14 @@ gal_view_collection_init (GalViewCollection *collection)
* A collection of views and view factories.
*/
GalViewCollection *
-gal_view_collection_new (void)
+gal_view_collection_new (void)
{
return g_object_new (GAL_VIEW_COLLECTION_TYPE, NULL);
}
void
gal_view_collection_set_title (GalViewCollection *collection,
- const gchar *title)
+ const gchar *title)
{
g_free (collection->title);
collection->title = g_strdup (title);
@@ -269,11 +266,10 @@ gal_view_collection_set_title (GalViewCollection *collection,
* Sets up the GalViewCollection.
*/
void
-gal_view_collection_set_storage_directories (GalViewCollection *collection,
- const gchar *system_dir,
- const gchar *local_dir)
+gal_view_collection_set_storage_directories (GalViewCollection *collection,
+ const gchar *system_dir,
+ const gchar *local_dir)
{
- g_return_if_fail (collection != NULL);
g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
g_return_if_fail (system_dir != NULL);
g_return_if_fail (local_dir != NULL);
@@ -297,12 +293,10 @@ gal_view_collection_set_storage_directories (GalViewCollection *collection,
* user tries to create a new view.
*/
void
-gal_view_collection_add_factory (GalViewCollection *collection,
- GalViewFactory *factory)
+gal_view_collection_add_factory (GalViewCollection *collection,
+ GalViewFactory *factory)
{
- g_return_if_fail (collection != NULL);
g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
- g_return_if_fail (factory != NULL);
g_return_if_fail (GAL_IS_VIEW_FACTORY (factory));
g_object_ref (factory);
@@ -311,7 +305,7 @@ gal_view_collection_add_factory (GalViewCollection *collection,
static void
view_changed (GalView *view,
- GalViewCollectionItem *item)
+ GalViewCollectionItem *item)
{
item->changed = TRUE;
item->ever_changed = TRUE;
@@ -323,7 +317,11 @@ view_changed (GalView *view,
/* Use factory list to load a GalView file. */
static GalView *
-gal_view_collection_real_load_view_from_file (GalViewCollection *collection, const gchar *type, const gchar *title, const gchar *dir, const gchar *filename)
+gal_view_collection_real_load_view_from_file (GalViewCollection *collection,
+ const gchar *type,
+ const gchar *title,
+ const gchar *dir,
+ const gchar *filename)
{
GalViewFactory *factory;
GList *factories;
@@ -347,16 +345,18 @@ gal_view_collection_real_load_view_from_file (GalViewCollection *collection, con
}
GalView *
-gal_view_collection_load_view_from_file (GalViewCollection *collection, const gchar *type, const gchar *filename)
+gal_view_collection_load_view_from_file (GalViewCollection *collection,
+ const gchar *type,
+ const gchar *filename)
{
return gal_view_collection_real_load_view_from_file (collection, type, "", collection->local_dir, filename);
}
static GalViewCollectionItem *
load_single_file (GalViewCollection *collection,
- gchar *dir,
- gboolean local,
- xmlNode *node)
+ gchar *dir,
+ gboolean local,
+ xmlNode *node)
{
GalViewCollectionItem *item;
item = g_new (GalViewCollectionItem, 1);
@@ -377,7 +377,7 @@ load_single_file (GalViewCollection *collection,
g_free (fullpath);
if (item->view) {
item->view_changed_id =
- g_signal_connect(item->view, "changed",
+ g_signal_connect (item->view, "changed",
G_CALLBACK (view_changed), item);
}
}
@@ -386,8 +386,8 @@ load_single_file (GalViewCollection *collection,
static void
load_single_dir (GalViewCollection *collection,
- gchar *dir,
- gboolean local)
+ gchar *dir,
+ gboolean local)
{
xmlDoc *doc = NULL;
xmlNode *root;
@@ -477,9 +477,8 @@ load_single_dir (GalViewCollection *collection,
* other parts of gal_view.
*/
void
-gal_view_collection_load (GalViewCollection *collection)
+gal_view_collection_load (GalViewCollection *collection)
{
- g_return_if_fail (collection != NULL);
g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
g_return_if_fail (collection->local_dir != NULL);
g_return_if_fail (collection->system_dir != NULL);
@@ -504,14 +503,13 @@ gal_view_collection_load (GalViewCollection *collection)
* gal_view.
*/
void
-gal_view_collection_save (GalViewCollection *collection)
+gal_view_collection_save (GalViewCollection *collection)
{
gint i;
xmlDoc *doc;
xmlNode *root;
gchar *filename;
- g_return_if_fail (collection != NULL);
g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
g_return_if_fail (collection->local_dir != NULL);
@@ -571,7 +569,6 @@ gal_view_collection_save (GalViewCollection *collection)
gint
gal_view_collection_get_count (GalViewCollection *collection)
{
- g_return_val_if_fail (collection != NULL, -1);
g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), -1);
return collection->view_count;
@@ -586,9 +583,8 @@ gal_view_collection_get_count (GalViewCollection *collection)
*/
GalView *
gal_view_collection_get_view (GalViewCollection *collection,
- gint n)
+ gint n)
{
- g_return_val_if_fail (collection != NULL, NULL);
g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
g_return_val_if_fail (n < collection->view_count, NULL);
g_return_val_if_fail (n >= 0, NULL);
@@ -605,9 +601,8 @@ gal_view_collection_get_view (GalViewCollection *collection,
*/
GalViewCollectionItem *
gal_view_collection_get_view_item (GalViewCollection *collection,
- gint n)
+ gint n)
{
- g_return_val_if_fail (collection != NULL, NULL);
g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
g_return_val_if_fail (n < collection->view_count, NULL);
g_return_val_if_fail (n >= 0, NULL);
@@ -616,7 +611,8 @@ gal_view_collection_get_view_item (GalViewCollection *collection,
}
gint
-gal_view_collection_get_view_index_by_id (GalViewCollection *collection, const gchar *view_id)
+gal_view_collection_get_view_index_by_id (GalViewCollection *collection,
+ const gchar *view_id)
{
gint i;
for (i = 0; i < collection->view_count; i++) {
@@ -627,9 +623,9 @@ gal_view_collection_get_view_index_by_id (GalViewCollection *collection, con
}
gchar *
-gal_view_collection_get_view_id_by_index (GalViewCollection *collection, gint n)
+gal_view_collection_get_view_id_by_index (GalViewCollection *collection,
+ gint n)
{
- g_return_val_if_fail (collection != NULL, NULL);
g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
g_return_val_if_fail (n < collection->view_count, NULL);
g_return_val_if_fail (n >= 0, NULL);
@@ -638,14 +634,12 @@ gal_view_collection_get_view_id_by_index (GalViewCollection *collection, gint n)
}
void
-gal_view_collection_append (GalViewCollection *collection,
- GalView *view)
+gal_view_collection_append (GalViewCollection *collection,
+ GalView *view)
{
GalViewCollectionItem *item;
- g_return_if_fail (collection != NULL);
g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
- g_return_if_fail (view != NULL);
g_return_if_fail (GAL_IS_VIEW (view));
item = g_new (GalViewCollectionItem, 1);
@@ -661,7 +655,7 @@ gal_view_collection_append (GalViewCollection *collection,
g_object_ref (view);
item->view_changed_id =
- g_signal_connect(item->view, "changed",
+ g_signal_connect (item->view, "changed",
G_CALLBACK (view_changed), item);
collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
@@ -672,12 +666,11 @@ gal_view_collection_append (GalViewCollection *collection,
}
void
-gal_view_collection_delete_view (GalViewCollection *collection,
- gint i)
+gal_view_collection_delete_view (GalViewCollection *collection,
+ gint i)
{
GalViewCollectionItem *item;
- g_return_if_fail (collection != NULL);
g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
g_return_if_fail (i >= 0 && i < collection->view_count);
@@ -699,13 +692,12 @@ gal_view_collection_delete_view (GalViewCollection *collection,
}
void
-gal_view_collection_copy_view (GalViewCollection *collection,
- gint i)
+gal_view_collection_copy_view (GalViewCollection *collection,
+ gint i)
{
GalViewCollectionItem *item;
GalView *view;
- g_return_if_fail (collection != NULL);
g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
g_return_if_fail (i >= 0 && i < collection->view_count);
@@ -723,7 +715,7 @@ gal_view_collection_copy_view (GalViewCollection *collection,
item->collection = collection;
item->view_changed_id =
- g_signal_connect(item->view, "changed",
+ g_signal_connect (item->view, "changed",
G_CALLBACK (view_changed), item);
collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
@@ -740,13 +732,13 @@ gal_view_collection_loaded (GalViewCollection *collection)
}
const gchar *
-gal_view_collection_append_with_title (GalViewCollection *collection, const gchar *title, GalView *view)
+gal_view_collection_append_with_title (GalViewCollection *collection,
+ const gchar *title,
+ GalView *view)
{
GalViewCollectionItem *item;
- g_return_val_if_fail (collection != NULL, NULL);
g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
- g_return_val_if_fail (view != NULL, NULL);
g_return_val_if_fail (GAL_IS_VIEW (view), NULL);
gal_view_set_title (view, title);
@@ -766,7 +758,7 @@ gal_view_collection_append_with_title (GalViewCollection *collection, const gcha
g_object_ref (view);
item->view_changed_id =
- g_signal_connect(item->view, "changed",
+ g_signal_connect (item->view, "changed",
G_CALLBACK (view_changed), item);
collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
@@ -778,13 +770,13 @@ gal_view_collection_append_with_title (GalViewCollection *collection, const gcha
}
const gchar *
-gal_view_collection_set_nth_view (GalViewCollection *collection, gint i, GalView *view)
+gal_view_collection_set_nth_view (GalViewCollection *collection,
+ gint i,
+ GalView *view)
{
GalViewCollectionItem *item;
- g_return_val_if_fail (collection != NULL, NULL);
g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
- g_return_val_if_fail (view != NULL, NULL);
g_return_val_if_fail (GAL_IS_VIEW (view), NULL);
g_return_val_if_fail (i >= 0, NULL);
g_return_val_if_fail (i < collection->view_count, NULL);
@@ -807,7 +799,7 @@ gal_view_collection_set_nth_view (GalViewCollection *collection, gint i, GalView
item->type = g_strdup (gal_view_get_type_code (view));
item->view_changed_id =
- g_signal_connect(item->view, "changed",
+ g_signal_connect (item->view, "changed",
G_CALLBACK (view_changed), item);
gal_view_collection_changed (collection);
@@ -821,7 +813,8 @@ gal_view_collection_get_default_view (GalViewCollection *collection)
}
void
-gal_view_collection_set_default_view (GalViewCollection *collection, const gchar *id)
+gal_view_collection_set_default_view (GalViewCollection *collection,
+ const gchar *id)
{
g_free (collection->default_view);
collection->default_view = g_strdup (id);
diff --git a/widgets/menus/gal-view-collection.h b/widgets/menus/gal-view-collection.h
index a8dc3124e0..143bee53d1 100644
--- a/widgets/menus/gal-view-collection.h
+++ b/widgets/menus/gal-view-collection.h
@@ -129,7 +129,7 @@ GalView *gal_view_collection_load_view_from_file (GalViewColl
const gchar *filename);
/* Returns id of the new view. These functions are used for
- GalViewInstanceSaveAsDialog. */
+ * GalViewInstanceSaveAsDialog. */
const gchar *gal_view_collection_append_with_title (GalViewCollection *collection,
const gchar *title,
GalView *view);
diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c
index 4a3a3fb35c..c1fa5daf8b 100644
--- a/widgets/menus/gal-view-etable.c
+++ b/widgets/menus/gal-view-etable.c
@@ -59,7 +59,8 @@ detach_tree (GalViewEtable *view)
}
static void
-config_changed (ETableConfig *config, GalViewEtable *view)
+config_changed (ETableConfig *config,
+ GalViewEtable *view)
{
ETableState *state;
if (view->state)
@@ -74,7 +75,8 @@ config_changed (ETableConfig *config, GalViewEtable *view)
}
static void
-gal_view_etable_edit (GalView *view, GtkWindow *parent)
+gal_view_etable_edit (GalView *view,
+ GtkWindow *parent)
{
GalViewEtable *etable_view = GAL_VIEW_ETABLE (view);
ETableConfig *config;
@@ -84,33 +86,33 @@ gal_view_etable_edit (GalView *view, GtkWindow *parent)
etable_view->state,
parent);
- g_signal_connect(config, "changed",
+ g_signal_connect (config, "changed",
G_CALLBACK (config_changed), view);
}
static void
-gal_view_etable_load (GalView *view,
- const gchar *filename)
+gal_view_etable_load (GalView *view,
+ const gchar *filename)
{
e_table_state_load_from_file (GAL_VIEW_ETABLE (view)->state, filename);
}
static void
-gal_view_etable_save (GalView *view,
- const gchar *filename)
+gal_view_etable_save (GalView *view,
+ const gchar *filename)
{
e_table_state_save_to_file (GAL_VIEW_ETABLE (view)->state, filename);
}
static const gchar *
-gal_view_etable_get_title (GalView *view)
+gal_view_etable_get_title (GalView *view)
{
return GAL_VIEW_ETABLE (view)->title;
}
static void
gal_view_etable_set_title (GalView *view,
- const gchar *title)
+ const gchar *title)
{
g_free (GAL_VIEW_ETABLE (view)->title);
GAL_VIEW_ETABLE (view)->title = g_strdup (title);
@@ -123,7 +125,7 @@ gal_view_etable_get_type_code (GalView *view)
}
static GalView *
-gal_view_etable_clone (GalView *view)
+gal_view_etable_clone (GalView *view)
{
GalViewEtable *gve, *new;
@@ -140,7 +142,7 @@ gal_view_etable_clone (GalView *view)
}
static void
-gal_view_etable_dispose (GObject *object)
+gal_view_etable_dispose (GObject *object)
{
GalViewEtable *view = GAL_VIEW_ETABLE (object);
@@ -162,7 +164,7 @@ gal_view_etable_dispose (GObject *object)
}
static void
-gal_view_etable_class_init (GalViewEtableClass *klass)
+gal_view_etable_class_init (GalViewEtableClass *klass)
{
GalViewClass *gal_view_class = GAL_VIEW_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -179,7 +181,7 @@ gal_view_etable_class_init (GalViewEtableClass *klass)
}
static void
-gal_view_etable_init (GalViewEtable *gve)
+gal_view_etable_init (GalViewEtable *gve)
{
gve->spec = NULL;
gve->state = e_table_state_new ();
@@ -198,7 +200,7 @@ gal_view_etable_init (GalViewEtable *gve)
*/
GalView *
gal_view_etable_new (ETableSpecification *spec,
- const gchar *title)
+ const gchar *title)
{
GalViewEtable *view;
@@ -221,9 +223,9 @@ gal_view_etable_new (ETableSpecification *spec,
* Returns: The GalViewEtable.
*/
GalView *
-gal_view_etable_construct (GalViewEtable *view,
- ETableSpecification *spec,
- const gchar *title)
+gal_view_etable_construct (GalViewEtable *view,
+ ETableSpecification *spec,
+ const gchar *title)
{
g_return_val_if_fail (GAL_IS_VIEW_ETABLE (view), NULL);
g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (spec), NULL);
@@ -242,7 +244,8 @@ gal_view_etable_construct (GalViewEtable *view,
}
void
-gal_view_etable_set_state (GalViewEtable *view, ETableState *state)
+gal_view_etable_set_state (GalViewEtable *view,
+ ETableState *state)
{
g_return_if_fail (GAL_IS_VIEW_ETABLE (view));
g_return_if_fail (E_IS_TABLE_STATE (state));
@@ -255,7 +258,8 @@ gal_view_etable_set_state (GalViewEtable *view, ETableState *state)
}
static void
-table_state_changed (ETable *table, GalViewEtable *view)
+table_state_changed (ETable *table,
+ GalViewEtable *view)
{
ETableState *state;
@@ -267,7 +271,8 @@ table_state_changed (ETable *table, GalViewEtable *view)
}
static void
-tree_state_changed (ETree *tree, GalViewEtable *view)
+tree_state_changed (ETree *tree,
+ GalViewEtable *view)
{
ETableState *state;
@@ -279,7 +284,8 @@ tree_state_changed (ETree *tree, GalViewEtable *view)
}
void
-gal_view_etable_attach_table (GalViewEtable *view, ETable *table)
+gal_view_etable_attach_table (GalViewEtable *view,
+ ETable *table)
{
g_return_if_fail (GAL_IS_VIEW_ETABLE (view));
g_return_if_fail (E_IS_TABLE (table));
@@ -291,12 +297,13 @@ gal_view_etable_attach_table (GalViewEtable *view, ETable *table)
e_table_set_state_object (view->table, view->state);
g_object_ref (view->table);
view->table_state_changed_id =
- g_signal_connect(view->table, "state_change",
+ g_signal_connect (view->table, "state_change",
G_CALLBACK (table_state_changed), view);
}
void
-gal_view_etable_attach_tree (GalViewEtable *view, ETree *tree)
+gal_view_etable_attach_tree (GalViewEtable *view,
+ ETree *tree)
{
g_return_if_fail (GAL_IS_VIEW_ETABLE (view));
g_return_if_fail (E_IS_TREE (tree));
@@ -308,7 +315,7 @@ gal_view_etable_attach_tree (GalViewEtable *view, ETree *tree)
e_tree_set_state_object (view->tree, view->state);
g_object_ref (view->tree);
view->tree_state_changed_id =
- g_signal_connect(view->tree, "state_change",
+ g_signal_connect (view->tree, "state_change",
G_CALLBACK (tree_state_changed), view);
}
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c
index 49a0838833..a098e094b8 100644
--- a/widgets/menus/gal-view-instance-save-as-dialog.c
+++ b/widgets/menus/gal-view-instance-save-as-dialog.c
@@ -48,7 +48,7 @@ enum {
/* Static functions */
static void
gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dialog,
- GalViewInstance *instance)
+ GalViewInstance *instance)
{
gint i;
GtkListStore *store;
@@ -57,7 +57,7 @@ gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dial
store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
- for (i=0; i<instance->collection->view_count; i++) {
+ for (i = 0; i < instance->collection->view_count; i++) {
GalViewCollectionItem *item = instance->collection->view_data[i];
GtkTreeIter iter;
gchar *title = NULL;
@@ -145,26 +145,31 @@ gvisad_setup_radio_buttons (GalViewInstanceSaveAsDialog *dialog)
}
static void
-gvisad_radio_toggled (GtkWidget *widget, GalViewInstanceSaveAsDialog *dialog)
+gvisad_radio_toggled (GtkWidget *widget,
+ GalViewInstanceSaveAsDialog *dialog)
{
gvisad_setup_radio_buttons (dialog);
}
static void
-gvisad_entry_changed (GtkWidget *widget, GalViewInstanceSaveAsDialog *dialog)
+gvisad_entry_changed (GtkWidget *widget,
+ GalViewInstanceSaveAsDialog *dialog)
{
gvisad_setup_validate_button (dialog);
}
/* Method override implementations */
static void
-gal_view_instance_save_as_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+gal_view_instance_save_as_dialog_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GalViewInstanceSaveAsDialog *dialog;
dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object);
- switch (prop_id) {
+ switch (property_id) {
case PROP_INSTANCE:
if (g_value_get_object (value))
gal_view_instance_save_as_dialog_set_instance (dialog, GAL_VIEW_INSTANCE (g_value_get_object (value)));
@@ -178,19 +183,22 @@ gal_view_instance_save_as_dialog_set_property (GObject *object, guint prop_id, c
}
static void
-gal_view_instance_save_as_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+gal_view_instance_save_as_dialog_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GalViewInstanceSaveAsDialog *dialog;
dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object);
- switch (prop_id) {
+ switch (property_id) {
case PROP_INSTANCE:
g_value_set_object (value, dialog->instance);
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
@@ -214,7 +222,7 @@ gal_view_instance_save_as_dialog_class_init (GalViewInstanceSaveAsDialogClass *k
{
GObjectClass *object_class;
- object_class = (GObjectClass*) klass;
+ object_class = (GObjectClass *) klass;
object_class->set_property = gal_view_instance_save_as_dialog_set_property;
object_class->get_property = gal_view_instance_save_as_dialog_get_property;
@@ -312,7 +320,7 @@ gal_view_instance_save_as_dialog_save (GalViewInstanceSaveAsDialog *dialog)
if (gtk_tree_selection_get_selected (selection, &dialog->model, &iter)) {
gtk_tree_model_get (dialog->model, &iter, COL_GALVIEW_DATA, &item, -1);
- for (n=0; n<dialog->instance->collection->view_count; n++) {
+ for (n = 0; n < dialog->instance->collection->view_count; n++) {
if (item == dialog->instance->collection->view_data[n]) {
id = gal_view_collection_set_nth_view (dialog->instance->collection, n, view);
gal_view_collection_save (dialog->instance->collection);
diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c
index 22557082e4..f127868ab3 100644
--- a/widgets/menus/gal-view-instance.c
+++ b/widgets/menus/gal-view-instance.c
@@ -70,7 +70,8 @@ gal_view_instance_changed (GalViewInstance *instance)
}
static void
-gal_view_instance_display_view (GalViewInstance *instance, GalView *view)
+gal_view_instance_display_view (GalViewInstance *instance,
+ GalView *view)
{
g_return_if_fail (instance != NULL);
g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance));
@@ -101,7 +102,8 @@ save_current_view (GalViewInstance *instance)
}
static void
-view_changed (GalView *view, GalViewInstance *instance)
+view_changed (GalView *view,
+ GalViewInstance *instance)
{
if (instance->current_id != NULL) {
g_free (instance->current_id);
@@ -133,7 +135,8 @@ disconnect_view (GalViewInstance *instance)
}
static void
-connect_view (GalViewInstance *instance, GalView *view)
+connect_view (GalViewInstance *instance,
+ GalView *view)
{
if (instance->current_view)
disconnect_view (instance);
@@ -142,7 +145,7 @@ connect_view (GalViewInstance *instance, GalView *view)
instance->current_title = g_strdup (gal_view_get_title (view));
instance->current_type = g_strdup (gal_view_get_type_code (view));
instance->view_changed_id =
- g_signal_connect(instance->current_view, "changed",
+ g_signal_connect (instance->current_view, "changed",
G_CALLBACK (view_changed), instance);
gal_view_instance_display_view (instance, instance->current_view);
@@ -234,7 +237,8 @@ gal_view_instance_init (GalViewInstance *instance)
}
static void
-collection_changed (GalView *view, GalViewInstance *instance)
+collection_changed (GalView *view,
+ GalViewInstance *instance)
{
if (instance->current_id) {
gchar *view_id = instance->current_id;
@@ -316,7 +320,8 @@ load_current_view (GalViewInstance *instance)
* Return value: The new %GalViewInstance.
**/
GalViewInstance *
-gal_view_instance_new (GalViewCollection *collection, const gchar *instance_id)
+gal_view_instance_new (GalViewCollection *collection,
+ const gchar *instance_id)
{
GalViewInstance *instance = g_object_new (GAL_VIEW_INSTANCE_TYPE, NULL);
if (gal_view_instance_construct (instance, collection, instance_id))
@@ -328,7 +333,9 @@ gal_view_instance_new (GalViewCollection *collection, const gchar *instance_id)
}
GalViewInstance *
-gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *collection, const gchar *instance_id)
+gal_view_instance_construct (GalViewInstance *instance,
+ GalViewCollection *collection,
+ const gchar *instance_id)
{
gchar *filename;
gchar *safe_id;
@@ -374,7 +381,8 @@ gal_view_instance_get_current_view_id (GalViewInstance *instance)
}
void
-gal_view_instance_set_current_view_id (GalViewInstance *instance, const gchar *view_id)
+gal_view_instance_set_current_view_id (GalViewInstance *instance,
+ const gchar *view_id)
{
GalView *view;
gint index;
@@ -408,7 +416,8 @@ gal_view_instance_get_current_view (GalViewInstance *instance)
}
void
-gal_view_instance_set_custom_view (GalViewInstance *instance, GalView *view)
+gal_view_instance_set_custom_view (GalViewInstance *instance,
+ GalView *view)
{
g_free (instance->current_id);
instance->current_id = NULL;
@@ -421,7 +430,9 @@ gal_view_instance_set_custom_view (GalViewInstance *instance, GalView *view)
}
static void
-dialog_response (GtkWidget *dialog, gint id, GalViewInstance *instance)
+dialog_response (GtkWidget *dialog,
+ gint id,
+ GalViewInstance *instance)
{
if (id == GTK_RESPONSE_OK) {
gal_view_instance_save_as_dialog_save (GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (dialog));
@@ -437,7 +448,7 @@ gal_view_instance_save_as (GalViewInstance *instance)
g_return_if_fail (instance != NULL);
dialog = gal_view_instance_save_as_dialog_new (instance);
- g_signal_connect(dialog, "response",
+ g_signal_connect (dialog, "response",
G_CALLBACK (dialog_response), instance);
gtk_widget_show (dialog);
}
@@ -464,7 +475,8 @@ gal_view_instance_get_default_view (GalViewInstance *instance)
}
void
-gal_view_instance_set_default_view (GalViewInstance *instance, const gchar *id)
+gal_view_instance_set_default_view (GalViewInstance *instance,
+ const gchar *id)
{
g_free (instance->default_view);
instance->default_view = g_strdup (id);
diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c
index 4428cf6012..c26619f2bd 100644
--- a/widgets/menus/gal-view-new-dialog.c
+++ b/widgets/menus/gal-view-new-dialog.c
@@ -33,8 +33,8 @@
#include "gal-define-views-model.h"
#include "gal-view-new-dialog.h"
-static void gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+static void gal_view_new_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
+static void gal_view_new_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
static void gal_view_new_dialog_dispose (GObject *object);
/* The arguments we take */
@@ -51,7 +51,7 @@ gal_view_new_dialog_class_init (GalViewNewDialogClass *klass)
{
GObjectClass *object_class;
- object_class = (GObjectClass*) klass;
+ object_class = (GObjectClass *) klass;
object_class->set_property = gal_view_new_dialog_set_property;
object_class->get_property = gal_view_new_dialog_get_property;
@@ -124,7 +124,7 @@ gal_view_new_dialog_dispose (GObject *object)
G_OBJECT_CLASS (gal_view_new_dialog_parent_class)->dispose (object);
}
-GtkWidget*
+GtkWidget *
gal_view_new_dialog_new (GalViewCollection *collection)
{
GtkWidget *widget =
@@ -150,11 +150,11 @@ sensitize_ok_response (GalViewNewDialog *dialog)
}
static gboolean
-selection_func (GtkTreeSelection *selection,
- GtkTreeModel *model,
- GtkTreePath *path,
- gboolean path_currently_selected,
- gpointer data)
+selection_func (GtkTreeSelection *selection,
+ GtkTreeModel *model,
+ GtkTreePath *path,
+ gboolean path_currently_selected,
+ gpointer data)
{
GtkTreeIter iter;
GalViewNewDialog *dialog = data;
@@ -164,7 +164,7 @@ selection_func (GtkTreeSelection *selection,
gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->list_store),
&iter,
- (GtkTreePath*) path);
+ (GtkTreePath *) path);
gtk_tree_model_get (GTK_TREE_MODEL (dialog->list_store),
&iter,
@@ -179,16 +179,17 @@ selection_func (GtkTreeSelection *selection,
}
static void
-entry_changed (GtkWidget *entry, gpointer data)
+entry_changed (GtkWidget *entry,
+ gpointer data)
{
GalViewNewDialog *dialog = data;
sensitize_ok_response (dialog);
}
-GtkWidget*
-gal_view_new_dialog_construct (GalViewNewDialog *dialog,
- GalViewCollection *collection)
+GtkWidget *
+gal_view_new_dialog_construct (GalViewNewDialog *dialog,
+ GalViewCollection *collection)
{
GList *iterator;
GtkTreeSelection *selection;
@@ -239,14 +240,17 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog,
}
static void
-gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+gal_view_new_dialog_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GalViewNewDialog *dialog;
GtkWidget *entry;
dialog = GAL_VIEW_NEW_DIALOG (object);
- switch (prop_id) {
+ switch (property_id) {
case PROP_NAME:
entry = e_builder_get_widget(dialog->builder, "entry-name");
if (entry && GTK_IS_ENTRY (entry)) {
@@ -254,20 +258,23 @@ gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue *
}
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
return;
}
}
static void
-gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+gal_view_new_dialog_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GalViewNewDialog *dialog;
GtkWidget *entry;
dialog = GAL_VIEW_NEW_DIALOG (object);
- switch (prop_id) {
+ switch (property_id) {
case PROP_NAME:
entry = e_builder_get_widget(dialog->builder, "entry-name");
if (entry && GTK_IS_ENTRY (entry)) {
@@ -278,7 +285,7 @@ gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value,
g_value_set_object (value, dialog->selected_factory);
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}