From: <mgo...@us...> - 2016-11-13 01:02:57
|
Revision: 1101 http://sourceforge.net/p/osmo-pim/code/1101 Author: mgordienko Date: 2016-11-13 01:02:55 +0000 (Sun, 13 Nov 2016) Log Message: ----------- Remove the unused functions Modified Paths: -------------- trunk/src/tasks_utils.c trunk/src/tasks_utils.h Modified: trunk/src/tasks_utils.c =================================================================== --- trunk/src/tasks_utils.c 2016-11-13 01:02:48 UTC (rev 1100) +++ trunk/src/tasks_utils.c 2016-11-13 01:02:55 UTC (rev 1101) @@ -65,132 +65,6 @@ /*------------------------------------------------------------------------------*/ -void -tsk_tasks_foreach (guint32 julian_start, guint32 julian_end, gboolean (*ttfunc)(), GUI *appGUI) -{ - GtkTreeModel *model = NULL; - GtkTreePath *path; - GtkTreeIter iter; - gchar *category; - guint32 julian; - - model = GTK_TREE_MODEL (appGUI->tsk->tasks_list_store); - if (model == NULL) return; - - path = gtk_tree_path_new_first (); - - while (gtk_tree_model_get_iter (model, &iter, path) == TRUE) { - - gtk_tree_model_get (model, &iter, - TA_COLUMN_DUE_DATE_JULIAN, &julian, - TA_COLUMN_CATEGORY, &category, -1); - - if (julian >= julian_start && julian <= julian_end) - if (tsk_get_category_state (category, STATE_EITHER, appGUI) == TRUE) { - if ((*ttfunc)(julian, model, &iter, appGUI) == TRUE) { - g_free (category); - break; - } - } - - g_free (category); - gtk_tree_path_next (path); - } - - gtk_tree_path_free (path); -} - -/*------------------------------------------------------------------------------*/ - -gint -tsk_get_tasks_num (guint32 julian, gboolean check_only, gboolean show_done, gint hidden_category, GUI *appGUI) -{ - GtkTreeModel *model = NULL; - GtkTreePath *path; - GtkTreeIter iter; - guint32 tsk_julian; - gchar *buf; - gint tasks = 0; - gint done; - - model = GTK_TREE_MODEL (appGUI->tsk->tasks_list_store); - g_return_val_if_fail (model != NULL, 0); - - path = gtk_tree_path_new_first (); - - while (gtk_tree_model_get_iter (model, &iter, path) == TRUE) { - - gtk_tree_model_get (model, &iter, TA_COLUMN_DUE_DATE_JULIAN, &tsk_julian, - TA_COLUMN_CATEGORY, &buf, - TA_COLUMN_DONE, &done, -1); - - if (tsk_julian == julian && (show_done || !done) && tsk_get_category_state (buf, hidden_category, appGUI)) { - tasks++; - } - - g_free (buf); - if (check_only && tasks) break; - gtk_tree_path_next (path); - - } - - gtk_tree_path_free (path); - - return tasks; -} - -/*------------------------------------------------------------------------------*/ - -char * -tsk_get_tasks_str (guint32 julian, gboolean show_done, gint hidden_category, GUI *appGUI) -{ - GtkTreeModel *model; - GtkTreePath *path; - GtkTreeIter iter; - - char buffer[BUFFER_SIZE], tmpbuf[BUFFER_SIZE]; - char *summ, *categ; - guint32 tsk_julian; - gint time; - gint done; - - model = GTK_TREE_MODEL (appGUI->tsk->tasks_list_store); - g_return_val_if_fail (model != NULL, NULL); - - path = gtk_tree_path_new_first (); - buffer[0] = '\0'; - - while (gtk_tree_model_get_iter (model, &iter, path) == TRUE) { - - gtk_tree_model_get (model, &iter, TA_COLUMN_DUE_DATE_JULIAN, &tsk_julian, - TA_COLUMN_CATEGORY, &categ, - TA_COLUMN_DONE, &done, -1); - - if (tsk_julian == julian && (show_done || !done) && tsk_get_category_state (categ, hidden_category, appGUI)) { - gtk_tree_model_get (model, &iter, TA_COLUMN_DUE_TIME, &time, TA_COLUMN_SUMMARY, &summ, -1); - - if (time >= 0) { - g_snprintf (tmpbuf, BUFFER_SIZE, "\n[%02d:%02d] %s", time / 3600, time / 60 % 60, summ); - } else { - g_snprintf (tmpbuf, BUFFER_SIZE, "\n%s", summ); - } - - g_strlcat (buffer, tmpbuf, BUFFER_SIZE); - g_free (summ); - } - - g_free (categ); - gtk_tree_path_next (path); - } - - gtk_tree_path_free (path); - g_strstrip (buffer); - - return g_strdup (buffer); -} - -/*------------------------------------------------------------------------------*/ - gboolean tsk_get_category_state (gchar *category_name, gint type, GUI *appGUI) { Modified: trunk/src/tasks_utils.h =================================================================== --- trunk/src/tasks_utils.h 2016-11-13 01:02:48 UTC (rev 1100) +++ trunk/src/tasks_utils.h 2016-11-13 01:02:55 UTC (rev 1101) @@ -33,9 +33,6 @@ }; gboolean tsk_check_tasks (guint32 julian_start, guint32 julian_end, gint type, GUI *appGUI); -void tsk_tasks_foreach (guint32 julian_start, guint32 julian_end, gboolean (*ttfunc)(), GUI *appGUI); -gint tsk_get_tasks_num (guint32 julian, gboolean check_only, gboolean show_done, gint hidden_category, GUI *appGUI); -char * tsk_get_tasks_str (guint32 julian, gboolean show_done, gint hidden_category, GUI *appGUI); gboolean tsk_get_category_state (gchar *category_name, gint type, GUI *appGUI); gchar * tsk_get_priority_text (gint index); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |