summaryrefslogtreecommitdiff
path: root/src/filetree.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-02-14 08:01:27 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2020-02-18 17:25:04 -0500
commit4a74102736a20a6fa5bf9df9cc7716cbecb5b777 (patch)
tree5ecde6b6a1c2bea7e07058e730f5b3191f7d7262 /src/filetree.cpp
parent75359bc9c2bd9f593c59fb156186b3491d0b7c47 (diff)
moved dump() to DirectoryEntry
static functions instead of lambdas
Diffstat (limited to 'src/filetree.cpp')
-rw-r--r--src/filetree.cpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/filetree.cpp b/src/filetree.cpp
index e5ea4e9d..45c21c7f 100644
--- a/src/filetree.cpp
+++ b/src/filetree.cpp
@@ -438,30 +438,7 @@ void FileTree::dumpToFile() const
return;
}
- QFile out(file);
-
- if (!out.open(QIODevice::WriteOnly)) {
- QMessageBox::critical(
- m_tree->window(), tr("Error"), tr("Failed to open file '%1': %2")
- .arg(file)
- .arg(out.errorString()));
-
- return;
- }
-
- try
- {
- dumpToFile(out, "Data", *m_core.directoryStructure());
- }
- catch(DumpFailed&)
- {
- // try to remove it silently
- if (out.exists()) {
- if (!out.remove()) {
- log::error("failed to remove '{}', ignoring", file);
- }
- }
- }
+ m_core.directoryStructure()->dump(file.toStdWString());
}
void FileTree::dumpToFile(