diff options
author | flow <flowlnlnln@gmail.com> | 2022-08-07 07:18:37 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-09-12 13:07:23 -0300 |
commit | 277fa21f5f7dcdec1bde11f345136f464ee8d37a (patch) | |
tree | c3209bbee768764a58a630ece7b910de0f504b0f | |
parent | 1cf949226e786e827de2d477516c5a14ecfbd6bd (diff) | |
download | PrismLauncher-277fa21f5f7dcdec1bde11f345136f464ee8d37a.tar.gz PrismLauncher-277fa21f5f7dcdec1bde11f345136f464ee8d37a.tar.bz2 PrismLauncher-277fa21f5f7dcdec1bde11f345136f464ee8d37a.zip |
refactor: remove Win32 'crap' in FileSystem
We should use std::filesystem symlink and hardlink functions instead.
Signed-off-by: flow <flowlnlnln@gmail.com>
-rw-r--r-- | launcher/FileSystem.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp index fefa6dd1..8966413a 100644 --- a/launcher/FileSystem.cpp +++ b/launcher/FileSystem.cpp @@ -300,50 +300,6 @@ bool checkProblemticPathJava(QDir folder) return pathfoldername.contains("!", Qt::CaseInsensitive); } -// Win32 crap -#ifdef Q_OS_WIN - -bool called_coinit = false; - -HRESULT CreateLink(LPCCH linkPath, LPCWSTR targetPath, LPCWSTR args) -{ - HRESULT hres; - - if (!called_coinit) { - hres = CoInitialize(NULL); - called_coinit = true; - - if (!SUCCEEDED(hres)) { - qWarning("Failed to initialize COM. Error 0x%08lX", hres); - return hres; - } - } - - IShellLink* link; - hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&link); - - if (SUCCEEDED(hres)) { - IPersistFile* persistFile; - - link->SetPath(targetPath); - link->SetArguments(args); - - hres = link->QueryInterface(IID_IPersistFile, (LPVOID*)&persistFile); - if (SUCCEEDED(hres)) { - WCHAR wstr[MAX_PATH]; - - MultiByteToWideChar(CP_ACP, 0, linkPath, -1, wstr, MAX_PATH); - - hres = persistFile->Save(wstr, TRUE); - persistFile->Release(); - } - link->Release(); - } - return hres; -} - -#endif - QString getDesktopDir() { return QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); |