Hello community,
here is the log from the commit of package libslab for openSUSE:Factory
checked in at Fri Sep 4 00:38:27 CEST 2009.
--------
--- libslab/libslab.changes 2009-08-28 18:48:38.000000000 +0200
+++ libslab/libslab.changes 2009-08-30 12:41:08.000000000 +0200
@@ -1,0 +2,8 @@
+Sun Aug 30 12:39:02 CEST 2009 - vuntz@novell.com
+
+- Have devel package Provides/Obsoletes gnome-main-menu-devel since
+ the library has moved here.
+- Add libslab-bnc187879-clear-recent-files.patch to fix bnc#187879:
+ add the ability to clear the recent files.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
libslab-bnc187879-clear-recent-files.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libslab.spec ++++++
--- /var/tmp/diff_new_pack.Y7fDkQ/_old 2009-09-04 00:37:30.000000000 +0200
+++ /var/tmp/diff_new_pack.Y7fDkQ/_new 2009-09-04 00:37:30.000000000 +0200
@@ -19,11 +19,13 @@
Name: libslab
Version: 2.27.91
-Release: 1
+Release: 2
License: GPL v2 or later
Summary: Library to create tile-based UI for GNOME
Group: Development/Libraries/GNOME
Source0: %{name}-%{version}.tar.bz2
+# PATCH-FEATURE-UPSTREAM libslab-bnc187879-clear-recent-files.patch dliang@novell.com -- Add the ability to clear the recent-files, taken from git
+Patch0: libslab-bnc187879-clear-recent-files.patch
BuildRequires: gconf2-devel
BuildRequires: glib2-devel
BuildRequires: gnome-desktop-devel
@@ -62,6 +64,10 @@
Requires: gnome-desktop-devel
Requires: gnome-menus-devel
Requires: gtk2-devel
+Requires: librsvg-devel
+# The library used to live in gnome-main-menu
+Provides: gnome-main-menu-devel = 0.9.12
+Obsoletes: gnome-main-menu-devel <= 0.9.12
%description devel
This library makes it easy to create tile-based UI for GNOME, as seen in
@@ -70,6 +76,7 @@
%lang_package
%prep
%setup -q
+%patch0 -p1
%build
%configure --disable-static
++++++ libslab-bnc187879-clear-recent-files.patch ++++++
diff -Npur libslab-old/libslab/bookmark-agent.c libslab-new/libslab/bookmark-agent.c
--- libslab-old/libslab/bookmark-agent.c 2009-02-26 15:34:37.000000000 +0800
+++ libslab-new/libslab/bookmark-agent.c 2009-02-26 15:28:53.000000000 +0800
@@ -220,7 +220,7 @@ bookmark_agent_move_item (BookmarkAgent
}
void
-bookmark_agent_remove_item (BookmarkAgent *this, const gchar *uri)
+bookmark_agent_purge_items (BookmarkAgent *this)
{
BookmarkAgentPrivate *priv = PRIVATE (this);
@@ -229,11 +229,44 @@ bookmark_agent_remove_item (BookmarkAgen
GError *error = NULL;
gchar **uris = NULL;
- gint rank_i;
+ gsize uris_len;
gint i;
+ g_return_if_fail (priv->user_modifiable);
+
+ uris = g_bookmark_file_get_uris (priv->store, &uris_len);
+ if (TYPE_IS_RECENT (priv->type)) {
+ for (i = 0; i < uris_len; i++) {
+ gtk_recent_manager_remove_item (gtk_recent_manager_get_default (), uris [i], & error);
+
+ if (error)
+ libslab_handle_g_error (
+ & error, "%s: unable to remove [%s] from %s.",
+ G_STRFUNC, priv->store_path, uris [i]);
+ }
+ } else {
+ for (i = 0; i < uris_len; i++) {
+ g_bookmark_file_remove_item (priv->store, uris [i], NULL);
+ }
+ save_store (this);
+ }
+ g_strfreev (uris);
+}
+void
+bookmark_agent_remove_item (BookmarkAgent *this, const gchar *uri)
+{
+ BookmarkAgentPrivate *priv = PRIVATE (this);
- g_return_if_fail (priv->user_modifiable);
+ gint rank;
+
+ GError *error = NULL;
+
+ gchar **uris = NULL;
+ gint rank_i;
+ gint i;
+
+
+ g_return_if_fail (priv->user_modifiable);
if (! bookmark_agent_has_item (this, uri))
return;
diff -Npur libslab-old/libslab/bookmark-agent.h libslab-new/libslab/bookmark-agent.h
--- libslab-old/libslab/bookmark-agent.h 2009-02-26 15:34:37.000000000 +0800
+++ libslab-new/libslab/bookmark-agent.h 2009-02-26 15:30:24.000000000 +0800
@@ -80,7 +80,8 @@ void bookmark_agent_move_item
void bookmark_agent_remove_item (BookmarkAgent *this, const gchar *uri);
void bookmark_agent_reorder_items (BookmarkAgent *this, const gchar **uris);
-void bookmark_agent_update_from_bookmark_file (BookmarkAgent *this, GBookmarkFile *store);
+void bookmark_agent_update_from_bookmark_file (BookmarkAgent *this, GBookmarkFile *store);
+void bookmark_agent_purge_items (BookmarkAgent *this);
void bookmark_item_free (BookmarkItem *item);
diff -Npur libslab-old/libslab/document-tile.c libslab-new/libslab/document-tile.c
--- libslab-old/libslab/document-tile.c 2009-02-26 15:34:37.000000000 +0800
+++ libslab-new/libslab/document-tile.c 2009-02-26 15:31:13.000000000 +0800
@@ -55,6 +55,8 @@ static void open_with_default_trigger
static void open_in_file_manager_trigger (Tile *, TileEvent *, TileAction *);
static void rename_trigger (Tile *, TileEvent *, TileAction *);
static void move_to_trash_trigger (Tile *, TileEvent *, TileAction *);
+static void remove_recent_item (Tile *, TileEvent *, TileAction *);
+static void purge_recent_items (Tile *, TileEvent *, TileAction *);
static void delete_trigger (Tile *, TileEvent *, TileAction *);
static void user_docs_trigger (Tile *, TileEvent *, TileAction *);
static void send_to_trigger (Tile *, TileEvent *, TileAction *);
@@ -109,14 +111,14 @@ document_tile_new_force_icon (const gcha
DocumentTile *this;
DocumentTilePrivate *priv;
- this = (DocumentTile *) document_tile_new (in_uri, mime_type, modified);
+ this = (DocumentTile *) document_tile_new (BOOKMARK_STORE_USER_DOCS, in_uri, mime_type, modified);
priv = DOCUMENT_TILE_GET_PRIVATE (this);
priv->force_icon_name = g_strdup (icon);
return GTK_WIDGET (this);
}
GtkWidget *
-document_tile_new (const gchar *in_uri, const gchar *mime_type, time_t modified)
+document_tile_new (BookmarkStoreType bookmark_store_type, const gchar *in_uri, const gchar *mime_type, time_t modified)
{
DocumentTile *this;
DocumentTilePrivate *priv;
@@ -177,11 +179,11 @@ document_tile_new (const gchar *in_uri,
priv->mime_type = g_strdup (mime_type);
priv->modified = modified;
priv->header_bin = GTK_BIN (header);
+ priv->agent = bookmark_agent_get_instance (bookmark_store_type);
document_tile_private_setup (this);
-
- TILE (this)->actions = g_new0 (TileAction *, 7);
- TILE (this)->n_actions = 7;
+ TILE (this)->actions = g_new0 (TileAction *, DOCUMENT_TILE_ACTION_NUM_OF_ACTIONS);
+ TILE (this)->n_actions = DOCUMENT_TILE_ACTION_NUM_OF_ACTIONS;
menu_ctnr = GTK_CONTAINER (TILE (this)->context_menu);
@@ -293,6 +295,23 @@ document_tile_new (const gchar *in_uri,
gtk_container_add (menu_ctnr, menu_item);
}
+ if (!priv->is_bookmarked) {
+ /* clean item from menu */
+ action = tile_action_new (TILE (this), remove_recent_item, _("Remove from recent menu"), 0);
+ TILE (this)->actions[DOCUMENT_TILE_ACTION_CLEAN_ITEM] = action;
+
+ menu_item = GTK_WIDGET (tile_action_get_menu_item (action));
+ gtk_container_add (menu_ctnr, menu_item);
+
+ /* clean all the items from menu */
+
+ action = tile_action_new (TILE (this), purge_recent_items, _("Purge all the recent items"), 0);
+ TILE (this)->actions[DOCUMENT_TILE_ACTION_CLEAN_ALL] = action;
+
+ menu_item = GTK_WIDGET (tile_action_get_menu_item (action));
+ gtk_container_add (menu_ctnr, menu_item);
+ }
+
gtk_widget_show_all (GTK_WIDGET (TILE (this)->context_menu));
accessible = gtk_widget_get_accessible (GTK_WIDGET (this));
@@ -339,8 +358,6 @@ document_tile_private_setup (DocumentTil
g_object_unref (client);
- priv->agent = bookmark_agent_get_instance (BOOKMARK_STORE_USER_DOCS);
-
priv->notify_signal_id = g_signal_connect (
G_OBJECT (priv->agent), "notify", G_CALLBACK (agent_notify_cb), this);
}
@@ -708,7 +725,7 @@ update_user_list_menu_item (DocumentTile
if (! action)
return;
- priv->is_bookmarked = bookmark_agent_has_item (priv->agent, TILE (this)->uri);
+ priv->is_bookmarked = bookmark_agent_has_item (bookmark_agent_get_instance (BOOKMARK_STORE_USER_DOCS), TILE (this)->uri);
if (priv->is_bookmarked)
tile_action_set_menu_item_label (action, _("Remove from Favorites"));
@@ -936,6 +953,20 @@ rename_trigger (Tile *tile, TileEvent *e
}
static void
+remove_recent_item (Tile *tile, TileEvent *event, TileAction *action)
+{
+ DocumentTilePrivate *priv = DOCUMENT_TILE_GET_PRIVATE (tile);
+ bookmark_agent_remove_item (priv->agent, TILE (tile)->uri);
+}
+
+static void
+purge_recent_items (Tile *tile, TileEvent *event, TileAction *action)
+{
+ DocumentTilePrivate *priv = DOCUMENT_TILE_GET_PRIVATE (tile);
+ bookmark_agent_purge_items (priv->agent);
+}
+
+static void
move_to_trash_trigger (Tile *tile, TileEvent *event, TileAction *action)
{
DocumentTilePrivate *priv = DOCUMENT_TILE_GET_PRIVATE (tile);
diff -Npur libslab-old/libslab/document-tile.h libslab-new/libslab/document-tile.h
--- libslab-old/libslab/document-tile.h 2009-02-26 15:34:37.000000000 +0800
+++ libslab-new/libslab/document-tile.h 2009-02-26 15:31:09.000000000 +0800
@@ -24,6 +24,7 @@
#include