DownloadToaster:

- Fixed handling of utf8 characters in the file name
- Replaced QDesktopServices by RsUrlHandler to handle collections
- Fixed crash after opening a collection

Thanks to AsamK

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4936 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-02-13 23:26:56 +00:00
parent dcf23e0ccb
commit 363c7d8f41

View File

@ -20,12 +20,12 @@
*
*************************************************************************/
#include <QDesktopServices>
#include <QMessageBox>
#include <QFileInfo>
#include <QUrl>
#include "DownloadToaster.h"
#include "gui/common/RsUrlHandler.h"
#include <retroshare/rsfiles.h>
@ -55,11 +55,12 @@ void DownloadToaster::play()
/* open file with a suitable application */
QFileInfo qinfo;
qinfo.setFile(filename.c_str());
qinfo.setFile(QString::fromUtf8(filename.c_str()));
if (qinfo.exists()) {
QDesktopServices::openUrl(QUrl::fromLocalFile(qinfo.absoluteFilePath()));
}else{
// QMessageBox::information(this, "RetroShare", tr("File %1 does not exist at location.").arg(fi.path.c_str()));
hide(); // hide here, because the rscollection dialog blocks and the toaster is deleted in that time
RsUrlHandler::openUrl(QUrl::fromLocalFile(qinfo.absoluteFilePath()));
// please add no code here, because "this" can be deleted
return;
}
hide();