datatransfer: add method to get default download directory

Change-Id: If74742b183f3d8ef062959cc4508690fe80b6fbd
parent ec26847a
......@@ -74,6 +74,11 @@ public:
*/
QString downloadDirectory;
/**
* Creates APPDATA/received and return the path
*/
static QString createDefaultDirectory();
Q_SIGNALS:
/**
* Connect this signal to know when a data transfer is incoming.
......
......@@ -31,8 +31,10 @@
#include <type_traits>
// Qt
#include <QUuid>
#include <QDir>
#include <QFileInfo>
#include <QtCore/QStandardPaths>
#include <QUuid>
namespace lrc { namespace api {
......@@ -188,6 +190,16 @@ DataTransferModel::getDringIdFromInteractionId(int interactionId)
return pimpl_->lrc2dringIdMap.at(interactionId);
}
QString
DataTransferModel::createDefaultDirectory()
{
auto defaultDirectory = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + "/Jami";
QDir dir(defaultDirectory);
if (!dir.exists())
dir.mkpath(".");
return defaultDirectory;
}
}} // namespace lrc::api
#include "api/moc_datatransfermodel.cpp"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment