[Xfce4-commits] <libxfce4util:master> Remove XfceDesktopEntry.

Nick Schermer noreply at xfce.org
Thu Jun 16 22:44:04 CEST 2011


Updating branch refs/heads/master
         to 5fa64704dbf6267faf32829188c07b04a6fe10ed (commit)
       from cc33d8ad94d9302b9b80df7ee332abdafd72b132 (commit)

commit 5fa64704dbf6267faf32829188c07b04a6fe10ed
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Jun 10 20:43:47 2011 +0200

    Remove XfceDesktopEntry.
    
    Better to use XfceRc or GKeyFile and already deprecated API.

 docs/libxfce4util-docs.sgml       |    2 -
 docs/libxfce4util-sections.txt    |   21 --
 docs/libxfce4util.types           |    1 -
 docs/tmpl/xfce-desktopentry.sgml  |   97 ------
 libxfce4util/Makefile.am          |    2 -
 libxfce4util/libxfce4util.h       |    1 -
 libxfce4util/libxfce4util.symbols |   13 -
 libxfce4util/xfce-desktopentry.c  |  616 -------------------------------------
 libxfce4util/xfce-desktopentry.h  |   91 ------
 po/POTFILES.in                    |    1 -
 10 files changed, 0 insertions(+), 845 deletions(-)

diff --git a/docs/libxfce4util-docs.sgml b/docs/libxfce4util-docs.sgml
index cf79f96..fb1830b 100644
--- a/docs/libxfce4util-docs.sgml
+++ b/docs/libxfce4util-docs.sgml
@@ -10,7 +10,6 @@
 <!ENTITY libxfce4util-FileUtils-Functions SYSTEM "xml/xfce-fileutils.xml">
 <!ENTITY libxfce4util-MiscUtils-Functions SYSTEM "xml/xfce-miscutils.xml">
 <!ENTITY libxfce4util-Unicode-Functions SYSTEM "xml/xfce-utf8.xml">
-<!ENTITY libxfce4util-Desktop-Entries SYSTEM "xml/xfce-desktopentry.xml">
 <!ENTITY libxfce4util-Generics SYSTEM "xml/xfce-generics.xml">
 <!ENTITY libxfce4util-Signal-Handling SYSTEM "xml/xfce-posix-signal-handler.xml">
 <!ENTITY version SYSTEM "version.xml">
@@ -40,7 +39,6 @@
 
 	<chapter id="libxfce4util-core">
 		<title>Xfce Core Application support</title>
-		&libxfce4util-Desktop-Entries;
 		&libxfce4util-Kiosk;
 		&libxfce4util-Signal-Handling;
 	</chapter>
diff --git a/docs/libxfce4util-sections.txt b/docs/libxfce4util-sections.txt
index b2bb0bf..4192244 100644
--- a/docs/libxfce4util-sections.txt
+++ b/docs/libxfce4util-sections.txt
@@ -144,27 +144,6 @@ xfce_expand_variables
 
 
 <SECTION>
-<TITLE>Desktop entries</TITLE>
-<FILE>xfce-desktopentry</FILE>
-XfceDesktopEntry
-xfce_desktop_entry_new
-xfce_desktop_entry_new_from_data
-xfce_desktop_entry_get_file
-xfce_desktop_entry_get_string
-xfce_desktop_entry_get_int
-xfce_desktop_entry_has_translated_entry
-<SUBSECTION Standard>
-XFCE_DESKTOP_ENTRY
-XFCE_IS_DESKTOP_ENTRY
-XFCE_TYPE_DESKTOP_ENTRY
-XFCE_DESKTOP_ENTRY_CLASS
-XFCE_IS_DESKTOP_ENTRY_CLASS
-XFCE_DESKTOP_ENTRY_GET_CLASS
-<SUBSECTION Private>
-xfce_desktop_entry_get_type
-</SECTION>
-
-<SECTION>
 <TITLE>POSIX Signal Handling</TITLE>
 <FILE>xfce-posix-signal-handler</FILE>
 XfcePosixSignalHandler
