Codebase list xapp / c3b9554
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
3 changed file(s) with 15 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
14901490 void
14911491 init_favorite_vfs (void)
14921492 {
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 }
774774 {
775775 if (global_favorites == NULL)
776776 {
777 init_favorite_vfs ();
777778 global_favorites = g_object_new (XAPP_TYPE_FAVORITES, NULL);
778779 }
779780
4545
4646 if (!already_applied)
4747 {
48 xapp_favorites_get_default ();
4948 gtk_file_chooser_add_shortcut_folder_uri (chooser, "favorites:///", NULL);
5049 }
5150