Deprecate GtkRecenManager::limit property
The :limit property of GtkRecentManager does not serve any useful purpose: the length of the list should be managed by the view (implementing GtkRecentChooser), and not by the model (the recent manager). https://bugzilla.gnome.org/show_bug.cgi?id=624333
This commit is contained in:
@ -222,6 +222,11 @@ gtk_recent_manager_class_init (GtkRecentManagerClass *klass)
|
|||||||
* gtk_recent_manager_get_items() function.
|
* gtk_recent_manager_get_items() function.
|
||||||
*
|
*
|
||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
|
*
|
||||||
|
* Deprecated: 2.22: Setting this property does not have any effect.
|
||||||
|
* #GtkRecenManager:limit property is deprecated. The length of
|
||||||
|
* the list should be managed by the view (implementing
|
||||||
|
* #GtkRecentChooser), and not by the model (the #GtkRecentManager).
|
||||||
*/
|
*/
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_LIMIT,
|
PROP_LIMIT,
|
||||||
@ -231,7 +236,7 @@ gtk_recent_manager_class_init (GtkRecentManagerClass *klass)
|
|||||||
-1,
|
-1,
|
||||||
G_MAXINT,
|
G_MAXINT,
|
||||||
DEFAULT_LIMIT,
|
DEFAULT_LIMIT,
|
||||||
G_PARAM_READWRITE));
|
G_PARAM_READWRITE | G_PARAM_DEPRECATED));
|
||||||
/**
|
/**
|
||||||
* GtkRecentManager:size
|
* GtkRecentManager:size
|
||||||
*
|
*
|
||||||
@ -702,6 +707,10 @@ gtk_recent_manager_set_screen (GtkRecentManager *manager,
|
|||||||
* items.
|
* items.
|
||||||
*
|
*
|
||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
|
*
|
||||||
|
* Deprecated: 2.22: #GtkRecenManager:limit property is deprecated. The
|
||||||
|
* length of the list should be managed by the view (implementing
|
||||||
|
* #GtkRecentChooser), and not by the model (the #GtkRecentManager).
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gtk_recent_manager_set_limit (GtkRecentManager *manager,
|
gtk_recent_manager_set_limit (GtkRecentManager *manager,
|
||||||
@ -725,6 +734,10 @@ gtk_recent_manager_set_limit (GtkRecentManager *manager,
|
|||||||
* Return value: the number of items to return, or -1 for every item.
|
* Return value: the number of items to return, or -1 for every item.
|
||||||
*
|
*
|
||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
|
*
|
||||||
|
* Deprecated: 2.22: #GtkRecenManager:limit property is deprecated. The
|
||||||
|
* length of the list should be managed by the view (implementing
|
||||||
|
* #GtkRecentChooser), and not by the model (the #GtkRecentManager).
|
||||||
*/
|
*/
|
||||||
gint
|
gint
|
||||||
gtk_recent_manager_get_limit (GtkRecentManager *manager)
|
gtk_recent_manager_get_limit (GtkRecentManager *manager)
|
||||||
@ -1294,17 +1307,11 @@ gtk_recent_manager_get_items (GtkRecentManager *manager)
|
|||||||
if (!priv->recent_items)
|
if (!priv->recent_items)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (priv->limit == 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
uris = g_bookmark_file_get_uris (priv->recent_items, &uris_len);
|
uris = g_bookmark_file_get_uris (priv->recent_items, &uris_len);
|
||||||
for (i = 0; i < uris_len; i++)
|
for (i = 0; i < uris_len; i++)
|
||||||
{
|
{
|
||||||
GtkRecentInfo *info;
|
GtkRecentInfo *info;
|
||||||
|
|
||||||
if (priv->limit != -1 && i == priv->limit)
|
|
||||||
break;
|
|
||||||
|
|
||||||
info = gtk_recent_info_new (uris[i]);
|
info = gtk_recent_info_new (uris[i]);
|
||||||
build_recent_info (priv->recent_items, info);
|
build_recent_info (priv->recent_items, info);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user