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
cd289843
Commit
cd289843
authored
Jul 10, 2014
by
Mantas Mikulėnas
Committed by
Max Kellermann
Jul 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/StandardDirectory: look for cache dir in environment, not user-dirs
The XDG cache directory is part of the "base directories" spec like $XDG_CONFIG_HOME, not "user directories".
parent
b1233925
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
StandardDirectory.cxx
src/fs/StandardDirectory.cxx
+15
-3
No files found.
src/fs/StandardDirectory.cxx
View file @
cd289843
...
@@ -254,11 +254,23 @@ AllocatedPath GetUserMusicDir()
...
@@ -254,11 +254,23 @@ AllocatedPath GetUserMusicDir()
#endif
#endif
}
}
AllocatedPath
AllocatedPath
GetUserCacheDir
()
GetUserCacheDir
()
{
{
#ifdef USE_XDG
#ifdef USE_XDG
return
GetUserDir
(
"XDG_CACHE_DIR"
);
// Check for $XDG_CACHE_HOME
auto
cache_home
=
getenv
(
"XDG_CACHE_HOME"
);
if
(
IsValidPathString
(
cache_home
)
&&
IsValidDir
(
cache_home
))
return
AllocatedPath
::
FromFS
(
cache_home
);
// Check for $HOME/.cache
auto
home
=
GetHomeDir
();
if
(
!
home
.
IsNull
())
{
AllocatedPath
fallback
=
AllocatedPath
::
Build
(
home
,
".cache"
);
if
(
IsValidDir
(
fallback
.
c_str
()))
return
fallback
;
}
return
AllocatedPath
::
Null
();
#elif defined(ANDROID)
#elif defined(ANDROID)
return
context
->
GetCacheDir
(
Java
::
GetEnv
());
return
context
->
GetCacheDir
(
Java
::
GetEnv
());
#else
#else
...
...
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