From 783a0a586f891450337e929d0a6925a8ffb41019 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 3 Apr 2023 22:06:42 +0200 Subject: [PATCH] fixed bug preventing completed files removal to clear the files counter --- .../src/gui/FileTransfer/TransferUserNotify.cpp | 2 -- .../src/gui/FileTransfer/TransfersDialog.cpp | 14 +++++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/TransferUserNotify.cpp b/retroshare-gui/src/gui/FileTransfer/TransferUserNotify.cpp index b424d922b..fa0c33046 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransferUserNotify.cpp +++ b/retroshare-gui/src/gui/FileTransfer/TransferUserNotify.cpp @@ -27,8 +27,6 @@ TransferUserNotify::TransferUserNotify(QObject *parent) : UserNotify(parent) { newTransferCount = 0; - -// connect(NotifyQt::getInstance(), SIGNAL(downloadCompleteCountChanged(int)), this, SLOT(downloadCountChanged(int))); } bool TransferUserNotify::hasSetting(QString *name, QString *group) diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp index bb516d5c1..f5659756b 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp @@ -1111,16 +1111,20 @@ void TransfersDialog::handleEvent_main_thread(std::shared_ptr eve if(!fe) return; - FileInfo nfo ; - if(!rsFiles->FileDetails(fe->mHash, RS_FILE_HINTS_DOWNLOAD, nfo)) - return ; - switch (fe->mFileTransferEventCode) { case RsFileTransferEventCode::DOWNLOAD_COMPLETE: + { + FileInfo nfo ; + if(!rsFiles->FileDetails(fe->mHash, RS_FILE_HINTS_DOWNLOAD, nfo)) + break; + SoundManager::play(SOUND_DOWNLOAD_COMPLETE); if (Settings->getNotifyFlags() & RS_POPUP_DOWNLOAD) - NotifyQt::getInstance()->addToaster(RS_POPUP_DOWNLOAD, fe->mHash.toStdString(), nfo.fname.c_str(),""); + NotifyQt::getInstance()->addToaster(RS_POPUP_DOWNLOAD, fe->mHash.toStdString(), nfo.fname.c_str(),""); + } + [[fallthrough]]; + case RsFileTransferEventCode::COMPLETED_FILES_REMOVED: getUserNotify()->updateIcon();