* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
return result;
}
+
+GSettings *
+_gtk_file_chooser_get_settings_for_widget (GtkWidget *widget)
+{
+ static GQuark file_chooser_settings_quark = 0;
+ GtkSettings *gtksettings;
+ GSettings *settings;
+
+ if (G_UNLIKELY (file_chooser_settings_quark == 0))
+ file_chooser_settings_quark = g_quark_from_static_string ("-gtk-file-chooser-settings");
+
+ gtksettings = gtk_widget_get_settings (widget);
+ settings = g_object_get_qdata (G_OBJECT (gtksettings), file_chooser_settings_quark);
+
+ if (G_UNLIKELY (settings == NULL))
+ {
+ settings = g_settings_new ("org.gtk.Settings.FileChooser");
+ g_settings_delay (settings);
+
+ g_object_set_qdata_full (G_OBJECT (gtksettings),
+ file_chooser_settings_quark,
+ settings,
+ g_object_unref);
+ }
+
+ return settings;
+}