summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Schwinn <alexxcons@xfce.org>2020-05-17 01:41:38 +0200
committerAlexander Schwinn <alexxcons@xfce.org>2020-05-17 02:57:19 +0200
commit85f1ee488208ef49a7ef88bdae00f78622dc8839 (patch)
treec4ec0e73dd757a6a834f85c3d4dfb280f011a56e
parentb6e332c10d724daa5c027fb3cf50eeb9bc916d06 (diff)
downloadthunar-85f1ee488208ef49a7ef88bdae00f78622dc8839.tar.gz
Remove "thunar-trash-action", since it is not used any more (Bug #16654)
-rw-r--r--po/POTFILES.in1
-rw-r--r--thunar/Makefile.am2
-rw-r--r--thunar/thunar-trash-action.c173
-rw-r--r--thunar/thunar-trash-action.h43
-rw-r--r--thunar/thunar-window.c1
5 files changed, 0 insertions, 220 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in
index ef8a3f53..db98ed6b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -75,7 +75,6 @@ thunar/thunar-statusbar.c
thunar/thunar-thumbnail-cache.c
thunar/thunar-thumbnailer.c
thunar/thunar-transfer-job.c
-thunar/thunar-trash-action.c
thunar/thunar-tree-model.c
thunar/thunar-tree-pane.c
thunar/thunar-tree-view.c
diff --git a/thunar/Makefile.am b/thunar/Makefile.am
index 24057d38..d69186e0 100644
--- a/thunar/Makefile.am
+++ b/thunar/Makefile.am
@@ -203,8 +203,6 @@ thunar_SOURCES = \
thunar-thumbnailer.h \
thunar-transfer-job.c \
thunar-transfer-job.h \
- thunar-trash-action.c \
- thunar-trash-action.h \
thunar-tree-model.c \
thunar-tree-model.h \
thunar-tree-pane.c \
diff --git a/thunar/thunar-trash-action.c b/thunar/thunar-trash-action.c
deleted file mode 100644
index 2e79f8f6..00000000
--- a/thunar/thunar-trash-action.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/* vi:set et ai sw=2 sts=2 ts=2: */
-/*-
- * Copyright (c) 2006 Benedikt Meurer <benny@xfce.org>
- * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * 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
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <thunar/thunar-file.h>
-#include <thunar/thunar-private.h>
-#include <thunar/thunar-trash-action.h>
-#include <thunar/thunar-icon-factory.h>
-
-
-
-static void thunar_trash_action_constructed (GObject *object);
-static void thunar_trash_action_finalize (GObject *object);
-static void thunar_trash_action_changed (ThunarTrashAction *trash_action,
- ThunarFile *trash_bin);
-
-
-struct _ThunarTrashActionClass
-{
- GtkActionClass __parent__;
-};
-
-struct _ThunarTrashAction
-{
- GtkAction __parent__;
- ThunarFile *trash_bin;
-};
-
-
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-G_DEFINE_TYPE (ThunarTrashAction, thunar_trash_action, GTK_TYPE_ACTION)
-G_GNUC_END_IGNORE_DEPRECATIONS
-
-
-
-static void
-thunar_trash_action_class_init (ThunarTrashActionClass *klass)
-{
- GObjectClass *gobject_class;
-
- gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->constructed = thunar_trash_action_constructed;
- gobject_class->finalize = thunar_trash_action_finalize;
-}
-
-
-
-static void
-thunar_trash_action_init (ThunarTrashAction *trash_action)
-{
- GFile *trash_bin;
-
- /* try to connect to the trash bin */
- trash_bin = thunar_g_file_new_for_trash ();
- trash_action->trash_bin = thunar_file_get (trash_bin, NULL);
- g_object_unref (trash_bin);
-
- /* safety check for trash bin... */
- if (G_LIKELY (trash_action->trash_bin != NULL))
- {
- /* watch the trash bin for changes */
- thunar_file_watch (trash_action->trash_bin);
-
- /* stay informed about changes to the trash bin */
- g_signal_connect_swapped (G_OBJECT (trash_action->trash_bin), "changed",
- G_CALLBACK (thunar_trash_action_changed),
- trash_action);
-
- /* initially update the stock icon */
- thunar_trash_action_changed (trash_action, trash_action->trash_bin);
-
- /* schedule a reload in idle (fix for bug #9513) */
- thunar_file_reload_idle (trash_action->trash_bin);
- }
-}
-
-
-
-static void
-thunar_trash_action_constructed (GObject *object)
-{
- ThunarTrashAction *trash_action = THUNAR_TRASH_ACTION (object);
- const gchar *label;
-
- if (trash_action->trash_bin != NULL)
- label = thunar_file_get_display_name (trash_action->trash_bin);
- else
- label = _("T_rash");
-
- g_object_set (trash_action, "label", label, NULL);
-}
-
-
-
-static void
-thunar_trash_action_finalize (GObject *object)
-{
- ThunarTrashAction *trash_action = THUNAR_TRASH_ACTION (object);
-
- /* check if we are connected to the trash bin */
- if (G_LIKELY (trash_action->trash_bin != NULL))
- {
- /* unwatch the trash bin */
- thunar_file_unwatch (trash_action->trash_bin);
-
- /* release the trash bin */
- g_signal_handlers_disconnect_by_func (G_OBJECT (trash_action->trash_bin), thunar_trash_action_changed, trash_action);
- g_object_unref (G_OBJECT (trash_action->trash_bin));
- }
-
- (*G_OBJECT_CLASS (thunar_trash_action_parent_class)->finalize) (object);
-}
-
-
-
-static void
-thunar_trash_action_changed (ThunarTrashAction *trash_action,
- ThunarFile *trash_bin)
-{
- _thunar_return_if_fail (THUNAR_IS_TRASH_ACTION (trash_action));
- _thunar_return_if_fail (trash_action->trash_bin == trash_bin);
- _thunar_return_if_fail (THUNAR_IS_FILE (trash_bin));
-
- /* unset the pixmap cache on the file */
- thunar_icon_factory_clear_pixmap_cache (trash_bin);
-
- /* adjust the stock icon appropriately */
- if (thunar_file_get_item_count (trash_bin) > 0)
- g_object_set (G_OBJECT (trash_action), "icon-name", "user-trash-full", NULL);
- else
- g_object_set (G_OBJECT (trash_action), "icon-name", "user-trash", NULL);
-}
-
-
-
-/**
- * thunar_trash_action_new:
- *
- * Allocates a new #ThunarTrashAction, whose associated widgets update their icons according to the
- * current trash state.
- *
- * Return value: the newly allocated #ThunarTrashAction.
- **/
-GtkAction*
-thunar_trash_action_new (void)
-{
- return g_object_new (THUNAR_TYPE_TRASH_ACTION,
- "name", "open-trash",
- "tooltip", _("Display the contents of the trash can"),
- "icon-name", "user-trash-full",
- NULL);
-}
diff --git a/thunar/thunar-trash-action.h b/thunar/thunar-trash-action.h
deleted file mode 100644
index c9c97fca..00000000
--- a/thunar/thunar-trash-action.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* vi:set et ai sw=2 sts=2 ts=2: */
-/*-
- * Copyright (c) 2006 Benedikt Meurer <benny@xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * 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
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __THUNAR_TRASH_ACTION_H__
-#define __THUNAR_TRASH_ACTION_H__
-
-#include <exo/exo.h>
-
-G_BEGIN_DECLS;
-
-typedef struct _ThunarTrashActionClass ThunarTrashActionClass;
-typedef struct _ThunarTrashAction ThunarTrashAction;
-
-#define THUNAR_TYPE_TRASH_ACTION (thunar_trash_action_get_type ())
-#define THUNAR_TRASH_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_TYPE_TRASH_ACTION, ThunarTrashAction))
-#define THUNAR_TRASH_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_TYPE_TRASH_ACTION, ThunarTrashActionClass))
-#define THUNAR_IS_TRASH_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_TYPE_TRASH_ACTION))
-#define THUNAR_IS_TRASH_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_TYPE_TRASH_ACTION))
-#define THUNAR_TRASH_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_TYPE_TRASH_ACTION, ThunarTrashActionClass))
-
-GType thunar_trash_action_get_type (void) G_GNUC_CONST;
-
-GtkAction *thunar_trash_action_new (void) G_GNUC_MALLOC;
-
-G_END_DECLS;
-
-#endif /* !__THUNAR_TRASH_ACTION_H__ */
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index df33b6f2..cb7990b7 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -56,7 +56,6 @@
#include <thunar/thunar-private.h>
#include <thunar/thunar-util.h>
#include <thunar/thunar-statusbar.h>
-#include <thunar/thunar-trash-action.h>
#include <thunar/thunar-tree-pane.h>
#include <thunar/thunar-window.h>
#include <thunar/thunar-window-ui.h>