Build viewer/editor #13

Manually merged
williamjcm merged 128 commits from mass-viewer into master 2022-03-02 14:50:10 +01:00
Showing only changes of commit 83fa5822bf - Show all commits

View file

@ -86,8 +86,8 @@ auto MassManager::importMass(const std::string& staged_fn, int hangar) -> bool {
return false; return false;
} }
if(Utility::Directory::exists(_hangars[hangar].filename())) { if(Utility::Directory::exists(Utility::Directory::join(_saveDirectory, _hangars[hangar].filename()))) {
Utility::Directory::rm(_hangars[hangar].filename()); Utility::Directory::rm(Utility::Directory::join(_saveDirectory, _hangars[hangar].filename()));
} }
if(!Utility::Directory::move(source + ".tmp", Utility::Directory::join(_saveDirectory, _hangars[hangar].filename()))) { if(!Utility::Directory::move(source + ".tmp", Utility::Directory::join(_saveDirectory, _hangars[hangar].filename()))) {
@ -132,8 +132,8 @@ auto MassManager::moveMass(int source, int destination) -> bool {
return false; return false;
} }
std::string source_file = _hangars[source].filename(); std::string source_file = Utility::Directory::join(_saveDirectory, _hangars[source].filename());
std::string dest_file = _hangars[destination].filename(); std::string dest_file = Utility::Directory::join(_saveDirectory, _hangars[destination].filename());
Mass::State dest_state = _hangars[destination].state(); Mass::State dest_state = _hangars[destination].state();
switch(dest_state) { switch(dest_state) {
@ -162,7 +162,7 @@ auto MassManager::deleteMass(int hangar) -> bool {
return false; return false;
} }
if(!Utility::Directory::rm(_hangars[hangar].filename())) { if(!Utility::Directory::rm(Utility::Directory::join(_saveDirectory, _hangars[hangar].filename()))) {
_lastError = "Deletion failed. Maybe the file was already deleted, or it's locked by another application."; _lastError = "Deletion failed. Maybe the file was already deleted, or it's locked by another application.";
return false; return false;
} }