From e3832b3ee4b0bf10c05e8c3fab61d02e7420c8fd Mon Sep 17 00:00:00 2001 From: Roland Stigge Date: Sun, 7 Jan 2018 16:22:43 +0100 Subject: Implemented moving directories --- src/webbox.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/webbox.cpp') diff --git a/src/webbox.cpp b/src/webbox.cpp index 8f85332..d1e2c50 100644 --- a/src/webbox.cpp +++ b/src/webbox.cpp @@ -377,7 +377,10 @@ int main(int argc, char* argv[]) { QFileInfo fileInfo(path + "/" + filename); if (fileInfo.isDir()) { - response += QString("Note: Moving directory %1 not supported.
").arg(filename); + QDir dir(path); + if (!dir.rename(filename, targetDir + "/" + filename)) { + response += QString("Error moving directory %1
").arg(filename); + } } else if (fileInfo.isFile()) { QFile file(path + "/" + filename); if (!file.rename(path + "/" + targetDir + "/" + filename)) { -- cgit v1.2.3