mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-15 22:39:33 +02:00
Add fix for S_IFLNK on Windows, and fix createClient
This commit is contained in:
parent
b6800bdc7d
commit
f97a8a06c8
3 changed files with 24 additions and 17 deletions
|
@ -1,12 +1,13 @@
|
||||||
#include "Helper.h"
|
#include "Helper.h"
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
#include <Windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
void launchClient(const QString& homePath, const QString& defaultScriptOverride, const QString& displayName,
|
|
||||||
const QString& contentCachePath, const QString& loginResponseToken) {
|
#include <Windows.h>
|
||||||
|
|
||||||
|
void launchClient(const QString& clientPath, const QString& homePath, const QString& defaultScriptsPath,
|
||||||
|
const QString& displayName, const QString& contentCachePath, QString loginResponseToken) {
|
||||||
|
|
||||||
// TODO Fix parameters
|
// TODO Fix parameters
|
||||||
QString params = "--url " + homePath
|
QString params = "--url " + homePath
|
||||||
|
@ -15,8 +16,8 @@ void launchClient(const QString& homePath, const QString& defaultScriptOverride,
|
||||||
+ " --displayName " + displayName
|
+ " --displayName " + displayName
|
||||||
+ " --cache " + contentCachePath;
|
+ " --cache " + contentCachePath;
|
||||||
|
|
||||||
if (!_loginTokenResponse.isEmpty()) {
|
if (!loginResponseToken.isEmpty()) {
|
||||||
params += " --tokens \"" + _loginTokenResponse.replace("\"", "\\\"") + "\"";
|
params += " --tokens \"" + loginResponseToken.replace("\"", "\\\"") + "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
STARTUPINFO si;
|
STARTUPINFO si;
|
||||||
|
@ -40,10 +41,12 @@ void launchClient(const QString& homePath, const QString& defaultScriptOverride,
|
||||||
&si, // Pointer to STARTUPINFO structure
|
&si, // Pointer to STARTUPINFO structure
|
||||||
&pi // Pointer to PROCESS_INFORMATION structure
|
&pi // Pointer to PROCESS_INFORMATION structure
|
||||||
);
|
);
|
||||||
|
|
||||||
// Close process and thread handles.
|
// Close process and thread handles.
|
||||||
CloseHandle(pi.hProcess);
|
CloseHandle(pi.hProcess);
|
||||||
CloseHandle(pi.hThread);
|
CloseHandle(pi.hThread);
|
||||||
exit(0);
|
|
||||||
|
QCoreApplication::instance()->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
void launchClient(const QString& clientPath, const QString& homePath, const QString& defaultScriptOverride,
|
void launchClient(const QString& clientPath, const QString& homePath, const QString& defaultScriptOverride,
|
||||||
const QString& displayName, const QString& contentCachePath, const QString& loginResponseToken = QString());
|
const QString& displayName, const QString& contentCachePath, QString loginResponseToken = QString());
|
||||||
|
|
|
@ -66,7 +66,11 @@ void Unzipper::run() {
|
||||||
|
|
||||||
uint16_t mod_attr = (file_stat.m_external_attr >> 16) & FILE_PERMISSIONS_MASK;
|
uint16_t mod_attr = (file_stat.m_external_attr >> 16) & FILE_PERMISSIONS_MASK;
|
||||||
uint16_t filetype_attr = (file_stat.m_external_attr >> 16) & S_IFMT;
|
uint16_t filetype_attr = (file_stat.m_external_attr >> 16) & S_IFMT;
|
||||||
|
#ifdef Q_OS_MACOS
|
||||||
bool is_symlink = filetype_attr == S_IFLNK;
|
bool is_symlink = filetype_attr == S_IFLNK;
|
||||||
|
#else
|
||||||
|
bool is_symlink = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (is_symlink) {
|
if (is_symlink) {
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
|
|
Loading…
Reference in a new issue