project: Cleanup code for unused views
Got rid of the unused views in the GcalWindowView enum and associated code in gcal-window.
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
28be1e858d
commit
2d5b1aa9d1
@@ -44,12 +44,9 @@ typedef enum
|
|||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
GCAL_WINDOW_VIEW_DAY,
|
|
||||||
GCAL_WINDOW_VIEW_WEEK,
|
GCAL_WINDOW_VIEW_WEEK,
|
||||||
GCAL_WINDOW_VIEW_MONTH,
|
GCAL_WINDOW_VIEW_MONTH,
|
||||||
GCAL_WINDOW_VIEW_YEAR,
|
GCAL_WINDOW_VIEW_YEAR,
|
||||||
GCAL_WINDOW_VIEW_LIST,
|
|
||||||
GCAL_WINDOW_VIEW_SEARCH,
|
|
||||||
} GcalWindowView;
|
} GcalWindowView;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|||||||
@@ -200,12 +200,6 @@ update_today_button_sensitive (GcalWindow *window)
|
|||||||
|
|
||||||
switch (window->active_view)
|
switch (window->active_view)
|
||||||
{
|
{
|
||||||
case GCAL_WINDOW_VIEW_DAY:
|
|
||||||
sensitive = g_date_time_get_year (window->active_date) != g_date_time_get_year (now) ||
|
|
||||||
g_date_time_get_month (window->active_date) != g_date_time_get_month (now) ||
|
|
||||||
g_date_time_get_day_of_month (window->active_date) != g_date_time_get_day_of_month (now);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GCAL_WINDOW_VIEW_WEEK:
|
case GCAL_WINDOW_VIEW_WEEK:
|
||||||
sensitive = g_date_time_get_year (window->active_date) != g_date_time_get_year (now) ||
|
sensitive = g_date_time_get_year (window->active_date) != g_date_time_get_year (now) ||
|
||||||
g_date_time_get_week_of_year (window->active_date) != g_date_time_get_week_of_year (now);
|
g_date_time_get_week_of_year (window->active_date) != g_date_time_get_week_of_year (now);
|
||||||
@@ -224,8 +218,6 @@ update_today_button_sensitive (GcalWindow *window)
|
|||||||
sensitive = g_date_time_get_year (window->active_date) != g_date_time_get_year (now);
|
sensitive = g_date_time_get_year (window->active_date) != g_date_time_get_year (now);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GCAL_WINDOW_VIEW_LIST:
|
|
||||||
case GCAL_WINDOW_VIEW_SEARCH:
|
|
||||||
default:
|
default:
|
||||||
sensitive = TRUE;
|
sensitive = TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -469,9 +461,6 @@ view_changed (GObject *object,
|
|||||||
|
|
||||||
g_type_class_unref (eklass);
|
g_type_class_unref (eklass);
|
||||||
|
|
||||||
if (view_type == GCAL_WINDOW_VIEW_SEARCH)
|
|
||||||
return;
|
|
||||||
|
|
||||||
window->active_view = view_type;
|
window->active_view = view_type;
|
||||||
update_today_button_sensitive (window);
|
update_today_button_sensitive (window);
|
||||||
g_object_notify_by_pspec (G_OBJECT (user_data), properties[PROP_ACTIVE_VIEW]);
|
g_object_notify_by_pspec (G_OBJECT (user_data), properties[PROP_ACTIVE_VIEW]);
|
||||||
|
|||||||
Reference in New Issue
Block a user