mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-22 04:49:12 -06:00
Correctly handle path tokens in download destinations
This commit is contained in:
@@ -60,22 +60,6 @@ InfoWidget::InfoWidget(QString name, int totalBytes)
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
//void InfoWidget::update(int currentBytes) {
|
||||
// _bytes->setText(
|
||||
// QString("%1 / %2")
|
||||
// .arg(currentBytes)
|
||||
// .arg(_totalBytes)
|
||||
// );
|
||||
//
|
||||
// float progress = static_cast<float>(currentBytes) / static_cast<float>(_totalBytes);
|
||||
// _progress->setValue(static_cast<int>(progress * 100));
|
||||
//}
|
||||
//
|
||||
//void InfoWidget::update(float progress) {
|
||||
// _bytes->setText("");
|
||||
// _progress->setValue(static_cast<int>(progress * 100));
|
||||
//}
|
||||
|
||||
void InfoWidget::update(openspace::DownloadManager::FileFuture* f) {
|
||||
_bytes->setText(
|
||||
QString("%1 / %2")
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <ghoul/logging/log.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/logging/consolelog.h>
|
||||
#include <ghoul/logging/htmllog.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QComboBox>
|
||||
@@ -171,8 +172,9 @@ void MainWindow::initialize() {
|
||||
_syncWidget->setWindowModality(Qt::WindowModal);
|
||||
_syncWidget->hide();
|
||||
|
||||
ghoul::logging::LogManager::initialize(ghoul::logging::LogManager::LogLevel::Error);
|
||||
ghoul::logging::LogManager::initialize(ghoul::logging::LogManager::LogLevel::Debug);
|
||||
LogMgr.addLog(new ghoul::logging::ConsoleLog);
|
||||
LogMgr.addLog(new ghoul::logging::HTMLLog("LauncherLog.html"));
|
||||
LogMgr.addLog(new QLog);
|
||||
|
||||
std::string configurationFile = _configurationFile;
|
||||
|
||||
@@ -68,8 +68,8 @@ namespace {
|
||||
const std::string IdentifierKey = "Identifier";
|
||||
const std::string VersionKey = "Version";
|
||||
|
||||
const bool OverwriteFiles = true;
|
||||
const bool CleanInfoWidgets = false;
|
||||
const bool OverwriteFiles = false;
|
||||
const bool CleanInfoWidgets = true;
|
||||
}
|
||||
|
||||
SyncWidget::SyncWidget(QWidget* parent, Qt::WindowFlags f)
|
||||
@@ -202,8 +202,13 @@ void SyncWidget::handleFileRequest() {
|
||||
for (const FileRequest& f : _fileRequests) {
|
||||
LDEBUG(f.identifier.toStdString() << " (" << f.version << ") -> " << f.destination.toStdString());
|
||||
|
||||
ghoul::filesystem::Directory d = FileSys.currentDirectory();
|
||||
std::string thisDirectory = absPath("${SCENE}/" + f.module.toStdString() + "/");
|
||||
FileSys.setCurrentDirectory(thisDirectory);
|
||||
|
||||
|
||||
std::string identifier = f.identifier.toStdString();
|
||||
std::string path = absPath("${SCENE}/" + f.module.toStdString() + "/" + f.destination.toStdString());
|
||||
std::string path = absPath(f.destination.toStdString());
|
||||
int version = f.version;
|
||||
|
||||
DlManager.downloadRequestFilesAsync(
|
||||
@@ -213,6 +218,8 @@ void SyncWidget::handleFileRequest() {
|
||||
OverwriteFiles,
|
||||
std::bind(&SyncWidget::handleFileFutureAddition, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
FileSys.setCurrentDirectory(d);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,6 +289,7 @@ void SyncWidget::syncButtonPressed() {
|
||||
std::string module = modules.value<std::string>(std::to_string(i));
|
||||
modulesList.append(QString::fromStdString(module));
|
||||
}
|
||||
modulesList.append("common");
|
||||
|
||||
QDir sceneDir(scene);
|
||||
sceneDir.cdUp();
|
||||
|
||||
Reference in New Issue
Block a user