[tepl] amtk: remove amtk-related code from tepl-utils



commit be676ddc98b7a5eb948b7d09e5131d2046e6f35d
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Jul 14 15:41:40 2017 +0200

    amtk: remove amtk-related code from tepl-utils

 docs/reference/tepl-3.0-sections.txt |    5 --
 docs/reference/tepl-docs.xml.in      |    1 -
 tepl/tepl-utils.c                    |  104 +---------------------------------
 tepl/tepl-utils.h                    |   12 +----
 4 files changed, 2 insertions(+), 120 deletions(-)
---
diff --git a/docs/reference/tepl-3.0-sections.txt b/docs/reference/tepl-3.0-sections.txt
index 58d9158..ccaa7cd 100644
--- a/docs/reference/tepl-3.0-sections.txt
+++ b/docs/reference/tepl-3.0-sections.txt
@@ -420,11 +420,6 @@ tepl_notebook_get_type
 </SECTION>
 
 <SECTION>
-<FILE>utils</FILE>
-tepl_utils_recent_chooser_menu_get_item_uri
-</SECTION>
-
-<SECTION>
 <FILE>view</FILE>
 TeplView
 tepl_view_new
diff --git a/docs/reference/tepl-docs.xml.in b/docs/reference/tepl-docs.xml.in
index 7e0aabf..7dca82e 100644
--- a/docs/reference/tepl-docs.xml.in
+++ b/docs/reference/tepl-docs.xml.in
@@ -64,7 +64,6 @@
       <title>Misc</title>
       <xi:include href="xml/info-bar.xml"/>
       <xi:include href="xml/iter.xml"/>
-      <xi:include href="xml/utils.xml"/>
     </chapter>
   </part>
 
diff --git a/tepl/tepl-utils.c b/tepl/tepl-utils.c
index 3d7178c..eb4a020 100644
--- a/tepl/tepl-utils.c
+++ b/tepl/tepl-utils.c
@@ -25,7 +25,7 @@
 #include "tepl-utils.h"
 #include <string.h>
 
-/**
+/*
  * SECTION:utils
  * @title: TeplUtils
  * @short_description: Utility functions
@@ -292,105 +292,3 @@ _tepl_utils_get_fallback_basename_for_display (GFile *location)
 
        return basename;
 }
-
-/* Deep copy of @strv. */
-gchar **
-_tepl_utils_strv_copy (const gchar * const *strv)
-{
-       guint length;
-       gchar **new_strv;
-       guint i;
-
-       if (strv == NULL)
-       {
-               return NULL;
-       }
-
-       length = g_strv_length ((gchar **)strv);
-
-       new_strv = g_malloc ((length + 1) * sizeof (gchar *));
-
-       for (i = 0; i < length; i++)
-       {
-               new_strv[i] = g_strdup (strv[i]);
-       }
-
-       new_strv[length] = NULL;
-
-       return new_strv;
-}
-
-static gint
-get_menu_item_position (GtkMenuShell *menu_shell,
-                       GtkMenuItem  *item)
-{
-       GList *children;
-       GList *l;
-       gint pos;
-       gboolean found = FALSE;
-
-       children = gtk_container_get_children (GTK_CONTAINER (menu_shell));
-
-       for (l = children, pos = 0; l != NULL; l = l->next, pos++)
-       {
-               GtkMenuItem *cur_item = l->data;
-
-               if (cur_item == item)
-               {
-                       found = TRUE;
-                       break;
-               }
-       }
-
-       g_list_free (children);
-
-       return found ? pos : -1;
-}
-
-/**
- * tepl_utils_recent_chooser_menu_get_item_uri:
- * @menu: a #GtkRecentChooserMenu.
- * @item: a #GtkMenuItem.
- *
- * Gets the URI of @item. @item must be a child of @menu. @menu must be a
- * #GtkRecentChooserMenu.
- *
- * This function has been written because the value returned by
- * gtk_recent_chooser_get_current_uri() is not updated when #GtkMenuItem's of a
- * #GtkRecentChooserMenu are selected/deselected.
- *
- * Returns: the URI of @item. Free with g_free() when no longer needed.
- * Since: 2.0
- */
-gchar *
-tepl_utils_recent_chooser_menu_get_item_uri (GtkRecentChooserMenu *menu,
-                                            GtkMenuItem          *item)
-{
-       gint pos;
-       gchar **all_uris;
-       gsize length;
-       gchar *item_uri = NULL;
-
-       g_return_val_if_fail (GTK_IS_RECENT_CHOOSER_MENU (menu), NULL);
-       g_return_val_if_fail (GTK_IS_MENU_ITEM (item), NULL);
-
-       {
-               GtkWidget *item_parent;
-
-               item_parent = gtk_widget_get_parent (GTK_WIDGET (item));
-               g_return_val_if_fail (item_parent == GTK_WIDGET (menu), NULL);
-       }
-
-       pos = get_menu_item_position (GTK_MENU_SHELL (menu), item);
-       g_return_val_if_fail (pos >= 0, NULL);
-
-       all_uris = gtk_recent_chooser_get_uris (GTK_RECENT_CHOOSER (menu), &length);
-
-       if ((gsize)pos < length)
-       {
-               item_uri = g_strdup (all_uris[pos]);
-       }
-
-       g_strfreev (all_uris);
-       return item_uri;
-}
diff --git a/tepl/tepl-utils.h b/tepl/tepl-utils.h
index b50854f..f88900d 100644
--- a/tepl/tepl-utils.h
+++ b/tepl/tepl-utils.h
@@ -24,7 +24,7 @@
 #error "Only <tepl/tepl.h> can be included directly."
 #endif
 
-#include <gtk/gtk.h>
+#include <gio/gio.h>
 
 G_BEGIN_DECLS
 
@@ -44,16 +44,6 @@ gboolean     _tepl_utils_decode_uri                          (const gchar  *uri,
 G_GNUC_INTERNAL
 gchar *                _tepl_utils_get_fallback_basename_for_display   (GFile *location);
 
-/* String utilities */
-
-G_GNUC_INTERNAL
-gchar **       _tepl_utils_strv_copy                           (const gchar * const *strv);
-
-/* Widget utilities */
-
-gchar *                tepl_utils_recent_chooser_menu_get_item_uri     (GtkRecentChooserMenu *menu,
-                                                                GtkMenuItem          *item);
-
 G_END_DECLS
 
 #endif /* TEPL_UTILS_H */


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