[gnome-calendar] utils: removing unused functions



commit 546b137d249b13c34a1d0c80c1a90e908880f58c
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Thu Feb 5 22:47:46 2015 -0500

    utils: removing unused functions

 src/gcal-application.c |    1 -
 src/gcal-utils.c       |  155 ------------------------------------------------
 src/gcal-utils.h       |   15 -----
 3 files changed, 0 insertions(+), 171 deletions(-)
---
diff --git a/src/gcal-application.c b/src/gcal-application.c
index 47cd037..9a20fc7 100644
--- a/src/gcal-application.c
+++ b/src/gcal-application.c
@@ -413,7 +413,6 @@ gcal_application_command_line (GApplication            *app,
 
           *(priv->initial_date) = icaltime_set_timezone (priv->initial_date,
                                                          gcal_manager_get_system_timezone (priv->manager));
-          print_date ("loading date", priv->initial_date);
         }
 
       g_clear_pointer (&date, g_free);
diff --git a/src/gcal-utils.c b/src/gcal-utils.c
index bf85a0a..59f61f7 100644
--- a/src/gcal-utils.c
+++ b/src/gcal-utils.c
@@ -63,66 +63,6 @@ month_item[12] =
 
 G_DEFINE_BOXED_TYPE (icaltimetype, icaltime, gcal_dup_icaltime, g_free)
 
-/* taken from eel/eel-gtk-extensions.c */
-static gboolean
-tree_view_button_press_callback (GtkWidget *tree_view,
-         GdkEventButton *event,
-         gpointer data)
-{
-  GtkTreePath *path;
-  GtkTreeViewColumn *column;
-
-  if (event->button == 1 && event->type == GDK_BUTTON_PRESS) {
-    if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (tree_view),
-             event->x, event->y,
-             &path,
-             &column,
-             NULL,
-             NULL)) {
-      gtk_tree_view_row_activated
-        (GTK_TREE_VIEW (tree_view), path, column);
-    }
-  }
-
-  return FALSE;
-}
-
-void
-gcal_gtk_tree_view_set_activate_on_single_click (GtkTreeView *tree_view,
-                                                 gboolean should_activate)
-{
-  guint button_press_id;
-
-  button_press_id = GPOINTER_TO_UINT
-    (g_object_get_data (G_OBJECT (tree_view),
-          "gd-tree-view-activate"));
-
-  if (button_press_id && !should_activate) {
-    g_signal_handler_disconnect (tree_view, button_press_id);
-    g_object_set_data (G_OBJECT (tree_view),
-         "gd-tree-view-activate",
-         NULL);
-  } else if (!button_press_id && should_activate) {
-    button_press_id = g_signal_connect
-      (tree_view,
-       "button_press_event",
-       G_CALLBACK  (tree_view_button_press_callback),
-       NULL);
-    g_object_set_data (G_OBJECT (tree_view),
-         "gd-tree-view-activate",
-         GUINT_TO_POINTER (button_press_id));
-  }
-}
-
-const gchar*
-gcal_get_group_name (const gchar *base_uri)
-{
-  if (g_strcmp0 (base_uri, "local:") == 0)
-    return "Local";
-  else
-    return "External";
-}
-
 icaltimetype*
 gcal_dup_icaltime (const icaltimetype *date)
 {
@@ -146,85 +86,6 @@ gcal_dup_icaltime (const icaltimetype *date)
   return new_date;
 }
 
