build: split user and data folder, moving user data to Application Support on Mac
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <set>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QFontDatabase>
|
||||
#include <QPainter>
|
||||
@@ -150,4 +151,29 @@ namespace utility
|
||||
painter.drawImage(0, 0, colorImage);
|
||||
return QPixmap::fromImage(image);
|
||||
}
|
||||
|
||||
void copyNewFilesFromDirectory(QString src, QString dst)
|
||||
{
|
||||
QDir dir(src);
|
||||
if (!dir.exists())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (QString d, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
|
||||
{
|
||||
QString dst_path = dst + QDir::separator() + d;
|
||||
|
||||
dir.mkpath(dst_path);
|
||||
copyNewFilesFromDirectory(src + QDir::separator() + d, dst_path);
|
||||
}
|
||||
|
||||
foreach (QString f, dir.entryList(QDir::Files))
|
||||
{
|
||||
if (!QFile::exists(dst + QDir::separator() + f))
|
||||
{
|
||||
QFile::copy(src + QDir::separator() + f, dst + QDir::separator() + f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user