background: Remove unused GnomeWpInfo code

This commit is contained in:
Bastien Nocera 2011-02-10 20:34:23 +00:00
parent ca14846ef9
commit a653a0a560
3 changed files with 17 additions and 161 deletions

View file

@ -29,23 +29,23 @@ ccpanelsdir = $(PANELS_DIR)
ccpanels_LTLIBRARIES = libbackground.la
libbackground_la_SOURCES = \
background-module.c \
cc-background-panel.c \
cc-background-panel.h \
cc-background-item.c \
cc-background-item.h \
gdesktop-enums-types.c \
gdesktop-enums-types.h \
bg-source.c \
bg-source.h \
bg-pictures-source.c \
bg-pictures-source.h \
bg-wallpapers-source.c \
bg-wallpapers-source.h \
bg-colors-source.c \
bg-colors-source.h \
gnome-wp-info.c gnome-wp-xml.c \
gnome-wp-info.h gnome-wp-xml.h
background-module.c \
cc-background-panel.c \
cc-background-panel.h \
cc-background-item.c \
cc-background-item.h \
gdesktop-enums-types.c \
gdesktop-enums-types.h \
bg-source.c \
bg-source.h \
bg-pictures-source.c \
bg-pictures-source.h \
bg-wallpapers-source.c \
bg-wallpapers-source.h \
bg-colors-source.c \
bg-colors-source.h \
gnome-wp-xml.c \
gnome-wp-xml.h
libbackground_la_LIBADD = \

View file

@ -1,98 +0,0 @@
/*
* Authors: Rodney Dawes <dobey@ximian.com>
*
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
*
*/
#include <config.h>
#include <string.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
#include "gnome-wp-info.h"
GnomeWPInfo * gnome_wp_info_new (const gchar * uri,
GFileInfo * file_info,
GnomeDesktopThumbnailFactory * thumbs) {
GnomeWPInfo *wp;
GFileInfo *info;
if (file_info == NULL)
{
GFile *file;
file = g_file_new_for_commandline_arg (uri);
info = g_file_query_info (file,
G_FILE_ATTRIBUTE_STANDARD_NAME ","
G_FILE_ATTRIBUTE_STANDARD_SIZE ","
G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
G_FILE_ATTRIBUTE_TIME_MODIFIED,
G_FILE_QUERY_INFO_NONE,
NULL, NULL);
g_object_unref (file);
}
else
{
info = g_object_ref (file_info);
}
if (info == NULL || g_file_info_get_content_type (info) == NULL) {
if (!strcmp (uri, "(none)")) {
wp = g_new0 (GnomeWPInfo, 1);
wp->mime_type = g_strdup ("image/x-no-data");
wp->uri = g_strdup (uri);
wp->name = g_strdup (_("No Desktop Background"));
wp->size = 0;
} else {
wp = NULL;
}
} else {
wp = g_new0 (GnomeWPInfo, 1);
wp->uri = g_strdup (uri);
wp->name = g_strdup (g_file_info_get_name (info));
if (g_file_info_get_content_type (info) != NULL)
wp->mime_type = g_strdup (g_file_info_get_content_type (info));
wp->size = g_file_info_get_size (info);
wp->mtime = g_file_info_get_attribute_uint64 (info,
G_FILE_ATTRIBUTE_TIME_MODIFIED);
wp->thumburi = gnome_desktop_thumbnail_factory_lookup (thumbs,
uri,
wp->mtime);
}
if (info != NULL)
g_object_unref (info);
return wp;
}
void gnome_wp_info_free (GnomeWPInfo * info) {
if (info == NULL) {
return;
}
g_free (info->uri);
g_free (info->thumburi);
g_free (info->name);
g_free (info->mime_type);
g_free (info);
}

View file

@ -1,46 +0,0 @@
/*
* Authors: Rodney Dawes <dobey@ximian.com>
*
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
*
*/
#ifndef _GNOME_WP_INFO_H_
#define _GNOME_WP_INFO_H_
#include <glib.h>
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
typedef struct _GnomeWPInfo GnomeWPInfo;
struct _GnomeWPInfo {
gchar * uri;
gchar * thumburi;
gchar * name;
gchar * mime_type;
goffset size;
time_t mtime;
};
GnomeWPInfo * gnome_wp_info_new (const gchar * uri,
GFileInfo * file_info,
GnomeDesktopThumbnailFactory * thumbs);
void gnome_wp_info_free (GnomeWPInfo * info);
#endif