From 88ef0530001d43be8f18fac43a280169b45db852 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sat, 15 Feb 2020 12:25:37 -0500 Subject: error checking in dump() removed a bunch of "{} saved" in the logs --- src/filetree.cpp | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'src/filetree.cpp') diff --git a/src/filetree.cpp b/src/filetree.cpp index 45c21c7f..f628dff3 100644 --- a/src/filetree.cpp +++ b/src/filetree.cpp @@ -441,45 +441,6 @@ void FileTree::dumpToFile() const m_core.directoryStructure()->dump(file.toStdWString()); } -void FileTree::dumpToFile( - QFile& out, const QString& parentPath, const DirectoryEntry& entry) const -{ - entry.forEachFile([&](auto&& file) { - bool isArchive = false; - const int originID = file.getOrigin(isArchive); - - if (isArchive) { - // TODO: don't list files from archives. maybe make this an option? - return true; - } - - const auto& origin = m_core.directoryStructure()->getOriginByID(originID); - const auto originName = QString::fromStdWString(origin.getName()); - - const QString path = - parentPath + "\\" + QString::fromStdWString(file.getName()); - - if (out.write(path.toUtf8() + "\t(" + originName.toUtf8() + ")\r\n") == -1) { - QMessageBox::critical( - m_tree->window(), tr("Error"), tr("Failed to write to file %1: %2") - .arg(out.fileName()) - .arg(out.errorString())); - - throw DumpFailed(); - } - - return true; - }); - - entry.forEachDirectory([&](auto&& dir) { - const auto newParentPath = - parentPath + "\\" + QString::fromStdWString(dir.getName()); - - dumpToFile(out, newParentPath, dir); - return true; - }); -} - void FileTree::onExpandedChanged(const QModelIndex& index, bool expanded) { if (auto* item=m_model->itemFromIndex(proxiedIndex(index))) { -- cgit v1.3.1