Commit Graph

27 Commits

Author SHA1 Message Date
Matthias Clasen
1e6171a4a7 Read bookmarks async
Do not block the main thread while reading the bookmarks file.
This speeds up initial setup of a GtkPlacesSidebar.
2020-02-05 01:01:47 -05:00
Timm Bäder
ce72154913 Rename gtkbookmarkmanager.h to gtkbookmarksmanagerprivate.h
It's a private type, so gets a private header file name.
2019-09-11 08:12:31 +02:00
Timm Bäder
ed11f2a9e4 bookmarksmanager: Stop exporting get_xdg_type 2019-09-11 08:12:31 +02:00
Bastien Nocera
cc951ac6c8 gtkbookmarksmanager: Use GTK+ 3.0's bookmarks file
There's no reason to use a separate file until the format of the file
changes though, as this just means that GTK+ 3.x and GTK+ 4.x
applications would end up showing different bookmarks in the file
chooser.

https://bugzilla.gnome.org/show_bug.cgi?id=793425
2018-02-15 20:42:21 +01:00
Emmanuele Bassi
888dfe499d Drop the Big GDK Lock
GDK has a lock to mark critical sections inside the backends.
Additionally, code that would re-enter into the GTK main loop was
supposed to hold the lock.

Back in the Good Old Days™ this was guaranteed to kind of work only on
the X11 backend, and would cause a neat explosion on any other GDK
backend.

During GTK+ 3.x we deprecated the API to enter and leave the critical
sections, and now we can remove all the internal uses of the lock, since
external API that uses GTK+ 4.x won't be able to hold the GDK lock.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:07:10 +01:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Rico Tzschichholz
8abf05e194 gtk: Update path references from gtk-3.0 to gtk-4.0 2016-10-23 20:22:38 +02:00
Emmanuele Bassi
eec10b703f Fix the licensing blurb of GtkBookmarksManager
Copy-pasta from GPL instead of LGPL.

Also, there is no GNU Lesser General Public License version 2; either
it's the GNU Library General Public License version 2, or it's the GNU
Lesser General Public License version 2.1.
2015-11-19 12:52:46 +00:00
Carlos Soriano
6e83c3b92e gtkbookmarksmanager: don't allow non valid utf8 in bookmarks
In case some client send to us a non valid utf8 string, don't screw up
the bookmarks file and just return.

https://bugzilla.gnome.org/show_bug.cgi?id=755215
2015-09-25 16:10:32 +02:00
Matthias Clasen
9f24b54786 Code cleanup
Use g_slist_free_full more consistently. This commit just converts
the obvious cases where g_slist_forall is directly followed by
g_slist_free.
2015-07-31 22:23:35 -04:00
Matthias Clasen
cc8ee01ff6 Avoid a redundant strlen
The GString knows perfectly well how long it is.  Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=731158
2014-06-28 01:51:24 -04:00
Andika Triwidada
0a768d274d Changed obsolete FSF portal addresses to web address
Fixed https://bugzilla.gnome.org/show_bug.cgi?id=721530
2014-01-12 19:56:49 +07:00
Timothy Arceri
44cd166447 GtkBookmarksManager: Refactor duplicate set error code and localise error strings
https://bugzilla.gnome.org/show_bug.cgi?id=593079
2013-05-30 10:37:58 -05:00
Chun-wei Fan
da31982379 Fix build on C89 compilers
-Avoid defining variables in the middle of the block
-Include fallback-c89.c in gtkrevealer.c in place of math.h as
 fallback-c89.c includes math.h itself, and is needed for round()
2013-05-28 13:36:54 +08:00
Colin Walters
33f6730249 GtkBookmarksManager: Only save if we have data to save
Otherwise we write an empty file, which is lame.
2013-05-09 16:48:38 -04:00
Colin Walters
4f01c0b159 GtkBookmarksManager: Ensure parent directory exists when saving
Otherwise we fail when the user doesn't have ~/.config yet.
2013-05-09 16:48:03 -04:00
Cosimo Cecchi
f59a618db9 Apply custom names to XDG dirs if possible
And make it possible to rename them
2013-01-21 17:49:01 -05:00
Cosimo Cecchi
35a56ba987 Add API to GtkBookmarksManager for built-in bookmarks
I.e. those that are added automatically from XDG dirs.
2013-01-21 17:32:02 -05:00
Cosimo Cecchi
aafd97be83 Mark a function as static 2013-01-21 17:12:48 -05:00
Federico Mena Quintero
eecda25d64 Allow not setting a changed callback on GtkBookmarksManager 2012-12-05 18:03:54 -06:00
Federico Mena Quintero
d02f884d22 Oops, reorder the bookmarks list correctly
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-10-20 14:09:34 -05:00
Federico Mena Quintero
6ed2217eda Implement bookmark reordering, at least the core
The drag-and-drop part is missing; that still needs de-nautilus-ifying.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-09-11 15:17:03 -05:00
Federico Mena Quintero
8b1eb6db99 Factor out code to find a bookmark in the list of bookmarks
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-09-11 15:02:01 -05:00
Federico Mena Quintero
86c784e277 Fix compilation 2012-09-03 21:30:23 -05:00
Federico Mena Quintero
b8b6d592e6 Cancel and disconnect from the bookmarks monitor when done
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-09-03 20:52:40 -05:00
Federico Mena Quintero
36969380b3 Read the legacy bookmarks file
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-09-03 20:52:27 -05:00
Federico Mena Quintero
d0196e99e1 Split out a GtkBookmarksManager from gtkfilesystem.[ch]
We had the bookmarks machinery in GtkFileSystem for historical reasons.
Now, we'll keep this separately.  This will allow us to make the
bookmarks machinery public if needed in the future.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>

Conflicts:
	gtk/Makefile.am
2012-09-03 20:42:04 -05:00