diff --git a/docs/libxfce4util.types b/docs/libxfce4util.types
index bffc4ff..8290081 100644
--- a/docs/libxfce4util.types
+++ b/docs/libxfce4util.types
@@ -1,3 +1,2 @@
 #include <libxfce4util/libxfce4util.h>
 
-xfce_desktop_entry_get_type
diff --git a/docs/tmpl/xfce-desktopentry.sgml b/docs/tmpl/xfce-desktopentry.sgml
deleted file mode 100644
index 92e0c82..0000000
--- a/docs/tmpl/xfce-desktopentry.sgml
+++ /dev/null
@@ -1,97 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-XfceDesktopEntry
-
-<!-- ##### SECTION Short_Description ##### -->
-A GObject that wraps a .desktop file.
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-XfceDesktopEntry is a wrapper for a so-called desktop entry file. The
-desktop entry format is defined on <ulink
-url="http://www.freedesktop.org/">Freedesktop.org</ulink>.
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT XfceDesktopEntry ##### -->
-<para>
-All the fields in the XfceDesktopEntry structure are private to the
-XfceDesktopEntry implementation and should never be accessed directly.
-Instead, you should use the functions listed below.
-</para>
-
- at Deprecated: 4.8: Use #XfceRc instead.
-
-<!-- ##### FUNCTION xfce_desktop_entry_new ##### -->
-<para>
-
-</para>
-
- at file: 
- at categories: 
- at num_categories: 
- at Returns: 
-
-
-<!-- ##### FUNCTION xfce_desktop_entry_new_from_data ##### -->
-<para>
-
-</para>
-
- at data: 
- at categories: 
- at num_categories: 
- at Returns: 
-
-
-<!-- ##### FUNCTION xfce_desktop_entry_get_file ##### -->
-<para>
-
-</para>
-
- at desktop_entry: 
- at Returns: 
-
-
-<!-- ##### FUNCTION xfce_desktop_entry_get_string ##### -->
-<para>
-
-</para>
-
- at desktop_entry: 
- at key: 
- at translated: 
- at value_return: 
- at Returns: 
-
-
-<!-- ##### FUNCTION xfce_desktop_entry_get_int ##### -->
-<para>
-
-</para>
-
- at desktop_entry: 
- at key: 
- at value_return: 
- at Returns: 
-
-
-<!-- ##### FUNCTION xfce_desktop_entry_has_translated_entry ##### -->
-<para>
-
-</para>
-
- at desktop_entry: 
- at key: 
- at Returns: 
-
-
diff --git a/libxfce4util/Makefile.am b/libxfce4util/Makefile.am
index f93c91c..0f3db3b 100644
--- a/libxfce4util/Makefile.am
+++ b/libxfce4util/Makefile.am
@@ -20,7 +20,6 @@ lib_LTLIBRARIES =							\
 
 libxfce4util_headers =							\
 	debug.h								\
-	xfce-desktopentry.h						\
 	xfce-fileutils.h						\
 	xfce-generics.h							\
 	xfce-i18n.h							\
@@ -54,7 +53,6 @@ libxfce4util_la_SOURCES =						\
 	libxfce4util-config.c						\
 	libxfce4util-private.c						\
 	libxfce4util-private.h						\
-	xfce-desktopentry.c						\
 	xfce-fileutils.c						\
 	xfce-i18n.c							\
 	xfce-kiosk.c							\
diff --git a/libxfce4util/libxfce4util.h b/libxfce4util/libxfce4util.h
index 8bb7471..0e9ec8c 100644
--- a/libxfce4util/libxfce4util.h
+++ b/libxfce4util/libxfce4util.h
@@ -28,7 +28,6 @@
 #include <libxfce4util/libxfce4util-enum-types.h>
 
 #include <libxfce4util/debug.h>
-#include <libxfce4util/xfce-desktopentry.h>
 #include <libxfce4util/xfce-fileutils.h>
 #include <libxfce4util/xfce-generics.h>
 #include <libxfce4util/xfce-i18n.h>
