Skip to content
Snippets Groups Projects
Unverified Commit c5e5eb0f authored by Sébastien Blin's avatar Sébastien Blin
Browse files

datatransfer: add method to get default download directory

Change-Id: If74742b183f3d8ef062959cc4508690fe80b6fbd
parent ec26847a
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment