mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
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:
parent
dcf23e0ccb
commit
363c7d8f41
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user