Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-windows
Commits
571566bd
Commit
571566bd
authored
Feb 20, 2020
by
Andreas Traczyk
Browse files
datatransfer: remove file name manipulation
Change-Id: I26decea445353a2bf1afc7dce456c33dd41d7b27
parent
36e9b93a
Changes
1
Show whitespace changes
Inline
Side-by-side
src/messagewebview.cpp
View file @
571566bd
...
...
@@ -579,26 +579,8 @@ PrivateBridging::acceptFile(const QString& arg)
{
try
{
auto
interactionUid
=
arg
.
toLongLong
();
lrc
::
api
::
datatransfer
::
Info
info
=
{};
auto
convUid
=
LRCInstance
::
getCurrentConvUid
();
LRCInstance
::
getCurrentConversationModel
()
->
getTransferInfo
(
interactionUid
,
info
);
// get full path
QString
filename
=
LRCInstance
::
dataTransferModel
().
downloadDirectory
;
if
(
!
filename
.
isEmpty
()
&&
filename
.
right
(
1
)
!=
'/'
)
filename
+=
"/"
;
auto
wantedFilename
=
filename
+
info
.
displayName
;
auto
duplicate
=
0
;
while
(
QFile
(
wantedFilename
).
exists
())
{
++
duplicate
;
auto
splittedList
=
info
.
displayName
.
split
(
"."
);
if
(
splittedList
.
size
()
==
1
)
wantedFilename
=
filename
+
info
.
displayName
+
" ("
+
QString
::
number
(
duplicate
)
+
")"
;
else
wantedFilename
=
filename
+
splittedList
[
0
]
+
" ("
+
QString
::
number
(
duplicate
)
+
")"
+
"."
+
splittedList
[
1
];
}
LRCInstance
::
getCurrentConversationModel
()
->
acceptTransfer
(
convUid
,
interactionUid
,
wantedFilename
);
LRCInstance
::
getCurrentConversationModel
()
->
acceptTransfer
(
convUid
,
interactionUid
);
}
catch
(...)
{
qDebug
()
<<
"JS bridging - exception during acceptFile: "
<<
arg
;
}
...
...
Write
Preview
Supports
Markdown
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