mirror of https://github.com/mgba-emu/mgba.git
Qt: Add cache dir call, for later expansion
This commit is contained in:
parent
472660a5d3
commit
9ed00c95b6
|
@ -136,7 +136,7 @@ QUrl ApplicationUpdater::parseManifest(const QByteArray& manifest) {
|
||||||
|
|
||||||
QString ApplicationUpdater::destination() const {
|
QString ApplicationUpdater::destination() const {
|
||||||
QFileInfo path(updateInfo().url.path());
|
QFileInfo path(updateInfo().url.path());
|
||||||
QDir dir(ConfigController::configDir());
|
QDir dir(ConfigController::cacheDir());
|
||||||
// QFileInfo::completeSuffix will eat all .'s in the filename...including
|
// QFileInfo::completeSuffix will eat all .'s in the filename...including
|
||||||
// ones in the version string, turning mGBA-1.0.0-win32.7z into
|
// ones in the version string, turning mGBA-1.0.0-win32.7z into
|
||||||
// 0.0-win32.7z instead of the intended .7z
|
// 0.0-win32.7z instead of the intended .7z
|
||||||
|
|
|
@ -382,3 +382,7 @@ const QString& ConfigController::configDir() {
|
||||||
}
|
}
|
||||||
return s_configDir;
|
return s_configDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString& ConfigController::cacheDir() {
|
||||||
|
return configDir();
|
||||||
|
}
|
||||||
|
|
|
@ -105,6 +105,7 @@ public:
|
||||||
void usage(const char* arg0) const;
|
void usage(const char* arg0) const;
|
||||||
|
|
||||||
static const QString& configDir();
|
static const QString& configDir();
|
||||||
|
static const QString& cacheDir();
|
||||||
static bool isPortable();
|
static bool isPortable();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -78,7 +78,7 @@ void ForwarderController::gotManifest(QNetworkReply* reply) {
|
||||||
void ForwarderController::downloadBuild(const QUrl& url) {
|
void ForwarderController::downloadBuild(const QUrl& url) {
|
||||||
QString extension(QFileInfo(url.path()).suffix());
|
QString extension(QFileInfo(url.path()).suffix());
|
||||||
// TODO: cache this
|
// TODO: cache this
|
||||||
QString configDir(ConfigController::configDir());
|
QString configDir(ConfigController::cacheDir());
|
||||||
m_sourceFile.setFileName(QString("%1/%2-%3-%4.%5").arg(configDir)
|
m_sourceFile.setFileName(QString("%1/%2-%3-%4.%5").arg(configDir)
|
||||||
.arg(projectName)
|
.arg(projectName)
|
||||||
.arg(m_generator->systemName())
|
.arg(m_generator->systemName())
|
||||||
|
|
Loading…
Reference in New Issue