MassManager: fix bugs in path handling.
This commit is contained in:
parent
8d87cdd619
commit
83fa5822bf
1 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue