favorites: Make sure initializing favorites also initializes the uri
scheme.
Either path to favorites should initialize the other:
- If the uri is accessed, this will initialize favorites via the
FavoriteVfsFile.
- If the api is used, the file system is initialized when XAppFavorites
is.
Michael Webster
3 years ago
1490 | 1490 | void |
1491 | 1491 | init_favorite_vfs (void) |
1492 | 1492 | { |
1493 | GVfs *vfs; | |
1494 | vfs = g_vfs_get_default (); | |
1495 | ||
1496 | g_vfs_register_uri_scheme (vfs, "favorites", | |
1497 | favorite_vfs_lookup, NULL, NULL, | |
1498 | favorite_vfs_lookup, NULL, NULL); | |
1499 | } | |
1500 | ||
1493 | static gsize once_init_value = 0; | |
1494 | ||
1495 | if (g_once_init_enter (&once_init_value)) | |
1496 | { | |
1497 | GVfs *vfs; | |
1498 | vfs = g_vfs_get_default (); | |
1499 | ||
1500 | g_vfs_register_uri_scheme (vfs, "favorites", | |
1501 | favorite_vfs_lookup, NULL, NULL, | |
1502 | favorite_vfs_lookup, NULL, NULL); | |
1503 | ||
1504 | g_once_init_leave (&once_init_value, 1); | |
1505 | } | |
1506 | } |