The recently-used.xbel storage for recently used files is located inside
the $XDG_DATA_HOME directory; there's no actual guarantee that the
directory has been created already, even though it's very highly
probable on any modern distribution. We should create it, along with its
intermediate parents, before constructing the file monitor that we use
to get change notifications.
https://bugzilla.gnome.org/show_bug.cgi?id=671817https://bugzilla.gnome.org/show_bug.cgi?id=667808
Also, *do* add the file to the recently-used list, even if the file does not
exist yet. This is used from the Save dialog, so even shitty apps which don't
add the file to GtkRecentManager, will get the file added from the Save dialog.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
Thanks to Kean Johnston for pointing this out.
There are a few places in GTK that use "struct stat",
and then g_stat(), rather than using GStatBuf.This breaks things on
Windows. Since the size of struct stat can vary depending on other
flags specified, this has the potential to cause overwrites and is
trivial to fix.
Based on patch submitted by Kean Johnston
Async callbacks are delivered in idles, so we need to make sure
we get the gdk lock before calling any gdk/gtk stuff. This was
missing in a few places.
Since the ::changed implementation of GtkRecentManager implies a
synchronous write operation, when we receive multiple requests to emit a
::changed signal we might end up blocking.
This change coalesces multiple ::changed emission requests using the
following sequence:
• the first request will install a timeout in 250 ms, which will
emit the ::changed signal
• each further request while the timeout has not been emitted
will increase a counter
‣ if the counter reaches 250 before the timeout has been
emitted, then the RecentManager will remove the timeout
source and force a signal emission and reset the counter
This sequence should guarantee that frequent ::changed emission requests
are coalesced, and also guarantee that we don't let them dangle for too
long.
https://bugzilla.gnome.org/show_bug.cgi?id=616997
The gtkprivate.h header contains GtkWidget-specific private symbols that
are not useful except in a handful of cases. Basically everything
includes gtkprivate.h for the GTK_PARAM_* macros.
https://bugzilla.gnome.org/show_bug.cgi?id=632539
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 was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API
https://bugzilla.gnome.org/show_bug.cgi?id=610474
The Gtk-custom.c file in gir-repository contained a number of
introspection annotations. Merge those into the GTK source files.
Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.
The documentation for the function says that the app_exec string
should be freed, but we return a pointer to the internal string
without duplicating it. Since the app_exec string is valid as long
as the GtkRecentInfo is valid the documentation should be fixed
and the out argument should be constified. Fixes#584832.
2008-08-07 Emmanuele Bassi <ebassi@gnome.org>
Bug 545031 – list of recently used files is created world-readable
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_real_changed): Set the recently-used.xbel
file to 0600. (Guido Berhoerster)
svn path=/trunk/; revision=21028
2008-07-21 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(recent_app_info_new), (recent_app_info_free): Use GSlice to
allocate the application data for recently used resources;
do not call time() to initialize the timestamp, as it will
be overwritten anyway later. (#535223, Michael Meeks)
svn path=/trunk/; revision=20884
2008-06-30 Cody Russell <bratsche@gnome.org>
* Practically everything changed.
Change all references of GIMP Toolkit (and variations of it)
to GTK+ Toolkit, showing no mercy at all to our beloved
ancestry. (#540529)
svn path=/trunk/; revision=20709
2008-06-17 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_remove_item),
(gtk_recent_manager_move_item): Increase the consistency of the
errors returned by GtkRecentManager. (Paolo Borelli)
svn path=/trunk/; revision=20424
2008-06-17 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_remove_item): Consistently use the same
error when removing a URI from an empty GtkRecentManager.
svn path=/trunk/; revision=20422
2008-05-31 Emmanuele Bassi <ebassi@gnome.org>
Bug 535830 – wrong content type adding an item
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_add_item_query_info): Use the correct API
for retrieving the fast MIME type of a URI. (Carlos Garcia
Campos)
svn path=/trunk/; revision=20262
2008-04-18 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_set_filename): Keep the default storage
file in $HOME, as we don't have a migration code in place yet.
svn path=/trunk/; revision=20020
2008-04-18 Michael Natterer <mitch@imendio.com>
* gtk/gtkrecentmanager.c (gtk_recent_manager_clamp_to_age):
g_strfreev() the uris returned by g_bookmark_file_get_uris().
svn path=/trunk/; revision=20019
2008-04-15 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_real_changed): Fix last commit, and
complete the gtk-recent-files-max-age semantics: if the
property is set to 0 then purge the list.
svn path=/trunk/; revision=20007
2008-04-15 Emmanuele Bassi <ebassi@gnome.org>
Bug 488507 – boundless growth of .recently-used.xbel file
slows down applications
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_init),
(gtk_recent_manager_real_changed),
(gtk_recent_manager_set_filename),
(gtk_recent_manager_clamp_to_age): Clamp the recently
used resources list by the age of its items, using
the newly added GtkSettings property.
* gtk/gtksettings.c (gtk_settings_class_init): Add the
gtk-recent-files-max-age property, controlling the
maximum age of the items in the recently used resources
list.
svn path=/trunk/; revision=20006
2008-04-15 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_add_item_query_info),
(gtk_recent_manager_add_item): Emit the ::changed signal
at the end of the asynchronous MIME type query.
svn path=/trunk/; revision=20005
2008-04-15 Emmanuele Bassi <ebassi@gnome.org>
Bug 487375 – gtkrecent apps poll ~/.recently-used.xbel
every 5 seconds
* gtk/gtkrecentmanager.c: Use GFileMonitor to check for
changes in the recently used resources storage file, and
drop the timeout-based poll.
* ChangeLog: Fix attribution of the patch of the previous
commit.
svn path=/trunk/; revision=20004
2008-04-15 Emmanuele Bassi <ebassi@gnome.org>
Bug 506062 – gtk_recent_manager_add_item does not detect mime
type on Windows
* configure.in: Depend on gio-2.0
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_add_item_query_info_cb),
(gtk_recent_manager_add_item): Use GIO to (asynchronously) query
the MIME type of the passed URI.
svn path=/trunk/; revision=20003