diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-01-03 12:46:23 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-01-04 02:15:01 +0800 |
commit | e77ee5d5d38ad95bce550db62bf4105f43cf88c6 (patch) | |
tree | 3b4c275b086d3f49360c551e686f62140a8ee4d4 /widgets/misc | |
parent | 3cfd5d640908b6441769341c764de70006262c6e (diff) | |
download | gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.gz gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.zst gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'widgets/misc')
-rw-r--r-- | widgets/misc/e-attachment.c | 2 | ||||
-rw-r--r-- | widgets/misc/e-attachment.h | 4 | ||||
-rw-r--r-- | widgets/misc/e-calendar.c | 5 | ||||
-rw-r--r-- | widgets/misc/e-canvas-background.c | 14 | ||||
-rw-r--r-- | widgets/misc/e-dateedit.c | 78 | ||||
-rw-r--r-- | widgets/misc/e-import-assistant.c | 16 | ||||
-rw-r--r-- | widgets/misc/e-selection-model.c | 14 | ||||
-rw-r--r-- | widgets/misc/ea-calendar-item.c | 43 | ||||
-rw-r--r-- | widgets/misc/test-dateedit.c | 5 |
9 files changed, 121 insertions, 60 deletions
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c index f8b93f9fc2..a8cef68835 100644 --- a/widgets/misc/e-attachment.c +++ b/widgets/misc/e-attachment.c @@ -402,7 +402,7 @@ attachment_update_progress_columns (EAttachment *attachment) void e_attachment_set_file_info (EAttachment *attachment, - GFileInfo *file_info) + GFileInfo *file_info) { GtkTreeRowReference *reference; GIcon *icon; diff --git a/widgets/misc/e-attachment.h b/widgets/misc/e-attachment.h index d2a31c45af..a6dff74661 100644 --- a/widgets/misc/e-attachment.h +++ b/widgets/misc/e-attachment.h @@ -81,8 +81,8 @@ GFile * e_attachment_get_file (EAttachment *attachment); void e_attachment_set_file (EAttachment *attachment, GFile *file); GFileInfo * e_attachment_get_file_info (EAttachment *attachment); -void e_attachment_set_file_info (EAttachment *attachment, GFileInfo *file_info); - +void e_attachment_set_file_info (EAttachment *attachment, + GFileInfo *file_info); gboolean e_attachment_get_loading (EAttachment *attachment); CamelMimePart * e_attachment_get_mime_part (EAttachment *attachment); void e_attachment_set_mime_part (EAttachment *attachment, diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index e9aacfa8b9..920e83d3a3 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -587,7 +587,10 @@ e_calendar_focus (GtkWidget *widget, GtkDirectionType direction) /* get current focused item, if e-calendar has had focus */ if (GTK_WIDGET_HAS_FOCUS (widget) || e_calendar_button_has_focus (cal)) - for (index = 0; canvas->focused_item && index < E_CALENDAR_FOCUS_CHILDREN_NUM; ++index) { + for (index = 0; index < E_CALENDAR_FOCUS_CHILDREN_NUM; ++index) { + if (canvas->focused_item == NULL) + break; + if (children[index] == canvas->focused_item) { focused_index = index; break; diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index 04c163ef06..898fe0628a 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -365,7 +365,12 @@ ecb_unrealize (GnomeCanvasItem *item) } static void -ecb_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint width, gint height) +ecb_draw (GnomeCanvasItem *item, + GdkDrawable *drawable, + gint x, + gint y, + gint width, + gint height) { ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item); gint x1, x2, y1, y2; @@ -421,12 +426,15 @@ ecb_point (GnomeCanvasItem *item, double x, double y, gint cx, gint cy, } static void -ecb_style_set (ECanvasBackground *ecb, GtkStyle *previous_style) +ecb_style_set (ECanvasBackground *ecb, + GtkStyle *previous_style) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (ecb); if (GTK_WIDGET_REALIZED (item->canvas)) { - gdk_gc_set_foreground (ecb->priv->gc, >K_WIDGET(item->canvas)->style->base[GTK_STATE_NORMAL]); + gdk_gc_set_foreground ( + ecb->priv->gc, >K_WIDGET(item->canvas)-> + style->base[GTK_STATE_NORMAL]); gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ecb)); } } diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 975018ef27..a16bcefaf8 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -586,12 +586,14 @@ create_children (EDateEdit *dedit) "widget \"*.e-dateedit-timecombo\" style \"e-dateedit-timecombo-style\""); time_store = gtk_list_store_new (1, G_TYPE_STRING); - priv->time_combo = gtk_combo_box_entry_new_with_model (GTK_TREE_MODEL (time_store), 0); + priv->time_combo = gtk_combo_box_entry_new_with_model ( + GTK_TREE_MODEL (time_store), 0); g_object_unref (time_store); - /* We need to make sure labels are right-aligned, since we want digits to line up, - * and with a nonproportional font, the width of a space != width of a digit. - * Technically, only 12-hour format needs this, but we do it always, for consistency. */ + /* We need to make sure labels are right-aligned, since we want + * digits to line up, and with a nonproportional font, the width + * of a space != width of a digit. Technically, only 12-hour + * format needs this, but we do it always, for consistency. */ g_object_set (GTK_BIN (priv->time_combo)->child, "xalign", 1.0, NULL); cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->time_combo)); if (cells) { @@ -1412,16 +1414,18 @@ position_date_popup (EDateEdit *dedit) gtk_widget_size_request (dedit->priv->date_button, &button_req); bwidth = button_req.width; - gtk_widget_size_request (gtk_widget_get_parent (dedit->priv->date_button), &button_req); + gtk_widget_size_request ( + gtk_widget_get_parent (dedit->priv->date_button), &button_req); bheight = button_req.height; - gtk_widget_translate_coordinates (dedit->priv->date_button, - gtk_widget_get_toplevel (dedit->priv->date_button), - bwidth - cal_req.width, bheight, - &x, &y); + gtk_widget_translate_coordinates ( + dedit->priv->date_button, + gtk_widget_get_toplevel (dedit->priv->date_button), + bwidth - cal_req.width, bheight, &x, &y); - gdk_window_get_origin (gtk_widget_get_toplevel (dedit->priv->date_button)->window, - &win_x, &win_y); + gdk_window_get_origin ( + gtk_widget_get_toplevel (dedit->priv->date_button)->window, + &win_x, &win_y); x += win_x; y += win_y; @@ -1592,8 +1596,8 @@ rebuild_time_popup (EDateEdit *dedit) for (hour = priv->lower_hour; hour <= priv->upper_hour; hour++) { - /* We don't want to display midnight at the end, since that is - really in the next day. */ + /* We don't want to display midnight at the end, + * since that is really in the next day. */ if (hour == 24) break; @@ -1605,14 +1609,22 @@ rebuild_time_popup (EDateEdit *dedit) tmp_tm.tm_min = min; if (priv->use_24_hour_format) - /* This is a strftime() format. %H = hour (0-23), %M = minute. */ - e_time_format_time (&tmp_tm, 1, 0, buffer, sizeof (buffer)); + /* This is a strftime() format. + * %H = hour (0-23), %M = minute. */ + e_time_format_time ( + &tmp_tm, 1, 0, + buffer, sizeof (buffer)); else - /* This is a strftime() format. %I = hour (1-12), %M = minute, %p = am/pm string. */ - e_time_format_time (&tmp_tm, 0, 0, buffer, sizeof (buffer)); - - /* For 12-hour am/pm format, we want space padding, not zero padding. This - * can be done with strftime's %l, but it's a potentially unportable extension. */ + /* This is a strftime() format. + * %I = hour (1-12), %M = minute, + * %p = am/pm string. */ + e_time_format_time ( + &tmp_tm, 0, 0, + buffer, sizeof (buffer)); + + /* For 12-hour am/pm format, we want space padding, + * not zero padding. This can be done with strftime's + * %l, but it's a potentially unportable extension. */ if (!priv->use_24_hour_format && buffer[0] == '0') buffer[0] = ' '; @@ -1635,8 +1647,9 @@ e_date_edit_parse_date (EDateEdit *dedit, time_t t = time (NULL); struct tm *today_tm = localtime (&t); - /* it was only 2 digit year in dedit and it was interpreted as in the future, - but we don't want it as this, so decrease by 100 years to last century */ + /* It was only 2 digit year in dedit and it was interpreted as + * in the future, but we don't want it as this, so decrease by + * 100 years to last century. */ if (date_tm->tm_year > today_tm->tm_year) date_tm->tm_year -= 100; } @@ -1674,7 +1687,8 @@ field_set_to_none (const gchar *text) while (n = (gint)((guchar)*pos), isspace (n)) pos++; - /* Translators: "None" for date field of a date edit, shown when there is no date set */ + /* Translators: "None" for date field of a date edit, shown when + * there is no date set. */ none_string = C_("date", "None"); if (*pos == '\0' || !strncmp (pos, none_string, strlen (none_string))) @@ -1798,15 +1812,23 @@ on_date_entry_focus_out (GtkEntry *entry, "%s", _("Invalid Date Value")); gtk_dialog_run (GTK_DIALOG(msg_dialog)); gtk_widget_destroy (msg_dialog); - e_date_edit_get_date (dedit,&tmp_tm.tm_year,&tmp_tm.tm_mon,&tmp_tm.tm_mday); - e_date_edit_set_date (dedit,tmp_tm.tm_year,tmp_tm.tm_mon,tmp_tm.tm_mday); + e_date_edit_get_date ( + dedit, &tmp_tm.tm_year, + &tmp_tm.tm_mon, &tmp_tm.tm_mday); + e_date_edit_set_date ( + dedit, tmp_tm.tm_year, + tmp_tm.tm_mon, tmp_tm.tm_mday); gtk_widget_grab_focus (GTK_WIDGET (entry)); return FALSE; - } else if (e_date_edit_get_date (dedit,&tmp_tm.tm_year,&tmp_tm.tm_mon,&tmp_tm.tm_mday)) { - e_date_edit_set_date (dedit,tmp_tm.tm_year,tmp_tm.tm_mon,tmp_tm.tm_mday); + } else if (e_date_edit_get_date ( + dedit, &tmp_tm.tm_year, &tmp_tm.tm_mon, &tmp_tm.tm_mday)) { + + e_date_edit_set_date ( + dedit,tmp_tm.tm_year,tmp_tm.tm_mon,tmp_tm.tm_mday); if (dedit->priv->has_been_changed) { - /* the previous one didn't emit changed signal, but we want it even here, thus doing itself */ + /* The previous one didn't emit changed signal, + * but we want it even here, thus doing itself. */ g_signal_emit (dedit, signals [CHANGED], 0); dedit->priv->has_been_changed = FALSE; } diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c index 4e61799512..bf2396efb2 100644 --- a/widgets/misc/e-import-assistant.c +++ b/widgets/misc/e-import-assistant.c @@ -685,7 +685,9 @@ prepare_file_page (GtkAssistant *assistant, } static GtkWidget * -create_importer_control (EImport *import, EImportTarget *target, EImportImporter *importer) +create_importer_control (EImport *import, + EImportTarget *target, + EImportImporter *importer) { GtkWidget *control; @@ -730,6 +732,7 @@ prepare_progress_page (GtkAssistant *assistant, EImportAssistantPrivate *priv; EImportCompleteFunc done = NULL; ImportSelectionPage *page; + gboolean intelligent_import; gboolean is_simple = FALSE; priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant); @@ -741,11 +744,14 @@ prepare_progress_page (GtkAssistant *assistant, g_object_get (G_OBJECT (assistant), "is-simple", &is_simple, NULL); + intelligent_import = gtk_toggle_button_get_active ( + GTK_TOGGLE_BUTTON (priv->type_page.intelligent)); + if (is_simple) { priv->import_importer = priv->simple_page.importer; priv->import_target = (EImportTarget *)priv->simple_page.target; done = import_simple_done; - } else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->type_page.intelligent))) { + } else if (intelligent_import) { page->current = page->importers; if (page->current) { priv->import_target = (EImportTarget *) page->target; @@ -793,7 +799,8 @@ simple_filetype_changed_cb (GtkComboBox *combo_box, GtkAssistant *assistant) if (page->control) gtk_widget_destroy (page->control); - control = create_importer_control (priv->import, (EImportTarget *)page->target, page->importer); + control = create_importer_control ( + priv->import, (EImportTarget *)page->target, page->importer); page->control = gtk_alignment_new (0.0, 0.0, 1.0, 1.0); gtk_widget_show (page->control); gtk_container_add (GTK_CONTAINER (page->control), control); @@ -1349,7 +1356,8 @@ e_import_assistant_new_simple (GtkWindow *parent, return NULL; } - /* FIXME Implement the 'preview' mode, probably by adding a new function to an importer */ + /* FIXME Implement the 'preview' mode, probably + * by adding a new function to an importer */ return assistant; } diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c index 433e706968..46cf081584 100644 --- a/widgets/misc/e-selection-model.c +++ b/widgets/misc/e-selection-model.c @@ -80,7 +80,10 @@ esm_dispose (GObject *object) } static void -esm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +esm_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { ESelectionModel *esm = E_SELECTION_MODEL (object); @@ -100,14 +103,19 @@ esm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *psp } static void -esm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +esm_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { ESelectionModel *esm = E_SELECTION_MODEL (object); switch (prop_id) { case PROP_SORTER: drop_sorter(esm); - add_sorter(esm, g_value_get_object (value) ? E_SORTER(g_value_get_object(value)) : NULL); + add_sorter ( + esm, g_value_get_object (value) ? + E_SORTER (g_value_get_object (value)) : NULL); break; case PROP_SELECTION_MODE: diff --git a/widgets/misc/ea-calendar-item.c b/widgets/misc/ea-calendar-item.c index 9dcb83449c..82c118bf82 100644 --- a/widgets/misc/ea-calendar-item.c +++ b/widgets/misc/ea-calendar-item.c @@ -284,23 +284,32 @@ ea_calendar_item_get_name (AtkObject *accessible) g_return_val_if_fail (E_IS_CALENDAR_ITEM (g_obj), NULL); calitem = E_CALENDAR_ITEM (g_obj); - if (e_calendar_item_get_date_range (calitem, - &start_year, &start_month, &start_day, - &end_year, &end_month, &end_day)) { - - day_start.tm_year = start_year - 1900; - day_start.tm_mon = start_month; - day_start.tm_mday = start_day; - day_start.tm_isdst = -1; - e_utf8_strftime (buffer_start, sizeof (buffer_start), _("%d %B %Y"), &day_start); - - day_end.tm_year = end_year - 1900; - day_end.tm_mon = end_month; - day_end.tm_mday = end_day; - day_end.tm_isdst = -1; - e_utf8_strftime (buffer_end, sizeof (buffer_end), _("%d %B %Y"), &day_end); - - name_str = g_strdup_printf (_("Calendar: from %s to %s"), buffer_start, buffer_end); + if (e_calendar_item_get_date_range ( + calitem, + &start_year, &start_month, &start_day, + &end_year, &end_month, &end_day)) { + + day_start.tm_year = start_year - 1900; + day_start.tm_mon = start_month; + day_start.tm_mday = start_day; + day_start.tm_isdst = -1; + + e_utf8_strftime ( + buffer_start, sizeof (buffer_start), + _("%d %B %Y"), &day_start); + + day_end.tm_year = end_year - 1900; + day_end.tm_mon = end_month; + day_end.tm_mday = end_day; + day_end.tm_isdst = -1; + + e_utf8_strftime ( + buffer_end, sizeof (buffer_end), + _("%d %B %Y"), &day_end); + + name_str = g_strdup_printf ( + _("Calendar: from %s to %s"), + buffer_start, buffer_end); } #if 0 diff --git a/widgets/misc/test-dateedit.c b/widgets/misc/test-dateedit.c index c7b973904a..79ca726c3e 100644 --- a/widgets/misc/test-dateedit.c +++ b/widgets/misc/test-dateedit.c @@ -200,7 +200,10 @@ static void on_toggle_24_hour_clicked (GtkWidget *button, EDateEdit *dedit) { - e_date_edit_set_use_24_hour_format (dedit, !e_date_edit_get_use_24_hour_format (dedit)); + gboolean use_24_hour_format; + + use_24_hour_format = e_date_edit_get_use_24_hour_format (dedit); + e_date_edit_set_use_24_hour_format (dedit, !use_24_hour_format); } #if 0 |