mirror of https://github.com/procxx/kepka.git
Use separate download folder for support.
This commit is contained in:
parent
7705999e57
commit
3f58c930e3
|
@ -138,6 +138,16 @@ void ShowInFolder(const QString &filepath) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString DefaultDownloadPath() {
|
||||||
|
return QStandardPaths::writableLocation(
|
||||||
|
QStandardPaths::DownloadLocation)
|
||||||
|
+ '/'
|
||||||
|
+ (AuthSession::Exists() && Auth().supportMode()
|
||||||
|
? "Tsupport Desktop"
|
||||||
|
: str_const_toString(AppName))
|
||||||
|
+ '/';
|
||||||
|
}
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
void UnsafeOpenEmailLinkDefault(const QString &email) {
|
void UnsafeOpenEmailLinkDefault(const QString &email) {
|
||||||
|
|
|
@ -35,6 +35,8 @@ void OpenWith(const QString &filepath, QPoint menuPosition);
|
||||||
void Launch(const QString &filepath);
|
void Launch(const QString &filepath);
|
||||||
void ShowInFolder(const QString &filepath);
|
void ShowInFolder(const QString &filepath);
|
||||||
|
|
||||||
|
QString DefaultDownloadPath();
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
inline QString UrlToLocalDefault(const QUrl &url) {
|
inline QString UrlToLocalDefault(const QUrl &url) {
|
||||||
|
|
|
@ -146,7 +146,7 @@ QString FileNameUnsafe(
|
||||||
|
|
||||||
QString path;
|
QString path;
|
||||||
if (Global::DownloadPath().isEmpty()) {
|
if (Global::DownloadPath().isEmpty()) {
|
||||||
path = psDownloadPath();
|
path = File::DefaultDownloadPath();
|
||||||
} else if (Global::DownloadPath() == qsl("tmp")) {
|
} else if (Global::DownloadPath() == qsl("tmp")) {
|
||||||
path = cTempDir();
|
path = cTempDir();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -109,12 +109,12 @@ bool IsDefaultPath(const QString &path) {
|
||||||
: value;
|
: value;
|
||||||
return (cPlatform() == dbipWindows) ? result.toLower() : result;
|
return (cPlatform() == dbipWindows) ? result.toLower() : result;
|
||||||
};
|
};
|
||||||
return (check(path) == check(psDownloadPath()));
|
return (check(path) == check(File::DefaultDownloadPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResolveSettings(Settings &settings) {
|
void ResolveSettings(Settings &settings) {
|
||||||
if (settings.path.isEmpty()) {
|
if (settings.path.isEmpty()) {
|
||||||
settings.path = psDownloadPath();
|
settings.path = File::DefaultDownloadPath();
|
||||||
settings.forceSubPath = true;
|
settings.forceSubPath = true;
|
||||||
} else {
|
} else {
|
||||||
settings.forceSubPath = IsDefaultPath(settings.path);
|
settings.forceSubPath = IsDefaultPath(settings.path);
|
||||||
|
@ -381,7 +381,7 @@ void PanelController::saveSettings() const {
|
||||||
return (cPlatform() == dbipWindows) ? result.toLower() : result;
|
return (cPlatform() == dbipWindows) ? result.toLower() : result;
|
||||||
};
|
};
|
||||||
auto settings = *_settings;
|
auto settings = *_settings;
|
||||||
if (check(settings.path) == check(psDownloadPath())) {
|
if (check(settings.path) == check(File::DefaultDownloadPath())) {
|
||||||
settings.path = QString();
|
settings.path = QString();
|
||||||
}
|
}
|
||||||
Local::WriteExportSettings(settings);
|
Local::WriteExportSettings(settings);
|
||||||
|
|
|
@ -979,7 +979,7 @@ void MediaView::onDownload() {
|
||||||
|
|
||||||
QString path;
|
QString path;
|
||||||
if (Global::DownloadPath().isEmpty()) {
|
if (Global::DownloadPath().isEmpty()) {
|
||||||
path = psDownloadPath();
|
path = File::DefaultDownloadPath();
|
||||||
} else if (Global::DownloadPath() == qsl("tmp")) {
|
} else if (Global::DownloadPath() == qsl("tmp")) {
|
||||||
path = cTempDir();
|
path = cTempDir();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -306,10 +306,6 @@ QString psAppDataPath() {
|
||||||
return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + '/';
|
return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
QString psDownloadPath() {
|
|
||||||
return QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + '/' + str_const_toString(AppName) + '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
void psDoCleanup() {
|
void psDoCleanup() {
|
||||||
try {
|
try {
|
||||||
psAutoStart(false, true);
|
psAutoStart(false, true);
|
||||||
|
|
|
@ -59,7 +59,6 @@ void psClearInitLogs();
|
||||||
void psActivateProcess(uint64 pid = 0);
|
void psActivateProcess(uint64 pid = 0);
|
||||||
QString psLocalServerPrefix();
|
QString psLocalServerPrefix();
|
||||||
QString psAppDataPath();
|
QString psAppDataPath();
|
||||||
QString psDownloadPath();
|
|
||||||
void psAutoStart(bool start, bool silent = false);
|
void psAutoStart(bool start, bool silent = false);
|
||||||
void psSendToMenu(bool send, bool silent = false);
|
void psSendToMenu(bool send, bool silent = false);
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,6 @@ void psClearInitLogs();
|
||||||
void psActivateProcess(uint64 pid = 0);
|
void psActivateProcess(uint64 pid = 0);
|
||||||
QString psLocalServerPrefix();
|
QString psLocalServerPrefix();
|
||||||
QString psAppDataPath();
|
QString psAppDataPath();
|
||||||
QString psDownloadPath();
|
|
||||||
void psAutoStart(bool start, bool silent = false);
|
void psAutoStart(bool start, bool silent = false);
|
||||||
void psSendToMenu(bool send, bool silent = false);
|
void psSendToMenu(bool send, bool silent = false);
|
||||||
|
|
||||||
|
|
|
@ -206,10 +206,6 @@ QString psAppDataPath() {
|
||||||
return objc_appDataPath();
|
return objc_appDataPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString psDownloadPath() {
|
|
||||||
return objc_downloadPath();
|
|
||||||
}
|
|
||||||
|
|
||||||
void psDoCleanup() {
|
void psDoCleanup() {
|
||||||
try {
|
try {
|
||||||
psAutoStart(false, true);
|
psAutoStart(false, true);
|
||||||
|
|
|
@ -31,7 +31,6 @@ double objc_appkitVersion();
|
||||||
|
|
||||||
QString objc_documentsPath();
|
QString objc_documentsPath();
|
||||||
QString objc_appDataPath();
|
QString objc_appDataPath();
|
||||||
QString objc_downloadPath();
|
|
||||||
QByteArray objc_downloadPathBookmark(const QString &path);
|
QByteArray objc_downloadPathBookmark(const QString &path);
|
||||||
QByteArray objc_pathBookmark(const QString &path);
|
QByteArray objc_pathBookmark(const QString &path);
|
||||||
void objc_downloadPathEnableAccess(const QByteArray &bookmark);
|
void objc_downloadPathEnableAccess(const QByteArray &bookmark);
|
||||||
|
|
|
@ -489,14 +489,6 @@ QString objc_appDataPath() {
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString objc_downloadPath() {
|
|
||||||
NSURL *url = [[NSFileManager defaultManager] URLForDirectory:NSDownloadsDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:nil];
|
|
||||||
if (url) {
|
|
||||||
return QString::fromUtf8([[url path] fileSystemRepresentation]) + '/' + str_const_toString(AppName) + '/';
|
|
||||||
}
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
QByteArray objc_downloadPathBookmark(const QString &path) {
|
QByteArray objc_downloadPathBookmark(const QString &path) {
|
||||||
#ifndef OS_MAC_STORE
|
#ifndef OS_MAC_STORE
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
|
|
|
@ -193,10 +193,6 @@ QString psAppDataPathOld() {
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString psDownloadPath() {
|
|
||||||
return QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + '/' + str_const_toString(AppName) + '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
void psDoCleanup() {
|
void psDoCleanup() {
|
||||||
try {
|
try {
|
||||||
psAutoStart(false, true);
|
psAutoStart(false, true);
|
||||||
|
|
|
@ -68,7 +68,6 @@ void psActivateProcess(uint64 pid = 0);
|
||||||
QString psLocalServerPrefix();
|
QString psLocalServerPrefix();
|
||||||
QString psAppDataPath();
|
QString psAppDataPath();
|
||||||
QString psAppDataPathOld();
|
QString psAppDataPathOld();
|
||||||
QString psDownloadPath();
|
|
||||||
void psAutoStart(bool start, bool silent = false);
|
void psAutoStart(bool start, bool silent = false);
|
||||||
void psSendToMenu(bool send, bool silent = false);
|
void psSendToMenu(bool send, bool silent = false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue