diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2017-08-03 01:50:13 +0900 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-08-18 12:58:12 +0200 |
commit | fb0bf56948d7f968717f4a3f53ce56e320cd5f36 (patch) | |
tree | 04d41fdc6beabf07e32e18015b778b34f1a0a7a8 /extensions | |
parent | dabba2e3368c2e2ae4ab03ddcfc667e13f89841d (diff) |
tdf#105538 Download update to Downloads folder on Windows
instead of Desktop.
Change-Id: Ib88b23afdd0b836184b7f0a3f501983137a1405d
Reviewed-on: https://gerrit.libreoffice.org/40692
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/update/check/updatecheckconfig.cxx | 10 | ||||
-rw-r--r-- | extensions/source/update/check/updatecheckconfig.hxx | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx index 1eaab8162485..5befb380f243 100644 --- a/extensions/source/update/check/updatecheckconfig.cxx +++ b/extensions/source/update/check/updatecheckconfig.cxx @@ -34,6 +34,7 @@ #pragma warning(push,1) // disable warnings within system headers #pragma warning(disable: 4917) #endif +#include <objbase.h> #include <shlobj.h> #ifdef _MSC_VER #pragma warning(pop) @@ -159,16 +160,17 @@ UpdateCheckROModel::getUpdateEntry(UpdateInfo& rInfo) const } } -OUString UpdateCheckConfig::getDesktopDirectory() +OUString UpdateCheckConfig::getDownloadsDirectory() { OUString aRet; #ifdef _WIN32 - WCHAR szPath[MAX_PATH]; + PWSTR szPath; - if (TRUE == SHGetSpecialFolderPathW(nullptr, szPath, CSIDL_DESKTOPDIRECTORY, true)) + if (SHGetKnownFolderPath(FOLDERID_Downloads, 0, nullptr, &szPath) == S_OK) { aRet = OUString( reinterpret_cast< sal_Unicode * >(szPath) ); + CoTaskMemFree(szPath); osl::FileBase::getFileURLFromSystemPath( aRet, aRet ); } #else @@ -471,7 +473,7 @@ UpdateCheckConfig::getByName( const OUString& aName ) aValue >>= aStr; if( aStr.isEmpty() ) - aValue <<= getDesktopDirectory(); + aValue <<= getDownloadsDirectory(); } return aValue; } diff --git a/extensions/source/update/check/updatecheckconfig.hxx b/extensions/source/update/check/updatecheckconfig.hxx index f130811c1581..c76c876ec568 100644 --- a/extensions/source/update/check/updatecheckconfig.hxx +++ b/extensions/source/update/check/updatecheckconfig.hxx @@ -137,8 +137,8 @@ public: // Stores the bool value for manually paused downloads void storeDownloadPaused(bool paused); - // Returns the directory that acts as the user's desktop - static OUString getDesktopDirectory(); + // Returns the directory for downloaded files + static OUString getDownloadsDirectory(); // Returns a directory accessible for all users static OUString getAllUsersDirectory(); |