feat(cpn): save model images with models and settings (#7234)

This commit is contained in:
Neil Horne
2026-06-07 12:20:33 +10:00
committed by GitHub
parent d754abf2c1
commit a672c3c5c6
16 changed files with 343 additions and 71 deletions
+30
View File
@@ -44,6 +44,8 @@
#include <QtGlobal>
#include <QFile>
QString gAppTempPath;
using namespace Helpers;
Stopwatch gStopwatch("global");
@@ -366,6 +368,34 @@ QString Helpers::concatPath(QString & str1, const QString & str2, bool onlyonese
return (str1 % ((!str1.endsWith("/") || !onlyonesep) ? "/" : "") % str2);
}
QString Helpers::getImagesCacheDir()
{
if (gAppTempPath.isEmpty())
return QString();
return QDir(gAppTempPath).filePath("IMAGES");
}
QString Helpers::getImagePath(const QString & filename)
{
if (filename.isEmpty())
return QString();
QString srcpath(Helpers::getImagesCacheDir() % "/" % filename);
if (srcpath.isEmpty() || !QFileInfo::exists(srcpath) || QFileInfo(srcpath).isDir()) {
srcpath = g.currentProfile().sdPath() % "/IMAGES/" % filename;
if (!QFileInfo::exists(srcpath) || QFileInfo(srcpath).isDir()) {
qDebug() << filename << "not found in image cache or sd path.";
srcpath = "";
}
}
return srcpath;
}
#ifdef __APPLE__
// Flag when simulator is running
static bool simulatorRunning = false;