From 77e80665422c4e97e2286418ab55e20c4030023b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Wed, 14 Aug 2013 08:13:41 +0200 Subject: Working on legacy support, incomplete. --- libutil/src/pathutils.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libutil/src') diff --git a/libutil/src/pathutils.cpp b/libutil/src/pathutils.cpp index 083fe98d..97287840 100644 --- a/libutil/src/pathutils.cpp +++ b/libutil/src/pathutils.cpp @@ -73,3 +73,22 @@ bool ensurePathExists(QString filenamepath) return (dir.mkpath ( a.path() )); } +bool copyPath(QString src, QString dst) +{ + QDir dir(src); + if (!dir.exists()) + return false; + + foreach (QString d, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) + { + QString dst_path = dst + QDir::separator() + d; + dir.mkpath(dst_path); + copyPath(src+ QDir::separator() + d, dst_path); + } + + foreach (QString f, dir.entryList(QDir::Files)) + { + QFile::copy(src + QDir::separator() + f, dst + QDir::separator() + f); + } + return true; +} -- cgit v1.2.3