aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2011-12-15 01:24:39 +0800
committerXan Lopez <xan@igalia.com>2011-12-15 01:24:39 +0800
commit049e9612e7676c87ac0f011ec56340614e513cab (patch)
treec8d72a04868f0fcdbfb3b47572bd615466f9afd7 /src
parent44d48795f34bd60cb8f8146e8cc3ed62c893d3ac (diff)
downloadgsoc2013-epiphany-049e9612e7676c87ac0f011ec56340614e513cab.tar.gz
gsoc2013-epiphany-049e9612e7676c87ac0f011ec56340614e513cab.tar.zst
gsoc2013-epiphany-049e9612e7676c87ac0f011ec56340614e513cab.zip
ephy-related-action: remove, it's unused
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/Makefile.am2
-rw-r--r--src/bookmarks/ephy-bookmarks-ui.c1
-rw-r--r--src/bookmarks/ephy-related-action.c162
-rw-r--r--src/bookmarks/ephy-related-action.h61
4 files changed, 0 insertions, 226 deletions
diff --git a/src/bookmarks/Makefile.am b/src/bookmarks/Makefile.am
index e8dac3130..7231932a0 100644
--- a/src/bookmarks/Makefile.am
+++ b/src/bookmarks/Makefile.am
@@ -17,7 +17,6 @@ NOINST_H_FILES = \
ephy-bookmarks-menu.h \
ephy-bookmark-properties.h \
ephy-topic-action.h \
- ephy-related-action.h \
ephy-open-tabs-action.h \
ephy-topic-action-group.h \
ephy-bookmark-action-group.h \
@@ -35,7 +34,6 @@ libephybookmarks_la_SOURCES = \
ephy-bookmarks-menu.c \
ephy-bookmark-properties.c \
ephy-topic-action.c \
- ephy-related-action.c \
ephy-open-tabs-action.c \
ephy-topic-action-group.c \
ephy-bookmark-action-group.c \
diff --git a/src/bookmarks/ephy-bookmarks-ui.c b/src/bookmarks/ephy-bookmarks-ui.c
index bbee1517a..66d675df7 100644
--- a/src/bookmarks/ephy-bookmarks-ui.c
+++ b/src/bookmarks/ephy-bookmarks-ui.c
@@ -37,7 +37,6 @@
#include "ephy-node-common.h"
#include "ephy-open-tabs-action.h"
#include "ephy-prefs.h"
-#include "ephy-related-action.h"
#include "ephy-settings.h"
#include "ephy-shell.h"
#include "ephy-stock-icons.h"
diff --git a/src/bookmarks/ephy-related-action.c b/src/bookmarks/ephy-related-action.c
deleted file mode 100644
index 13e6aa0ad..000000000
--- a/src/bookmarks/ephy-related-action.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright © 2005 Peter Harvey
- *
- * 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-
-#include "ephy-related-action.h"
-
-#include "ephy-window.h"
-#include "ephy-bookmarks.h"
-#include "ephy-shell.h"
-#include "ephy-node-common.h"
-#include "ephy-stock-icons.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-static void
-node_changed (EphyNode *node,
- guint propertyid,
- EphyTopicAction *action)
-{
- ephy_topic_action_updated (action);
-}
-
-static void
-node_destroyed (EphyNode *node,
- EphyTopicAction *action)
-{
- EphyBookmarks *eb;
- EphyNode *favorites;
-
- eb = ephy_shell_get_bookmarks (ephy_shell_get_default ());
- favorites = ephy_bookmarks_get_favorites (eb);
-
- ephy_topic_action_set_topic (action, favorites);
-}
-
-static EphyEmbed *
-open_link (EphyLink *link,
- const char *address,
- EphyEmbed *embed,
- EphyLinkFlags flags)
-{
- EphyBookmarks *eb;
- EphyNode *bookmark;
- EphyNode *topic, *chosen = NULL;
- GPtrArray *topics;
- gint i, tmp, best = 0;
-
- eb = ephy_shell_get_bookmarks (ephy_shell_get_default ());
- bookmark = ephy_bookmarks_find_bookmark (eb, address);
- if (bookmark == NULL) return NULL;
-
- topic = ephy_topic_action_get_topic (EPHY_TOPIC_ACTION (link));
- tmp = ephy_node_get_property_int (topic, EPHY_NODE_KEYWORD_PROP_PRIORITY);
- if (tmp == EPHY_NODE_NORMAL_PRIORITY &&
- ephy_node_has_child (topic, bookmark))
- {
- return NULL;
- }
- ephy_node_signal_disconnect_object (topic, EPHY_NODE_CHANGED,
- (EphyNodeCallback) node_changed,
- G_OBJECT (link));
- ephy_node_signal_disconnect_object (topic, EPHY_NODE_DESTROY,
- (EphyNodeCallback) node_destroyed,
- G_OBJECT (link));
-
- topics = ephy_node_get_children (ephy_bookmarks_get_keywords (eb));
- for (i = 0; i < topics->len; i++)
- {
- topic = g_ptr_array_index (topics, i);
- tmp = ephy_node_get_property_int (topic, EPHY_NODE_KEYWORD_PROP_PRIORITY);
- if (tmp == EPHY_NODE_NORMAL_PRIORITY &&
- ephy_node_has_child (topic, bookmark))
- {
- tmp = ephy_node_get_n_children (topic);
- if (chosen == NULL ||
- (tmp >= 10 && tmp <= best))
- {
- chosen = topic;
- best = tmp;
- }
- }
- }
-
- if (chosen == NULL) chosen = ephy_bookmarks_get_favorites (eb);
-
- ephy_topic_action_set_topic (EPHY_TOPIC_ACTION (link), chosen);
- ephy_node_signal_connect_object (chosen, EPHY_NODE_CHANGED,
- (EphyNodeCallback) node_changed,
- G_OBJECT (link));
- ephy_node_signal_connect_object (chosen, EPHY_NODE_DESTROY,
- (EphyNodeCallback) node_destroyed,
- G_OBJECT (link));
-
- return NULL;
-}
-
-static void
-iface_init (EphyLinkIface *iface)
-{
- iface->open_link = open_link;
-}
-
-static void
-ephy_related_action_class_init (EphyRelatedActionClass *klass)
-{
- /* Empty, needed for G_DEFINE_TYPE macro */
-}
-
-static void
-ephy_related_action_init (EphyRelatedAction *action)
-{
- /* Empty, needed for G_DEFINE_TYPE macro */
-}
-
-G_DEFINE_TYPE_WITH_CODE (EphyRelatedAction, ephy_related_action, EPHY_TYPE_TOPIC_ACTION,
- G_IMPLEMENT_INTERFACE (EPHY_TYPE_LINK,
- iface_init))
-
-GtkAction *
-ephy_related_action_new (EphyLink *link,
- GtkUIManager *manager,
- char * name)
-{
- EphyBookmarks *eb;
- EphyNode *favorites;
- EphyRelatedAction *action;
-
- eb = ephy_shell_get_bookmarks (ephy_shell);
- favorites = ephy_bookmarks_get_favorites (eb);
-
- action = (EphyRelatedAction *) (g_object_new (EPHY_TYPE_RELATED_ACTION,
- "name", name,
- "topic", favorites,
- "short_label", _("Related"),
- "stock-id", GTK_STOCK_INDEX,
- "manager", manager,
- NULL));
-
- g_signal_connect_object (link, "open-link",
- G_CALLBACK (ephy_link_open), action,
- G_CONNECT_SWAPPED);
-
- return (GtkAction *) action;
-}
diff --git a/src/bookmarks/ephy-related-action.h b/src/bookmarks/ephy-related-action.h
deleted file mode 100644
index 46a95c7bd..000000000
--- a/src/bookmarks/ephy-related-action.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright © 2003, 2004 Marco Pesenti Gritti
- * Copyright © 2003, 2004 Christian Persch
- *
- * 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#if !defined (__EPHY_EPIPHANY_H_INSIDE__) && !defined (EPIPHANY_COMPILATION)
-#error "Only <epiphany/epiphany.h> can be included directly."
-#endif
-
-#ifndef EPHY_RELATED_ACTION_H
-#define EPHY_RELATED_ACTION_H
-
-#include "ephy-link.h"
-#include "ephy-topic-action.h"
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-#define EPHY_TYPE_RELATED_ACTION (ephy_related_action_get_type ())
-#define EPHY_RELATED_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_RELATED_ACTION, EphyRelatedAction))
-#define EPHY_RELATED_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EPHY_TYPE_RELATED_ACTION, EphyRelatedActionClass))
-#define EPHY_IS_RELATED_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPHY_TYPE_RELATED_ACTION))
-#define EPHY_IS_RELATED_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EPHY_TYPE_RELATED_ACTION))
-#define EPHY_RELATED_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), EPHY_TYPE_RELATED_ACTION, EphyRelatedActionClass))
-
-typedef struct _EphyRelatedAction EphyRelatedAction;
-typedef struct _EphyRelatedActionClass EphyRelatedActionClass;
-
-struct _EphyRelatedAction
-{
- EphyTopicAction parent_instance;
-};
-
-struct _EphyRelatedActionClass
-{
- EphyTopicActionClass parent_class;
-};
-
-GType ephy_related_action_get_type (void);
-
-GtkAction * ephy_related_action_new (EphyLink *link, GtkUIManager *manager, char *name);
-
-G_END_DECLS
-
-#endif