diff --git a/libxfce4util/libxfce4util.symbols b/libxfce4util/libxfce4util.symbols
index b28b14e..e40fa68 100644
--- a/libxfce4util/libxfce4util.symbols
+++ b/libxfce4util/libxfce4util.symbols
@@ -53,19 +53,6 @@ xfce_resource_type_get_type G_GNUC_CONST
 #endif
 #endif
 
-/* XfceDesktopEntry methods */
-#if IN_HEADER(__XFCE_DESKTOPENTRY_H__)
-#if IN_SOURCE(__XFCE_DESKTOPENTRY_C__)
-xfce_desktop_entry_get_type G_GNUC_CONST
-xfce_desktop_entry_new G_GNUC_MALLOC
-xfce_desktop_entry_new_from_data G_GNUC_MALLOC
-xfce_desktop_entry_get_file
-xfce_desktop_entry_get_int
-xfce_desktop_entry_get_string
-xfce_desktop_entry_has_translated_entry
-#endif
-#endif
-
 /* xfce-fileutils functions */
 #if IN_HEADER(__XFCE_FILEUTILS_H__)
 #if IN_SOURCE(__XFCE_FILEUTILS_C__)
diff --git a/libxfce4util/xfce-desktopentry.c b/libxfce4util/xfce-desktopentry.c
deleted file mode 100644
index 8736952..0000000
--- a/libxfce4util/xfce-desktopentry.c
+++ /dev/null
@@ -1,616 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2004 Jasper Huijsmans <jasper at xfce.org>
- * Copyright (c) 2006 Benedikt Meurer <benny at xfce.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#endif
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-
-
-#include <libxfce4util/libxfce4util.h>
-#include <libxfce4util/libxfce4util-alias.h>
-
-
-
-/* fallback for g_intern_static_string() with GLib < 2.9.0 */
-#if !GLIB_CHECK_VERSION(2,9,0)
-#define g_intern_static_string(string) (g_quark_to_string (g_quark_from_static_string ((string))))
-#endif
-
-
-
-#define XFCE_DESKTOP_ENTRY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFCE_TYPE_DESKTOP_ENTRY, XfceDesktopEntryPrivate))
-
-
-
-typedef struct _XfceDesktopEntryItem XfceDesktopEntryItem;
-
-
-
-static void                        xfce_desktop_entry_class_init (XfceDesktopEntryClass *klass);
-static void                        xfce_desktop_entry_init       (XfceDesktopEntry      *desktop_entry);
-static void                        xfce_desktop_entry_finalize   (GObject               *object);
-static const XfceDesktopEntryItem *xfce_desktop_entry_lookup     (XfceDesktopEntry      *desktop_entry,
-                                                                     const gchar        *key);
-static gboolean                    xfce_desktop_entry_parse      (XfceDesktopEntry      *desktop_entry);
-
-
-
-struct _XfceDesktopEntryPrivate
-{
-  gchar                *file;
-  gchar                *locale;
-  gchar                *data;
-
-  XfceDesktopEntryItem *items;
-  gint                  num_items;
-};
-
-struct _XfceDesktopEntryItem
-{
-  gchar *key;
-  gchar *value;
-  gchar *section;
-  gchar *translated_value;
-};
-
-
-
-static GObject *xfce_desktop_entry_parent_class;
-
-
-
-GType
-xfce_desktop_entry_get_type (void)
-{
-  static GType type = G_TYPE_INVALID;
-
-  if (G_UNLIKELY (type == G_TYPE_INVALID))
-    {
-      static const GTypeInfo info =
-      {
-        sizeof (XfceDesktopEntryClass),
-        NULL,
-        NULL,
-        (GClassInitFunc) xfce_desktop_entry_class_init,
-        NULL,
-        NULL,
-        sizeof (XfceDesktopEntry),
-        0,
-        (GInstanceInitFunc) xfce_desktop_entry_init,
-        NULL,
-      };
-
-      type = g_type_register_static (G_TYPE_OBJECT, g_intern_static_string ("XfceDesktopEntry"), &info, 0);
-    }
-
-  return type;
-}
-
-
-
-static void
-xfce_desktop_entry_class_init (XfceDesktopEntryClass * klass)
-{
-  GObjectClass *gobject_class;
-
-  /* install private data for the type */
-  g_type_class_add_private (klass, sizeof (XfceDesktopEntryPrivate));
-
-  /* determine the parent type class */
-  xfce_desktop_entry_parent_class = g_type_class_peek_parent (klass);
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->finalize = xfce_desktop_entry_finalize;
-}
-
-
-
-static void
-xfce_desktop_entry_init (XfceDesktopEntry *desktop_entry)
-{
-  desktop_entry->priv = XFCE_DESKTOP_ENTRY_GET_PRIVATE (desktop_entry);
-}
-
-
-
-static void
-xfce_desktop_entry_finalize (GObject *object)
-{
-  XfceDesktopEntry *desktop_entry = XFCE_DESKTOP_ENTRY (object);
-  gint              n;
-
-  /* release the items */
-  for (n = 0; n < desktop_entry->priv->num_items; ++n)
-    {
-      g_free (desktop_entry->priv->items[n].translated_value);
-      g_free (desktop_entry->priv->items[n].section);
-      g_free (desktop_entry->priv->items[n].value);
-      g_free (desktop_entry->priv->items[n].key);
-    }
-
-  g_free (desktop_entry->priv->items);
-  g_free (desktop_entry->priv->file);
-  g_free (desktop_entry->priv->data);
-
-  (*G_OBJECT_CLASS (xfce_desktop_entry_parent_class)->finalize) (object);
-}
-
-
-
-static const XfceDesktopEntryItem*
-xfce_desktop_entry_lookup (XfceDesktopEntry *desktop_entry,
-                           const gchar      *key)
-{
-  XfceDesktopEntryItem *item;
-  gint                  n;
-
-  for (item = desktop_entry->priv->items, n = 0; n < desktop_entry->priv->num_items; ++item, ++n)
-    if (strcmp (item->key, key) == 0)
-      return item;
-
-  return NULL;
-}
-
-
-
-static gboolean
-parse_desktop_entry_line (const gchar *line,
-                          gchar      **section_return,
-                          gchar      **key_return,
-                          gchar      **value_return,
-                          gchar      **locale_return)
-{
-  const gchar *p = line;
-  const gchar *q;
-  const gchar *r;
-  const gchar *s;
-
-  /* initialize to NULL, so we don't have tho think about it anymore */
-  *section_return = NULL;
-  *key_return = NULL;
-  *value_return = NULL;
-  *locale_return = NULL;
-
-  /* skip whitespace */
-  while (g_ascii_isspace (*p))
-    ++p;
-
-  if (*p == '#' || *p == '\n' || *p == '\0')
-    return FALSE;
-
-  if (*p == '[')
-    {
-      ++p;
-
-      q = strchr (p, ']');
-      if (G_UNLIKELY (q == NULL))
-        return FALSE;
-
-      *section_return = g_strndup (p, q - p);
-    }
-  else
-    {
-      q = strchr (p, '=');
-      if (G_UNLIKELY (q == NULL))
-        return FALSE;
-
-      r = q + 1;
-
-      for (--q; g_ascii_isspace (*q); )
-        --q;
-
-      if (*q == ']')
-        {
-          s = strchr (p, '[');
-          if (G_UNLIKELY (s == NULL))
-            return FALSE;
-
-          *key_return = g_strndup (p, s - p);
-
-          ++s;
-
-          *locale_return = g_strndup (s, q - s);
-        }
-      else
-        {
-            *key_return = g_strndup (p, (q + 1) - p);
-        }
-
-      while (g_ascii_isspace (*r))
-        ++r;
-
-      q = r + strlen (r);
-
-      while (q > r && (g_ascii_isspace (*(q - 1)) || ((*(q - 1)) == '\r')))
-        --q;
-
-      if (q > r)
-        *value_return = g_strndup (r, q - r);
-      else
-        *value_return = g_new0 (gchar, 1);
-    }
-
-  return TRUE;
-}
-
-
-
-static gboolean
-xfce_desktop_entry_parse (XfceDesktopEntry *desktop_entry)
-{
-  XfceDesktopEntryItem *item;
-  const gchar          *current_locale;
-  gboolean              in_d_e_section = FALSE;
-  gboolean              result = FALSE;
-  gchar                *current_section = NULL;
-  gchar                *section;
-  gchar                *locale;
-  gchar                *value;
-  gchar                *key;
-  gchar               **lines;
-  gchar               **p;
-  gint                  locale_matched = 0;
-  gint                  i;
-
-  current_locale = setlocale (LC_MESSAGES, NULL);
-
-  lines = g_strsplit (desktop_entry->priv->data, "\n", -1);
-  for (p = lines; *p != NULL; ++p)
-    {
-      /* some .desktop files have multiple sections.  we're only interested
-       * in the "[Desktop Entry]" section */
-      if (!in_d_e_section)
-        {
-          if (!g_ascii_strncasecmp (*p, "[Desktop Entry]", 15))
-            in_d_e_section = TRUE;
-        }
-      else if (**p == '[' && g_ascii_strncasecmp(*p, "[Desktop Entry]", 15))
-        in_d_e_section = FALSE;
-
-      if (!in_d_e_section)
-        continue;
-
-      if (!parse_desktop_entry_line (*p, &section, &key, &value, &locale))
-        continue;
-
-      if (G_UNLIKELY (section != NULL))
-        {
-          g_free (current_section);
-          current_section = section;
-          continue;
-        }
-
-      item = desktop_entry->priv->items;
-
-      for (i = 0; i < desktop_entry->priv->num_items; ++i, ++item)
-        {
-          if (key != NULL && item->key != NULL && strcmp (key, item->key) == 0)
-            {
-              if (current_locale != NULL && locale != NULL)
-                {
-                  gint match = xfce_locale_match (current_locale, locale);
-                  if (match > locale_matched)
-                    {
-                      g_free (item->translated_value);
-                      item->translated_value = g_strdup (value);
-                    }
-                }
-              else
-                {
-                  g_free (item->value);
-                  item->value = g_strdup (value);
-                  result = TRUE;
-                }
-
-              if (current_section != NULL)
-                {
-                  g_free (item->section);
-                  item->section = g_strdup (current_section);
-                }
-
-              break;
-            }
-        }
-
-      g_free (value);
-      g_free (key);
-      g_free (locale);
-    }
-
-  g_free (current_section);
-  g_strfreev (lines);
-
-  return result;
-}
-
-
-
-/**
- * xfce_desktop_entry_new:
- * @file           : full path to the desktop entry file to use.
- * @categories     : array of categories, not necessarily NULL terminated.
- * @num_categories : number of items in @categories.
- *
- * Create a new #XfceDesktopEntry object from a desktop entry stored in a file on disk.
- *
- * The caller is responsible to free the returned object (if any) using
- * g_object_unref() when no longer needed.
- *
- * Return value: newly created #XfceDesktopEntry or NULL if something goes wrong.
- *
- * Since: 4.2
- *
- * Deprecated: 4.8: Use #XfceRc instead.
- **/
-XfceDesktopEntry*
-xfce_desktop_entry_new (const gchar  *file,
-                        const gchar **categories,
-                        gint          num_categories)
-{
-  XfceDesktopEntryItem *item;
-  XfceDesktopEntry     *desktop_entry;
-  gint                  n;
-
-  g_return_val_if_fail (file != NULL, NULL);
-  g_return_val_if_fail (categories != NULL, NULL);
-
-  desktop_entry = g_object_new (XFCE_TYPE_DESKTOP_ENTRY, NULL);
-  desktop_entry->priv->file = g_strdup (file);
-  desktop_entry->priv->items = g_new0 (XfceDesktopEntryItem, num_categories);
-  desktop_entry->priv->num_items = num_categories;
-
-  if (!g_file_get_contents (desktop_entry->priv->file, &(desktop_entry->priv->data), NULL, NULL))
-    {
-      g_warning ("Could not get contents of file %s", desktop_entry->priv->file);
-      g_object_unref (G_OBJECT (desktop_entry));
-      return NULL;
-    }
-
-  for (item = desktop_entry->priv->items, n = 0; n < desktop_entry->priv->num_items; ++item, ++n)
-    item->key = g_strdup (categories[n]);
-
-  if (!xfce_desktop_entry_parse (desktop_entry))
-    {
-      g_object_unref (G_OBJECT (desktop_entry));
-      desktop_entry = NULL;
-    }
-
-  return desktop_entry;
-}
-
-
-
-/**
- * xfce_desktop_entry_new_from_data:
- * @data           : pointer to the desktop entry inline data.
- * @categories     : array of categories, not necessarily NULL terminated.
- * @num_categories : number of items in @categories.
- *
- * Create a new #XfceDesktopEntry object from a desktop entry stored in memory.
- *
- * The caller is responsible to free the returned object (if any) using
- * g_object_unref() when no longer needed.
- *
- * Return value: newly created #XfceDesktopEntry or NULL if something goes wrong.
- *
- * Since: 4.2
- *
- * Deprecated: 4.8: Use #XfceRc instead.
- **/
-XfceDesktopEntry*
-xfce_desktop_entry_new_from_data (const gchar  *data,
-                                  const gchar **categories,
-                                  gint          num_categories)
-{
-  XfceDesktopEntryItem *item;
-  XfceDesktopEntry     *desktop_entry;
-  gint                  n;
-
-  g_return_val_if_fail (data != NULL, NULL);
-  g_return_val_if_fail (categories != NULL, NULL);
-
-  desktop_entry = g_object_new (XFCE_TYPE_DESKTOP_ENTRY, NULL);
-  desktop_entry->priv->file = g_strdup (""); /* or "data" or ... */
-  desktop_entry->priv->data = g_strdup (data);
-  desktop_entry->priv->items = g_new0 (XfceDesktopEntryItem, num_categories);
-  desktop_entry->priv->num_items = num_categories;
-
-  for (item = desktop_entry->priv->items, n = 0; n < desktop_entry->priv->num_items; ++item, ++n)
-    item->key = g_strdup (categories[n]);
-
-  if (!xfce_desktop_entry_parse (desktop_entry))
-    {
-      g_object_unref (G_OBJECT (desktop_entry));
-      desktop_entry = NULL;
-    }
-
-  return desktop_entry;
-}
-
-
-
-/**
- * xfce_desktop_entry_get_file:
- * @desktop_entry: an #XfceDesktopEntry.
- *
- * Obtain the path to the desktop entry file associated with the
- * #XfceDesktopEntry.
- *
- * Return value: path of the desktop entry file used to create @desktop_entry. The
- *               return value should be considered read-only and must not be freed
- *               by the caller.
- * Since: 4.2
- *
- * Deprecated: 4.8: Use #XfceRc instead.
- **/
-G_CONST_RETURN gchar*
-xfce_desktop_entry_get_file (XfceDesktopEntry *desktop_entry)
-{
-    g_return_val_if_fail (XFCE_IS_DESKTOP_ENTRY (desktop_entry), NULL);
-    return desktop_entry->priv->file;
-}
-
-
-
-/**
- * xfce_desktop_entry_get_string:
- * @desktop_entry : an #XfceDesktopEntry
- * @key           : category to find value for.
- * @translated    : set to TRUE if the translated value is preferred.
- * @value_return  : location for the value, which will be newly allocated.
- *
- * Finds the value for @key. When @translated is TRUE the function will use
- * the translated value (using the current locale settings) if available or
- * the untranslated value if no translation can be found.
- *
- * Return value: TRUE on success, FALSE on failure. @value_return must be freed.
- *
- * Since: 4.2
- *
- * Deprecated: 4.8: Use #XfceRc instead.
-**/
-gboolean
-xfce_desktop_entry_get_string (XfceDesktopEntry *desktop_entry,
-                               const gchar      *key,
-                               gboolean          translated,
-                               gchar           **value_return)
-{
-  const XfceDesktopEntryItem *item;
-
-  g_return_val_if_fail (XFCE_IS_DESKTOP_ENTRY (desktop_entry), FALSE);
-  g_return_val_if_fail (value_return != NULL, FALSE);
-  g_return_val_if_fail (key != NULL, FALSE);
-
-  item = xfce_desktop_entry_lookup (desktop_entry, key);
-  if (G_UNLIKELY (item == NULL || item->value == NULL || *item->value == '\0'))
-    return FALSE;
-
-  if (translated && item->translated_value != NULL)
-    *value_return = g_strdup (item->translated_value);
-  else
-    *value_return = g_strdup (item->value);
-
-  return TRUE;
-}
-
-
-
-/**
- * xfce_desktop_entry_get_int:
- * @desktop_entry : an #XfceDesktopEntry.
- * @key           : category to find value for.
- * @value_return  : location for the value.
- *
- * Gets a value from @desktop_entry as integer. Therefore finds the value for
- * @key and returns its integer representation.
- *
- * Return value: TRUE on success, FALSE on failure.
- *
- * Since: 4.2
- *
- * Deprecated: 4.8: Use #XfceRc instead.
- **/
-gboolean
-xfce_desktop_entry_get_int (XfceDesktopEntry *desktop_entry,
-                            const gchar      *key,
-                            gint             *value_return)
-{
-  const XfceDesktopEntryItem *item;
-  gchar                      *endptr;
-
-  g_return_val_if_fail (XFCE_IS_DESKTOP_ENTRY (desktop_entry), FALSE);
-  g_return_val_if_fail (value_return != NULL, FALSE);
-  g_return_val_if_fail (key != NULL, FALSE);
-
-  item = xfce_desktop_entry_lookup (desktop_entry, key);
-  if (G_UNLIKELY (item == NULL || item->value == NULL || *item->value == '\0'))
-    return FALSE;
-
-  *value_return = strtol (item->value, &endptr, 10);
-  if (*endptr == '\0')
-    return TRUE;
-
-  return FALSE;
-}
-
-
-
-/**
- * xfce_desktop_entry_has_translated_entry:
- * @desktop_entry : an #XfceDesktopEntry.
- * @key           : the key to check.
- *
- * Checks to see if @desktop_entry has a value for @key translated into
- * the current locale.
- *
- * Return Value: %TRUE if there is a translated key, %FALSE otherwise.
- *
- * Since: 4.3
- *
- * Deprecated: 4.8: Use #XfceRc instead.
- **/
-gboolean
-xfce_desktop_entry_has_translated_entry (XfceDesktopEntry *desktop_entry,
-                                         const gchar      *key)
-{
-  const XfceDesktopEntryItem *item;
-  const gchar                *current_locale;
-
-  g_return_val_if_fail (XFCE_IS_DESKTOP_ENTRY (desktop_entry), FALSE);
-  g_return_val_if_fail (key != NULL, FALSE);
-
-  item = xfce_desktop_entry_lookup (desktop_entry, key);
-  if (G_UNLIKELY (item == NULL || item->value == NULL || *item->value == '\0'))
-    return FALSE;
-
-  current_locale = setlocale (LC_MESSAGES, NULL);
-
-  if (item->translated_value == NULL
-      && !xfce_locale_match (current_locale, "C")
-      && !xfce_locale_match (current_locale, "POSIX"))
-  {
-      return FALSE;
-  }
-
-  return TRUE;
-}
-
-
-
-#define __XFCE_DESKTOPENTRY_C__
-#include <libxfce4util/libxfce4util-aliasdef.c>
diff --git a/libxfce4util/xfce-desktopentry.h b/libxfce4util/xfce-desktopentry.h
deleted file mode 100644
index 1bf6358..0000000
--- a/libxfce4util/xfce-desktopentry.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2004 Jasper Huijsmans <jasper at xfce.org>
- * Copyright (c) 2006 Benedikt Meurer <benny at xfce.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA
- */
-
-#if !defined(LIBXFCE4UTIL_INSIDE_LIBXFCE4UTIL_H) && !defined(LIBXFCE4UTIL_COMPILATION)
-#error "Only <libxfce4util/libxfce4util.h> can be included directly, this file may disappear or change contents"
-#endif
-
-#ifndef __XFCE_DESKTOPENTRY_H__
-#define __XFCE_DESKTOPENTRY_H__
-
-#if defined(LIBXFCE4UTIL_COMPILATION) || !defined(XFCE_DISABLE_DEPRECATED)
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-typedef struct _XfceDesktopEntryPrivate XfceDesktopEntryPrivate;
-typedef struct _XfceDesktopEntryClass   XfceDesktopEntryClass;
-typedef struct _XfceDesktopEntry        XfceDesktopEntry;
-
-#define XFCE_TYPE_DESKTOP_ENTRY            (xfce_desktop_entry_get_type ())
-#define XFCE_DESKTOP_ENTRY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_DESKTOP_ENTRY, XfceDesktopEntry))
-#define XFCE_DESKTOP_ENTRY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_DESKTOP_ENTRY, XfceDesktopEntryClass))
-#define XFCE_IS_DESKTOP_ENTRY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_DESKTOP_ENTRY))
-#define XFCE_IS_DESKTOP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_DESKTOP_ENTRY))
-#define XFCE_DESKTOP_ENTRY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_DESKTOP_ENTRY, XfceDesktopEntryClass))
-
-struct _XfceDesktopEntry
-{
-  /*< private >*/
-  GObject                  __parent__;
-  XfceDesktopEntryPrivate *priv;
-};
-
-struct _XfceDesktopEntryClass
-{
-  /*< private >*/
-  GObjectClass __parent__;
-
-  /* Padding for future expansion */
-  void (*reserved1) (void);
-  void (*reserved2) (void);
-  void (*reserved3) (void);
-};
-
-GType                  xfce_desktop_entry_get_type              (void) G_GNUC_CONST;
-
-XfceDesktopEntry      *xfce_desktop_entry_new                   (const gchar      *file,
-                                                                 const gchar     **categories,
-                                                                 gint              num_categories) G_GNUC_MALLOC;
-XfceDesktopEntry      *xfce_desktop_entry_new_from_data         (const gchar      *data,
-                                                                 const gchar     **categories,
-                                                                 gint              num_categories) G_GNUC_MALLOC;
-
-G_CONST_RETURN gchar  *xfce_desktop_entry_get_file              (XfceDesktopEntry *desktop_entry);
-
-gboolean               xfce_desktop_entry_get_int               (XfceDesktopEntry *desktop_entry,
-                                                                 const gchar      *key,
-                                                                 gint             *value_return);
-gboolean               xfce_desktop_entry_get_string            (XfceDesktopEntry *desktop_entry,
-                                                                 const gchar      *key,
-                                                                 gboolean          translated,
-                                                                 gchar           **value_return);
-
-gboolean               xfce_desktop_entry_has_translated_entry  (XfceDesktopEntry *desktop_entry,
-                                                                 const gchar      *key);
-
-G_END_DECLS
-
-#endif /* !XFCE_DISABLE_DEPRECATED */
-
-#endif /* !__XFCE_DESKTOPENTRY_H__ */
-
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 01eb6fc..a111328 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,5 +1,4 @@
 libxfce4util/libxfce4util-config.c
-libxfce4util/xfce-desktopentry.c
 libxfce4util/xfce-fileutils.c
 libxfce4util/xfce-i18n.c
 libxfce4util/xfce-kiosk.c



More information about the Xfce4-commits mailing list