func NewMediaMount() *MediaMount { if !dutils.IsGSchemaExist(mediaSchema) { return nil } media := &MediaMount{} media.settings = gio.NewSettings(mediaSchema) media.AutoMountOpen = property.NewGSettingsBoolProperty( media, "AutoMountOpen", media.settings, MEDIA_KEY_AUTOMOUNT) media.listenGSettings() return media }
func newGsettings(schema string, check bool) *gio.Settings { if check { if !dutils.IsGSchemaExist(schema) { return nil } } s := gio.NewSettings(schema) locker.Lock() schemaGSettingsMap[schema] = s gsettingsCountMap[s]++ locker.Unlock() return s }