[vlc-commits] win32: dirs-uap: use the LocalFolder when we can't get LocalCacheFolder

Steve Lhomme git at videolan.org
Thu Apr 9 07:52:07 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Apr  6 13:23:18 2020 +0200| [862ce2792062617f05dfef3f4de24865d863e97e] | committer: Steve Lhomme

win32: dirs-uap: use the LocalFolder when we can't get LocalCacheFolder

It's better than nothing. It will be backep up.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=862ce2792062617f05dfef3f4de24865d863e97e
---

 src/win32/dirs-uap.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/win32/dirs-uap.c b/src/win32/dirs-uap.c
index 120fdc39c2..e1c7506961 100644
--- a/src/win32/dirs-uap.c
+++ b/src/win32/dirs-uap.c
@@ -213,11 +213,9 @@ end_appdata:
     return psz_dir;
 }
 
+#ifdef HAVE_IAPPLICATIONDATA2
 static char *config_GetCacheDir (void)
 {
-#ifndef HAVE_IAPPLICATIONDATA2
-    return NULL;
-#else // HAVE_IAPPLICATIONDATA2
     HRESULT hr;
     IStorageFolder *folder = NULL;
     IApplicationDataStatics *appDataStatics = NULL;
@@ -273,8 +271,8 @@ end_appdata:
         return NULL;
 
     return GetFolderName(folder);
-#endif // HAVE_IAPPLICATIONDATA2
 }
+#endif // HAVE_IAPPLICATIONDATA2
 
 char *config_GetUserDir (vlc_userdir_t type)
 {
@@ -291,7 +289,11 @@ char *config_GetUserDir (vlc_userdir_t type)
         case VLC_USERDATA_DIR:
             return config_GetAppDir ();
         case VLC_CACHE_DIR:
+#ifdef HAVE_IAPPLICATIONDATA2
             return config_GetCacheDir ();
+#else // !HAVE_IAPPLICATIONDATA2
+            return config_GetAppDir();
+#endif // !HAVE_IAPPLICATIONDATA2
         case VLC_MUSIC_DIR:
             return config_GetShellDir (VLC_MUSIC_DIR);
         case VLC_PICTURES_DIR:



More information about the vlc-commits mailing list