Codebase list xapp / 479b96e
xapp-gtk3-module.c: Don't initialize favorites until they're needed. Since this will run for all gtk3 apps, it should be inactive until a file chooser is actually created. Clean up a couple things also. Michael Webster 3 years ago
1 changed file(s) with 4 addition(s) and 26 deletion(s). Raw diff Collapse all Expand all
0 /*-*- Mode: C; c-basic-offset: 8 -*-*/
1
2 /***
3 This file is part of libcanberra.
4
5 Copyright 2008 Lennart Poettering
6
7 libcanberra is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation, either version 2.1 of the
10 License, or (at your option) any later version.
11
12 libcanberra is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with libcanberra. If not, see
19 <http://www.gnu.org/licenses/>.
20 ***/
21
220 #include <config.h>
231 #include <gtk/gtk.h>
242
6644
6745 if (!already_applied)
6846 {
47 xapp_favorites_get_default ();
6948 gtk_file_chooser_add_shortcut_folder_uri (chooser, "favorites:///", NULL);
7049 }
7150
8665 g_type_class_unref (type_class);
8766 }
8867
89 G_MODULE_EXPORT void gtk_module_init(gint *argc, gchar ***argv[]) {
90 xapp_favorites_get_default ();
68 G_MODULE_EXPORT void gtk_module_init (gint *argc, gchar ***argv[]) {
9169 add_chooser_hook (GTK_TYPE_FILE_CHOOSER_WIDGET);
9270 add_chooser_hook (GTK_TYPE_FILE_CHOOSER_DIALOG);
9371 add_chooser_hook (GTK_TYPE_FILE_CHOOSER_BUTTON);
9472 }
9573
96 G_MODULE_EXPORT gchar* g_module_check_init(GModule *module);
74 G_MODULE_EXPORT gchar* g_module_check_init (GModule *module);
9775
98 G_MODULE_EXPORT gchar* g_module_check_init(GModule *module) {
76 G_MODULE_EXPORT gchar* g_module_check_init (GModule *module) {
9977 g_module_make_resident(module);
10078 return NULL;
10179 }