[gnome-calendar] misc: fix styling issues and gcc warnings
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] misc: fix styling issues and gcc warnings
- Date: Thu, 4 Dec 2014 22:40:01 +0000 (UTC)
commit dd2a0da88342b06f1377915d94a119545f2d5880
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Wed Oct 22 00:42:48 2014 -0400
misc: fix styling issues and gcc warnings
Update code style
HACKING | 3 +++
src/gcal-event-widget.h | 2 +-
src/gcal-manager.c | 4 +---
src/gcal-week-view.c | 43 ++++++++++++++++++++++++++++++-------------
src/gcal-window.c | 23 +++++++++++++++--------
5 files changed, 50 insertions(+), 25 deletions(-)
---
diff --git a/HACKING b/HACKING
index 07edb3d..3042816 100644
--- a/HACKING
+++ b/HACKING
@@ -15,3 +15,6 @@ Code formating and ordering
+ The methods prototype will always be placed at the top of the source, in the
same order as their implementation below.
+
++ Line splitting will work accordingly to Gtk+ code style, adding the following:
+ 1. Pure mathematic calculation can extend over the 80 pixel line
diff --git a/src/gcal-event-widget.h b/src/gcal-event-widget.h
index 5d15501..a2d2525 100644
--- a/src/gcal-event-widget.h
+++ b/src/gcal-event-widget.h
@@ -93,7 +93,7 @@ void gcal_event_widget_set_has_reminders (GcalEventWidget *
gboolean gcal_event_widget_get_has_reminders (GcalEventWidget *event);
-GcalEventData* gcal_event_widget_get_data (GcalEventWidget *event);
+GcalEventData* gcal_event_widget_get_data (GcalEventWidget *event);
gboolean gcal_event_widget_equal (GcalEventWidget *widget1,
GcalEventWidget *widget2);
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index a329209..e3c8879 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -653,8 +653,6 @@ gcal_manager_move_event_to_source (GcalManager *manager,
const gchar *event_uid,
const gchar *new_source_uid)
{
- GcalManagerPrivate *priv;
-
- priv = gcal_manager_get_instance_private (manager);
/* FIXME: add code, fix stub method */
+ ;
}
diff --git a/src/gcal-week-view.c b/src/gcal-week-view.c
index 6a9b3d1..daf722d 100644
--- a/src/gcal-week-view.c
+++ b/src/gcal-week-view.c
@@ -171,7 +171,7 @@ gcal_week_view_class_init (GcalWeekViewClass *klass)
GObjectClass *object_class;
container_class = GTK_CONTAINER_CLASS (klass);
- container_class->add = gcal_week_view_add;
+ container_class->add = gcal_week_view_add;
container_class->remove = gcal_week_view_remove;
container_class->forall = gcal_week_view_forall;
gtk_container_class_handle_border_width (container_class);
@@ -191,8 +191,10 @@ gcal_week_view_class_init (GcalWeekViewClass *klass)
object_class->set_property = gcal_week_view_set_property;
object_class->get_property = gcal_week_view_get_property;
- g_object_class_override_property (object_class, PROP_DATE, "active-date");
- g_object_class_override_property (object_class, PROP_MANAGER, "manager");
+ g_object_class_override_property (object_class,
+ PROP_DATE, "active-date");
+ g_object_class_override_property (object_class,
+ PROP_MANAGER, "manager");
}
static void
@@ -399,7 +401,8 @@ gcal_week_view_realize (GtkWidget *widget)
GcalWeekViewChild *child;
child = (GcalWeekViewChild*) l->data;
- gtk_widget_set_parent_window (child->widget, priv->grid_window);
+ gtk_widget_set_parent_window (child->widget,
+ priv->grid_window);
}
}
}
@@ -560,8 +563,11 @@ gcal_week_view_size_allocate (GtkWidget *widget,
child = (GcalWeekViewChild*) l->data;
- if ((! gtk_widget_get_visible (child->widget)) && (! child->hidden_by_me))
- continue;
+ if ((! gtk_widget_get_visible (child->widget)) &&
+ (! child->hidden_by_me))
+ {
+ continue;
+ }
gtk_widget_get_preferred_height (child->widget,
&min_height,
@@ -701,8 +707,11 @@ gcal_week_view_scroll_event (GtkWidget *widget,
{
GtkWidget *range = NULL;
- if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_DOWN)
- range = priv->vscrollbar;
+ if (event->direction == GDK_SCROLL_UP ||
+ event->direction == GDK_SCROLL_DOWN)
+ {
+ range = priv->vscrollbar;
+ }
if (range != NULL && gtk_widget_get_visible (range))
{
@@ -815,7 +824,8 @@ gcal_week_view_add (GtkContainer *container,
{
new_child->index = -1;
if (gtk_widget_get_window (widget) != NULL)
- gtk_widget_set_parent_window (widget, gtk_widget_get_window (widget));
+ gtk_widget_set_parent_window (widget,
+ gtk_widget_get_window (widget));
}
else
{
@@ -979,7 +989,8 @@ gcal_week_view_draw_header (GcalWeekView *view,
state = gtk_widget_get_state_flags (widget);
/* adding shadow */
- pattern = cairo_pattern_create_linear(0, start_grid_y - 18, 0, start_grid_y + 6);
+ pattern = cairo_pattern_create_linear(0, start_grid_y - 18,
+ 0, start_grid_y + 6);
cairo_pattern_add_color_stop_rgba(pattern, 0.0, 0, 0, 0, 0.6);
cairo_pattern_add_color_stop_rgba(pattern, 1.0, 0, 0, 0, 0.0);
@@ -1010,8 +1021,12 @@ gcal_week_view_draw_header (GcalWeekView *view,
gint n_day;
n_day = start_of_week->day + i;
- if (n_day > icaltime_days_in_month (start_of_week->month, start_of_week->year))
- n_day = n_day - icaltime_days_in_month (start_of_week->month, start_of_week->year);
+ if (n_day > icaltime_days_in_month (start_of_week->month,
+ start_of_week->year))
+ {
+ n_day = n_day - icaltime_days_in_month (start_of_week->month,
+ start_of_week->year);
+ }
weekday_abv = gcal_get_weekday (i);
weekday_header = g_strdup_printf ("%s %d",weekday_abv, n_day);
@@ -1105,7 +1120,9 @@ gcal_week_view_draw_grid_window (GcalWeekView *view,
for (i = 0; i < 24; i++)
{
gchar *hours;
- hours = g_strdup_printf ("%d %s", i % 12, i < 12 ? _("AM") : _("PM"));
+ hours = g_strdup_printf ("%d %s",
+ i % 12,
+ i < 12 ? _("AM") : _("PM"));
if (i == 0)
pango_layout_set_text (layout, _("Midnight"), -1);
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 12d2711..a85dfa2 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -922,11 +922,14 @@ gcal_window_constructed (GObject *object)
search_button = gtk_toggle_button_new ();
gtk_container_add (
GTK_CONTAINER (search_button),
- gtk_image_new_from_icon_name ("edit-find-symbolic", GTK_ICON_SIZE_MENU));
- gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->header_bar), search_button);
+ gtk_image_new_from_icon_name ("edit-find-symbolic",
+ GTK_ICON_SIZE_MENU));
+ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->header_bar),
+ search_button);
- gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (priv->header_bar),
- TRUE);
+ gtk_header_bar_set_show_close_button (
+ GTK_HEADER_BAR (priv->header_bar),
+ TRUE);
gtk_widget_set_hexpand (priv->header_bar, TRUE);
gtk_window_set_titlebar (GTK_WINDOW (object), priv->header_bar);
@@ -1021,7 +1024,8 @@ gcal_window_constructed (GObject *object)
priv->new_event_widget = gcal_new_event_widget_new ();
- gtk_container_add (GTK_CONTAINER(priv->popover), GTK_WIDGET(priv->new_event_widget));
+ gtk_container_add (GTK_CONTAINER(priv->popover),
+ GTK_WIDGET(priv->new_event_widget));
/* signals connection/handling */
g_signal_connect (object, "key-press-event",
@@ -1422,7 +1426,8 @@ gcal_window_set_search_mode (GcalWindow *window,
GcalWindowPrivate *priv;
priv = gcal_window_get_instance_private (window);
- gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (priv->search_bar), enabled);
+ gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (priv->search_bar),
+ enabled);
}
void
@@ -1432,7 +1437,8 @@ gcal_window_show_notification (GcalWindow *window)
priv = gcal_window_get_instance_private (window);
- gtk_revealer_set_reveal_child (GTK_REVEALER (priv->notification), TRUE);
+ gtk_revealer_set_reveal_child (GTK_REVEALER (priv->notification),
+ TRUE);
}
void
@@ -1442,5 +1448,6 @@ gcal_window_hide_notification (GcalWindow *window)
priv = gcal_window_get_instance_private (window);
- gtk_revealer_set_reveal_child (GTK_REVEALER (priv->notification), FALSE);
+ gtk_revealer_set_reveal_child (GTK_REVEALER (priv->notification),
+ FALSE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]