Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
58996b84
Commit
58996b84
authored
Jun 26, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config/Global: allow calling config_get_string() with one argument
default_value defaults to nullptr.
parent
df03a7b3
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
12 deletions
+9
-12
ConfigGlobal.hxx
src/config/ConfigGlobal.hxx
+1
-1
ConfigPath.cxx
src/config/ConfigPath.cxx
+1
-1
Config.cxx
src/fs/Config.cxx
+1
-3
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+2
-2
Configured.cxx
src/storage/Configured.cxx
+2
-2
TagConfig.cxx
src/tag/TagConfig.cxx
+1
-2
read_conf.cxx
test/read_conf.cxx
+1
-1
No files found.
src/config/ConfigGlobal.hxx
View file @
58996b84
...
...
@@ -73,7 +73,7 @@ config_find_block(ConfigBlockOption option, const char *key, const char *value);
gcc_pure
const
char
*
config_get_string
(
enum
ConfigOption
option
,
const
char
*
default_value
);
config_get_string
(
enum
ConfigOption
option
,
const
char
*
default_value
=
nullptr
);
/**
* Returns an optional configuration variable which contains an
...
...
src/config/ConfigPath.cxx
View file @
58996b84
...
...
@@ -70,7 +70,7 @@ GetHome(Error &error)
static
AllocatedPath
GetConfiguredHome
(
Error
&
error
)
{
const
char
*
user
=
config_get_string
(
ConfigOption
::
USER
,
nullptr
);
const
char
*
user
=
config_get_string
(
ConfigOption
::
USER
);
return
user
!=
nullptr
?
GetHome
(
user
,
error
)
:
GetHome
(
error
);
...
...
src/fs/Config.cxx
View file @
58996b84
...
...
@@ -26,9 +26,7 @@ bool
ConfigureFS
(
Error
&
error
)
{
#ifdef HAVE_FS_CHARSET
const
char
*
charset
=
nullptr
;
charset
=
config_get_string
(
ConfigOption
::
FS_CHARSET
,
nullptr
);
const
char
*
charset
=
config_get_string
(
ConfigOption
::
FS_CHARSET
);
return
charset
==
nullptr
||
SetFSCharset
(
charset
,
error
);
#else
(
void
)
error
;
...
...
src/input/plugins/CurlInputPlugin.cxx
View file @
58996b84
...
...
@@ -566,9 +566,9 @@ input_curl_init(const ConfigBlock &block, Error &error)
if
(
proxy
==
nullptr
)
{
/* deprecated proxy configuration */
proxy
=
config_get_string
(
ConfigOption
::
HTTP_PROXY_HOST
,
nullptr
);
proxy
=
config_get_string
(
ConfigOption
::
HTTP_PROXY_HOST
);
proxy_port
=
config_get_positive
(
ConfigOption
::
HTTP_PROXY_PORT
,
0
);
proxy_user
=
config_get_string
(
ConfigOption
::
HTTP_PROXY_USER
,
nullptr
);
proxy_user
=
config_get_string
(
ConfigOption
::
HTTP_PROXY_USER
);
proxy_password
=
config_get_string
(
ConfigOption
::
HTTP_PROXY_PASSWORD
,
""
);
}
...
...
src/storage/Configured.cxx
View file @
58996b84
...
...
@@ -68,7 +68,7 @@ CreateConfiguredStorage(EventLoop &event_loop, Error &error)
{
assert
(
!
error
.
IsDefined
());
auto
uri
=
config_get_string
(
ConfigOption
::
MUSIC_DIR
,
nullptr
);
auto
uri
=
config_get_string
(
ConfigOption
::
MUSIC_DIR
);
if
(
uri
!=
nullptr
&&
uri_has_scheme
(
uri
))
return
CreateConfiguredStorageUri
(
event_loop
,
uri
,
error
);
...
...
@@ -78,5 +78,5 @@ CreateConfiguredStorage(EventLoop &event_loop, Error &error)
bool
IsStorageConfigured
()
{
return
config_get_string
(
ConfigOption
::
MUSIC_DIR
,
nullptr
)
!=
nullptr
;
return
config_get_string
(
ConfigOption
::
MUSIC_DIR
)
!=
nullptr
;
}
src/tag/TagConfig.cxx
View file @
58996b84
...
...
@@ -35,8 +35,7 @@
void
TagLoadConfig
()
{
const
char
*
value
=
config_get_string
(
ConfigOption
::
METADATA_TO_USE
,
nullptr
);
const
char
*
value
=
config_get_string
(
ConfigOption
::
METADATA_TO_USE
);
if
(
value
==
nullptr
)
return
;
...
...
test/read_conf.cxx
View file @
58996b84
...
...
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
ConfigOption
option
=
ParseConfigOptionName
(
name
);
const
char
*
value
=
option
!=
ConfigOption
::
MAX
?
config_get_string
(
option
,
nullptr
)
?
config_get_string
(
option
)
:
nullptr
;
int
ret
;
if
(
value
!=
NULL
)
{
...
...
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