Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
b8802c32
Commit
b8802c32
authored
Apr 15, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Category and subcategory items are also integers. Fix #1086
parent
443738ce
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
35 deletions
+43
-35
include/vlc_configuration.h
include/vlc_configuration.h
+0
-28
modules/gui/qt4/components/complete_preferences.cpp
modules/gui/qt4/components/complete_preferences.cpp
+9
-7
src/modules/configuration.c
src/modules/configuration.c
+32
-0
src/modules/configuration.h
src/modules/configuration.h
+2
-0
No files found.
include/vlc_configuration.h
View file @
b8802c32
...
@@ -69,34 +69,6 @@ extern "C" {
...
@@ -69,34 +69,6 @@ extern "C" {
#define CONFIG_ITEM 0x00F0
#define CONFIG_ITEM 0x00F0
/* Item types that use a string value (i.e. serialized in the module cache) */
#define CONFIG_STRING_TYPES \
{ \
CONFIG_ITEM_STRING, CONFIG_ITEM_FILE, CONFIG_ITEM_MODULE, \
CONFIG_ITEM_DIRECTORY, CONFIG_ITEM_MODULE_CAT, \
CONFIG_ITEM_MODULE_LIST, CONFIG_ITEM_MODULE_LIST_CAT \
}
static
inline
int
IsConfigStringType
(
int
type
)
{
const
unsigned
char
config_string_types
[]
=
CONFIG_STRING_TYPES
;
/* NOTE: this needs to be changed if we ever get more than 255 types */
return
memchr
(
config_string_types
,
type
,
sizeof
(
config_string_types
))
!=
NULL
;
}
static
inline
int
IsConfigIntegerType
(
int
type
)
{
return
(
type
==
CONFIG_ITEM_INTEGER
)
||
(
type
==
CONFIG_ITEM_KEY
)
||
(
type
==
CONFIG_ITEM_BOOL
);
}
static
inline
int
IsConfigFloatType
(
int
type
)
{
return
type
==
CONFIG_ITEM_FLOAT
;
}
/*******************************************************************
/*******************************************************************
* All predefined categories and subcategories
* All predefined categories and subcategories
*******************************************************************/
*******************************************************************/
...
...
modules/gui/qt4/components/complete_preferences.cpp
View file @
b8802c32
...
@@ -188,31 +188,33 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
...
@@ -188,31 +188,33 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
/* Build the tree of plugins */
/* Build the tree of plugins */
for
(
int
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
for
(
int
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
{
{
int
i_subcategory
=
-
1
,
i_category
=
-
1
,
i_options
=
0
;
p_module
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
p_module
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
// Main module excluded
// Main module excluded
if
(
!
strcmp
(
p_module
->
psz_object_name
,
"main"
)
)
continue
;
if
(
!
strcmp
(
p_module
->
psz_object_name
,
"main"
)
)
continue
;
/* Exclude empty plugins (submodules don't have config options, they
/* Exclude submodules; they have no config options of their own */
* are stored in the parent module) */
if
(
p_module
->
b_submodule
)
continue
;
if
(
p_module
->
b_submodule
)
continue
;
unsigned
i_subcategory
=
0
,
i_category
=
0
;
bool
b_options
=
false
;
for
(
size_t
i
=
0
;
i
<
p_module
->
confsize
;
i
++
)
for
(
size_t
i
=
0
;
i
<
p_module
->
confsize
;
i
++
)
{
{
module_config_t
*
p_item
=
p_module
->
p_config
+
i
;
const
module_config_t
*
p_item
=
p_module
->
p_config
+
i
;
if
(
p_item
->
i_type
==
CONFIG_CATEGORY
)
if
(
p_item
->
i_type
==
CONFIG_CATEGORY
)
i_category
=
p_item
->
value
.
i
;
i_category
=
p_item
->
value
.
i
;
else
if
(
p_item
->
i_type
==
CONFIG_SUBCATEGORY
)
else
if
(
p_item
->
i_type
==
CONFIG_SUBCATEGORY
)
i_subcategory
=
p_item
->
value
.
i
;
i_subcategory
=
p_item
->
value
.
i
;
if
(
p_item
->
i_type
&
CONFIG_ITEM
)
if
(
p_item
->
i_type
&
CONFIG_ITEM
)
i_options
++
;
b_options
=
true
;
if
(
i_options
>
0
&&
i_category
>=
0
&&
i_subcategory
>=
0
)
if
(
b_options
&&
i_category
&&
i_subcategory
)
break
;
break
;
}
}
if
(
!
i_options
)
continue
;
// Nothing to display
if
(
!
b_options
||
i_category
==
0
||
i_subcategory
==
0
)
continue
;
// Locate the category item;
// Locate the category item;
QTreeWidgetItem
*
subcat_item
=
NULL
;
QTreeWidgetItem
*
subcat_item
=
NULL
;
...
...
src/modules/configuration.c
View file @
b8802c32
...
@@ -89,6 +89,38 @@ static inline char *_strdupnull (const char *src)
...
@@ -89,6 +89,38 @@ static inline char *_strdupnull (const char *src)
return
strdup
(
_
(
src
));
return
strdup
(
_
(
src
));
}
}
/* Item types that use a string value (i.e. serialized in the module cache) */
int
IsConfigStringType
(
int
type
)
{
static
const
unsigned
char
config_types
[]
=
{
CONFIG_ITEM_STRING
,
CONFIG_ITEM_FILE
,
CONFIG_ITEM_MODULE
,
CONFIG_ITEM_DIRECTORY
,
CONFIG_ITEM_MODULE_CAT
,
CONFIG_ITEM_MODULE_LIST
,
CONFIG_ITEM_MODULE_LIST_CAT
};
/* NOTE: this needs to be changed if we ever get more than 255 types */
return
memchr
(
config_types
,
type
,
sizeof
(
config_types
))
!=
NULL
;
}
static
int
IsConfigIntegerType
(
int
type
)
{
static
const
unsigned
char
config_types
[]
=
{
CONFIG_ITEM_INTEGER
,
CONFIG_ITEM_KEY
,
CONFIG_ITEM_BOOL
,
CONFIG_CATEGORY
,
CONFIG_SUBCATEGORY
};
return
memchr
(
config_types
,
type
,
sizeof
(
config_types
))
!=
NULL
;
}
static
inline
int
IsConfigFloatType
(
int
type
)
{
return
type
==
CONFIG_ITEM_FLOAT
;
}
/*****************************************************************************
/*****************************************************************************
* config_GetType: get the type of a variable (bool, int, float, string)
* config_GetType: get the type of a variable (bool, int, float, string)
...
...
src/modules/configuration.h
View file @
b8802c32
...
@@ -43,6 +43,8 @@ char * config_GetHomeDir ( void );
...
@@ -43,6 +43,8 @@ char * config_GetHomeDir ( void );
char
*
config_GetUserDir
(
void
);
char
*
config_GetUserDir
(
void
);
int
__config_LoadConfigFile
(
vlc_object_t
*
,
const
char
*
);
int
__config_LoadConfigFile
(
vlc_object_t
*
,
const
char
*
);
int
IsConfigStringType
(
int
type
);
# ifdef __cplusplus
# ifdef __cplusplus
}
}
# endif
# endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment