aboutsummaryrefslogtreecommitdiffstats
path: root/filter/e-filter-datespec.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-08-16 23:25:56 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:09:00 +0800
commit777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1 (patch)
treedfab9ca8f30c7b1539f86dfe19b8bf761d6a899c /filter/e-filter-datespec.c
parent83675abbc2b3a3bc6421094a56651d021fc0cdcd (diff)
downloadgsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.gz
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.bz2
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.lz
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.xz
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.zst
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'filter/e-filter-datespec.c')
-rw-r--r--filter/e-filter-datespec.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/filter/e-filter-datespec.c b/filter/e-filter-datespec.c
index a7c2aa2f61..ef264d6205 100644
--- a/filter/e-filter-datespec.c
+++ b/filter/e-filter-datespec.c
@@ -109,7 +109,7 @@ get_best_span (time_t val)
{
gint i;
- for (i=G_N_ELEMENTS (timespans)-1;i>=0;i--) {
+ for (i = G_N_ELEMENTS (timespans) - 1; i >= 0; i--) {
if (val % timespans[i].seconds == 0)
return i;
}
@@ -205,7 +205,7 @@ set_values (EFilterDatespec *fds)
EFilterDatespecPrivate *p = fds->priv;
- p->type = fds->type==FDST_UNKNOWN ? FDST_NOW : fds->type;
+ p->type = fds->type == FDST_UNKNOWN ? FDST_NOW : fds->type;
note_type = p->type==FDST_X_FUTURE ? FDST_X_AGO : p->type; /* FUTURE and AGO use the same notebook pages/etc. */
@@ -219,43 +219,46 @@ set_values (EFilterDatespec *fds)
struct tm tm;
localtime_r (&fds->value, &tm);
- gtk_calendar_select_month ((GtkCalendar*) p->calendar_specify, tm.tm_mon, tm.tm_year + 1900);
- gtk_calendar_select_day ((GtkCalendar*) p->calendar_specify, tm.tm_mday);
+ gtk_calendar_select_month ((GtkCalendar *) p->calendar_specify, tm.tm_mon, tm.tm_year + 1900);
+ gtk_calendar_select_day ((GtkCalendar *) p->calendar_specify, tm.tm_mday);
break;
}
case FDST_X_AGO:
p->span = get_best_span (fds->value);
- gtk_spin_button_set_value ((GtkSpinButton*) p->spin_relative, fds->value/timespans[p->span].seconds);
+ gtk_spin_button_set_value ((GtkSpinButton *) p->spin_relative, fds->value / timespans[p->span].seconds);
gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_relative), p->span);
gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_past_future), 0);
break;
case FDST_X_FUTURE:
p->span = get_best_span (fds->value);
- gtk_spin_button_set_value ((GtkSpinButton*) p->spin_relative, fds->value/timespans[p->span].seconds);
+ gtk_spin_button_set_value ((GtkSpinButton *) p->spin_relative, fds->value / timespans[p->span].seconds);
gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_relative), p->span);
gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_past_future), 1);
break;
}
- gtk_notebook_set_current_page ((GtkNotebook*) p->notebook_type, note_type);
+ gtk_notebook_set_current_page ((GtkNotebook *) p->notebook_type, note_type);
gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_type), note_type);
}
static void
-set_combobox_type (GtkComboBox *combobox, EFilterDatespec *fds)
+set_combobox_type (GtkComboBox *combobox,
+ EFilterDatespec *fds)
{
fds->priv->type = gtk_combo_box_get_active (combobox);
- gtk_notebook_set_current_page ((GtkNotebook*) fds->priv->notebook_type, fds->priv->type);
+ gtk_notebook_set_current_page ((GtkNotebook *) fds->priv->notebook_type, fds->priv->type);
}
static void
-set_combobox_relative (GtkComboBox *combobox, EFilterDatespec *fds)
+set_combobox_relative (GtkComboBox *combobox,
+ EFilterDatespec *fds)
{
fds->priv->span = gtk_combo_box_get_active (combobox);
}
static void
-set_combobox_past_future (GtkComboBox *combobox, EFilterDatespec *fds)
+set_combobox_past_future (GtkComboBox *combobox,
+ EFilterDatespec *fds)
{
if (gtk_combo_box_get_active (combobox) == 0)
fds->type = fds->priv->type = FDST_X_AGO;
@@ -264,7 +267,8 @@ set_combobox_past_future (GtkComboBox *combobox, EFilterDatespec *fds)
}
static void
-button_clicked (GtkButton *button, EFilterDatespec *fds)
+button_clicked (GtkButton *button,
+ EFilterDatespec *fds)
{
EFilterDatespecPrivate *p = fds->priv;
GtkWidget *content_area;