-/*
- * gcal_get_source_name:
- *
- * This method assume it receive only the model inside GcalManager
- * */
-gchar*
-gcal_get_source_name (GtkTreeModel *model,
-                      const gchar  *uid)
-{
-  GtkTreeIter iter;
-  gboolean valid;
-  gchar *name;
-
-  name = NULL;
-  valid = gtk_tree_model_get_iter_first (model, &iter);
-  while (valid)
-    {
-      gchar *name_data;
-      gchar *uid_data;
-
-      gtk_tree_model_get (model, &iter,
-                          0, &uid_data,
-                          1, &name_data,
-                          -1);
-
-      if (g_strcmp0 (uid_data, uid) == 0)
-        {
-          name = g_strdup (name_data);
-
-          g_free (name_data);
-          g_free (uid_data);
-          break;
-        }
-
-      g_free (name_data);
-      g_free (uid_data);
-
-      valid = gtk_tree_model_iter_next (model, &iter);
-    }
-  return name;
-}
-
-gchar*
-gcal_get_source_uid (GtkTreeModel *model,
-                     const gchar  *name)
-{
-  GtkTreeIter iter;
-  gboolean valid;
-  gchar *uid;
-
-  uid = NULL;
-  valid = gtk_tree_model_get_iter_first (model, &iter);
-  while (valid)
-    {
-      gchar *name_data;
-      gchar *uid_data;
-
-      gtk_tree_model_get (model, &iter,
-                          0, &uid_data,
-                          1, &name_data,
-                          -1);
-
-      if (g_strcmp0 (name_data, name) == 0)
-        {
-          uid = g_strdup (uid_data);
-
-          g_free (name_data);
-          g_free (uid_data);
-          break;
-        }
-
-      g_free (name_data);
-      g_free (uid_data);
-
-      valid = gtk_tree_model_iter_next (model, &iter);
-    }
-  return uid;
-}
-
 gchar*
 gcal_get_weekday (gint i)
 {
@@ -334,22 +195,6 @@ gcal_compare_event_widget_by_date (gconstpointer a,
   return comparison;
 }
 
-void print_date (const gchar*        prefix,
-                 const icaltimetype* icaltime)
-{
-  gchar* temp = g_strdup_printf ("{y = %d, m = %d, d = %d, hour = %d:%d:%d, utc = %d, date = %d, daylight = 
%d, zone = %p}",
-                                 icaltime->year, icaltime->month,
-                                 icaltime->day, icaltime->hour,
-                                 icaltime->minute, icaltime->second,
-                                 icaltime->is_utc, icaltime->is_date,
-                                 icaltime->is_daylight, icaltime->zone);
-  g_debug ("%s: %s  --  zone: %s",
-           prefix,
-           temp,
-           icaltimezone_get_display_name ((icaltimezone*) icaltime->zone));
-  g_free (temp);
-}
-
 /**
  * get_desc_from_component:
  * @component:
diff --git a/src/gcal-utils.h b/src/gcal-utils.h
index 8399025..72d810c 100644
--- a/src/gcal-utils.h
+++ b/src/gcal-utils.h
@@ -51,20 +51,8 @@ const gchar*  (*GcalTranslateFunc)                              (GtkWidget
 
 GType           icaltime_get_type                               (void)            G_GNUC_CONST;
 
-void            gcal_gtk_tree_view_set_activate_on_single_click (GtkTreeView           *tree_view,
-                                                                 gboolean               should_activate);
-
-
-const gchar*    gcal_get_group_name                             (const gchar           *base_uri);
-
 icaltimetype*   gcal_dup_icaltime                               (const icaltimetype    *date);
 
-gchar*          gcal_get_source_name                            (GtkTreeModel          *model,
-                                                                 const gchar           *uid);
-
-gchar*          gcal_get_source_uid                             (GtkTreeModel          *model,
-                                                                 const gchar           *name);
-
 gchar*          gcal_get_weekday                                (gint                   i);
 
 gchar*          gcal_get_month_name                             (gint                   i);
@@ -80,9 +68,6 @@ const gchar*    get_color_name_from_source                      (ESource
 gint            gcal_compare_event_widget_by_date               (gconstpointer          a,
                                                                  gconstpointer          b);
 
-void            print_date                                      (const gchar*           prefix,
-                                                                 const icaltimetype*    icaltime);
-
 gchar*          get_desc_from_component                         (ECalComponent         *component,
                                                                  const gchar           *joint_char);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]