[vlc-commits] commit: Cleanup private and volatile option ( Rémi Denis-Courmont )
git at videolan.org
git at videolan.org
Tue Mar 30 13:39:59 CEST 2010
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Mar 30 14:28:02 2010 +0300| [0b21fc27fa9fb36723d4d4fbfbb5a5e43c35c141] | committer: Rémi Denis-Courmont
Cleanup private and volatile option
Volatile/unsaveable options are now always internal implicitly.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0b21fc27fa9fb36723d4d4fbfbb5a5e43c35c141
---
include/vlc_plugin.h | 11 +++++---
modules/access/cdda.c | 6 ++--
modules/gui/qt4/qt4.cpp | 2 +-
modules/gui/skins2/src/skin_main.cpp | 2 +-
modules/video_output/xcb/window.c | 2 +-
src/libvlc-module.c | 42 +++++++++++----------------------
src/modules/modules.c | 1 -
7 files changed, 27 insertions(+), 39 deletions(-)
diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h
index dd881a3..988a18a 100644
--- a/include/vlc_plugin.h
+++ b/include/vlc_plugin.h
@@ -417,16 +417,19 @@ enum vlc_module_properties
vlc_config_set (p_config, VLC_CONFIG_ADD_ACTION, \
(vlc_callback_t)(pf_action), (const char *)(text));
-#define change_internal() \
- vlc_config_set (p_config, VLC_CONFIG_PRIVATE);
-
#define change_need_restart() \
vlc_config_set (p_config, VLC_CONFIG_RESTART);
#define change_autosave() \
vlc_config_set (p_config, VLC_CONFIG_PERSISTENT);
-#define change_unsaveable() \
+/* For options that are saved but hidden from the preferences panel */
+#define change_private() \
+ vlc_config_set (p_config, VLC_CONFIG_PRIVATE);
+
+/* For options that cannot be saved in the configuration */
+#define change_volatile() \
+ change_private() \
vlc_config_set (p_config, VLC_CONFIG_VOLATILE);
#define change_safe() \
diff --git a/modules/access/cdda.c b/modules/access/cdda.c
index f680740..07da568 100644
--- a/modules/access/cdda.c
+++ b/modules/access/cdda.c
@@ -77,11 +77,11 @@ vlc_module_begin ()
change_safe()
add_integer( "cdda-track", 0 , NULL, NULL, NULL, true )
- change_internal ()
+ change_volatile ()
add_integer( "cdda-first-sector", -1, NULL, NULL, NULL, true )
- change_internal ()
+ change_volatile ()
add_integer( "cdda-last-sector", -1, NULL, NULL, NULL, true )
- change_internal ()
+ change_volatile ()
#ifdef HAVE_LIBCDDB
add_string( "cddb-server", "freedb.freedb.org", NULL, N_( "CDDB Server" ),
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index fa39760..4be129b 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -226,7 +226,7 @@ vlc_module_begin ()
add_bool( "qt-privacy-ask", true, NULL, PRIVACY_TEXT, PRIVACY_TEXT,
false )
- change_internal ()
+ change_private ()
add_integer( "qt-fullscreen-screennumber", -1, NULL, FULLSCREEN_NUMBER_TEXT,
FULLSCREEN_NUMBER_LONGTEXT, false );
diff --git a/modules/gui/skins2/src/skin_main.cpp b/modules/gui/skins2/src/skin_main.cpp
index c51ac49..4d9ea1c 100644
--- a/modules/gui/skins2/src/skin_main.cpp
+++ b/modules/gui/skins2/src/skin_main.cpp
@@ -561,7 +561,7 @@ vlc_module_begin ()
add_string( "skins2-config", "", NULL, SKINS2_CONFIG, SKINS2_CONFIG_LONG,
true )
change_autosave ()
- change_internal ()
+ change_private ()
#ifdef WIN32
add_bool( "skins2-systray", false, onSystrayChange, SKINS2_SYSTRAY,
SKINS2_SYSTRAY_LONG, false );
diff --git a/modules/video_output/xcb/window.c b/modules/video_output/xcb/window.c
index 487e045..9d79df0 100644
--- a/modules/video_output/xcb/window.c
+++ b/modules/video_output/xcb/window.c
@@ -76,7 +76,7 @@ vlc_module_begin ()
set_callbacks (EmOpen, EmClose)
add_integer ("drawable-xid", 0, NULL, XID_TEXT, XID_LONGTEXT, true)
- change_unsaveable ()
+ change_volatile ()
vlc_module_end ()
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 21d70a7..b138456 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -2077,8 +2077,7 @@ vlc_module_begin ()
ONEINSTANCE_LONGTEXT, true )
add_bool( "started-from-file", 0, NULL, STARTEDFROMFILE_TEXT,
STARTEDFROMFILE_LONGTEXT, true )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_bool( "one-instance-when-started-from-file", 1, NULL,
ONEINSTANCEWHENSTARTEDFROMFILE_TEXT,
ONEINSTANCEWHENSTARTEDFROMFILE_LONGTEXT, true )
@@ -2746,51 +2745,38 @@ vlc_module_begin ()
add_bool( "help", false, NULL, HELP_TEXT, "", false )
change_short( 'h' )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_bool( "full-help", false, NULL, FULL_HELP_TEXT, "", false )
change_short( 'H' )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_bool( "longhelp", false, NULL, LONGHELP_TEXT, "", false )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_bool( "help-verbose", false, NULL, HELP_VERBOSE_TEXT, "",
false )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_bool( "list", false, NULL, LIST_TEXT, "", false )
change_short( 'l' )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_bool( "list-verbose", false, NULL, LIST_VERBOSE_TEXT, "",
false )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_string( "module", NULL, NULL, MODULE_TEXT, "", false )
change_short( 'p' )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_bool( "ignore-config", true, NULL, IGNORE_CONFIG_TEXT, "", false )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_obsolete_bool( "save-config" )
add_bool( "reset-config", false, NULL, RESET_CONFIG_TEXT, "", false )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_bool( "reset-plugins-cache", false, NULL,
RESET_PLUGINS_CACHE_TEXT, "", false )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_bool( "version", false, NULL, VERSION_TEXT, "", false )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_string( "config", NULL, NULL, CONFIG_TEXT, "", false )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
add_bool( "version", false, NULL, VERSION_TEXT, "", false )
- change_internal ()
- change_unsaveable ()
+ change_volatile ()
/* Usage (mainly useful for cmd line stuff) */
/* add_usage_hint( PLAYLIST_USAGE ) */
diff --git a/src/modules/modules.c b/src/modules/modules.c
index 6c6465a..e492952 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -730,7 +730,6 @@ module_config_t *module_config_get( const module_t *module, unsigned *restrict p
{
const module_config_t *item = module->p_config + i;
if( item->b_internal /* internal option */
- || item->b_unsaveable /* non-modifiable option */
|| item->b_removed /* removed option */ )
continue;
More information about the vlc-commits
mailing list