Kaydet (Commit) fb0bf569 authored tarafından Takeshi Abe's avatar Takeshi Abe Kaydeden (comit) Michael Stahl

tdf#105538 Download update to Downloads folder on Windows

instead of Desktop.

Change-Id: Ib88b23afdd0b836184b7f0a3f501983137a1405d
Reviewed-on: https://gerrit.libreoffice.org/40692Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst dabba2e3
......@@ -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;
}
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment