From a6ca45c9ddac3eb3442eeae0cb52a36cddfaf67a Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Sat, 29 Apr 2023 21:02:54 -0400 Subject: [PATCH] Use the universal sep. --- download.cpp | 6 +++--- llm.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/download.cpp b/download.cpp index 0f9b4bc8..1cc1f456 100644 --- a/download.cpp +++ b/download.cpp @@ -124,7 +124,7 @@ QString Download::downloadLocalModelsPath() const { void Download::setDownloadLocalModelsPath(const QString &modelPath) { QString filePath = (modelPath.startsWith("file://") ? QUrl(modelPath).toLocalFile() : modelPath); - QString canonical = QFileInfo(filePath).canonicalFilePath() + QDir::separator(); + QString canonical = QFileInfo(filePath).canonicalFilePath() + "/"; if (m_downloadLocalModelsPath != canonical) { m_downloadLocalModelsPath = canonical; emit downloadLocalModelsPathChanged(); @@ -145,9 +145,9 @@ bool Download::isFirstStart() const QString Download::defaultLocalModelsPath() const { QString localPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) - + QDir::separator(); + + "/"; QString testWritePath = localPath + QString("test_write.txt"); - QString canonicalLocalPath = QFileInfo(localPath).canonicalFilePath() + QDir::separator(); + QString canonicalLocalPath = QFileInfo(localPath).canonicalFilePath() + "/"; QDir localDir(localPath); if (!localDir.exists()) { if (!localDir.mkpath(localPath)) { diff --git a/llm.cpp b/llm.cpp index 4125eb7e..e771e716 100644 --- a/llm.cpp +++ b/llm.cpp @@ -22,13 +22,13 @@ static LLModel::PromptContext s_ctx; static QString modelFilePath(const QString &modelName) { QString appPath = QCoreApplication::applicationDirPath() - + QDir::separator() + "ggml-" + modelName + ".bin"; + + "/ggml-" + modelName + ".bin"; QFileInfo infoAppPath(appPath); if (infoAppPath.exists()) return appPath; QString downloadPath = Download::globalInstance()->downloadLocalModelsPath() - + QDir::separator() + "ggml-" + modelName + ".bin"; + + "/ggml-" + modelName + ".bin"; QFileInfo infoLocalPath(downloadPath); if (infoLocalPath.exists()) @@ -469,7 +469,7 @@ bool LLM::checkForUpdates() const #endif QString fileName = QCoreApplication::applicationDirPath() - + QDir::separator() + ".." + QDir::separator() + tool; + + "/../" + tool; if (!QFileInfo::exists(fileName)) { qDebug() << "Couldn't find tool at" << fileName << "so cannot check for updates!"; return false;