Commit 571566bd authored by Andreas Traczyk's avatar Andreas Traczyk

datatransfer: remove file name manipulation

Change-Id: I26decea445353a2bf1afc7dce456c33dd41d7b27
parent 36e9b93a
......@@ -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;
}
......
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