Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-lrc
Commits
c5e5eb0f
Unverified
Commit
c5e5eb0f
authored
Apr 27, 2020
by
Sébastien Blin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
datatransfer: add method to get default download directory
Change-Id: If74742b183f3d8ef062959cc4508690fe80b6fbd
parent
ec26847a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
src/api/datatransfermodel.h
src/api/datatransfermodel.h
+5
-0
src/datatransfermodel.cpp
src/datatransfermodel.cpp
+13
-1
No files found.
src/api/datatransfermodel.h
View file @
c5e5eb0f
...
...
@@ -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.
...
...
src/datatransfermodel.cpp
View file @
c5e5eb0f
...
...
@@ -31,8 +31,10 @@
#include <type_traits>
// Qt
#include <Q
Uuid
>
#include <Q
Dir
>
#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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment