mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-15 02:44:20 -05:00
fixed downloading of links attached to forums
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2054 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5618d145a9
commit
fee083e6b8
@ -1076,21 +1076,23 @@ void ForumsDialog::anchorClicked (const QUrl& link )
|
|||||||
std::cerr << "ForumsDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl;
|
std::cerr << "ForumsDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (link.scheme() == "retroshare://") {
|
if (link.scheme() == "retroshare")
|
||||||
std::string fileName = link.queryItemValue(QString("fileName")).toStdString();
|
{
|
||||||
std::string fileHash = link.queryItemValue(QString("fileHash")).toStdString();
|
QStringList L = link.toString().split("|") ;
|
||||||
uint32_t fileSize = link.queryItemValue(QString("fileSize")).toInt();
|
|
||||||
|
|
||||||
#ifdef FORUM_DEBUG
|
std::string fileName = L.at(1).toStdString() ;
|
||||||
std::cerr << "ForumsDialog::anchorClicked FileRequest : fileName : " << fileName << ". fileHash : " << fileHash << ". fileSize : " << fileSize;
|
uint64_t fileSize = L.at(2).toULongLong();
|
||||||
std::cerr << ". source id : " << dialogId << std::endl;
|
std::string fileHash = L.at(3).toStdString() ;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (fileName != "" && fileHash != "") {
|
#ifdef FORUM_DEBUG
|
||||||
|
std::cerr << "ForumsDialog::anchorClicked FileRequest : fileName : " << fileName << ". fileHash : " << fileHash << ". fileSize : " << fileSize << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (fileName != "" && fileHash != "")
|
||||||
|
{
|
||||||
std::list<std::string> srcIds;
|
std::list<std::string> srcIds;
|
||||||
//srcIds.push_front();
|
//srcIds.push_front();
|
||||||
rsFiles->FileRequest(fileName, fileHash, fileSize, "", 0, srcIds);
|
rsFiles->FileRequest(fileName, fileHash, fileSize, "", RS_FILE_HINTS_NETWORK_WIDE, srcIds);
|
||||||
|
|
||||||
QMessageBox mb(tr("File Request Confirmation"), tr("The file has been added to your download list."),QMessageBox::Information,QMessageBox::Ok,0,0);
|
QMessageBox mb(tr("File Request Confirmation"), tr("The file has been added to your download list."),QMessageBox::Information,QMessageBox::Ok,0,0);
|
||||||
mb.setButtonText( QMessageBox::Ok, "OK" );
|
mb.setButtonText( QMessageBox::Ok, "OK" );
|
||||||
@ -1114,5 +1116,4 @@ void ForumsDialog::anchorClicked (const QUrl& link )
|
|||||||
newAddress.prepend("http://");
|
newAddress.prepend("http://");
|
||||||
QDesktopServices::openUrl(QUrl(newAddress));
|
QDesktopServices::openUrl(QUrl(newAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -38,10 +38,9 @@ public:
|
|||||||
void loadForumEmoticons();
|
void loadForumEmoticons();
|
||||||
|
|
||||||
|
|
||||||
void anchorClicked (const QUrl &);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
void anchorClicked (const QUrl &);
|
||||||
void insertThreads();
|
void insertThreads();
|
||||||
/** Create the context popup menu and it's submenus */
|
/** Create the context popup menu and it's submenus */
|
||||||
void forumListCustomPopupMenu( QPoint point );
|
void forumListCustomPopupMenu( QPoint point );
|
||||||
|
@ -1197,7 +1197,7 @@ void TransfersDialog::pasteLink()
|
|||||||
//downloadFileRequested(linkData.getName (), linkData.getSize ().toInt (),
|
//downloadFileRequested(linkData.getName (), linkData.getSize ().toInt (),
|
||||||
// linkData.getHash (), "", -1, -1, -1, -1);
|
// linkData.getHash (), "", -1, -1, -1, -1);
|
||||||
rsFiles->FileRequest (linkData.getName ().toStdString (), linkData.getHash ().toStdString (),
|
rsFiles->FileRequest (linkData.getName ().toStdString (), linkData.getHash ().toStdString (),
|
||||||
linkData.getSize().toULongLong(), "", 0, srcIds);
|
linkData.getSize().toULongLong(), "", RS_FILE_HINTS_NETWORK_WIDE, srcIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -810,7 +810,7 @@ void PopupChatDialog::anchorClicked (const QUrl& link ) {
|
|||||||
fileHash != "") {
|
fileHash != "") {
|
||||||
std::list<std::string> srcIds;
|
std::list<std::string> srcIds;
|
||||||
srcIds.push_front(dialogId);
|
srcIds.push_front(dialogId);
|
||||||
rsFiles->FileRequest(fileName, fileHash, fileSize, "", 0, srcIds);
|
rsFiles->FileRequest(fileName, fileHash, fileSize, "", RS_FILE_HINTS_ASSUME_AVAILABILITY, srcIds);
|
||||||
|
|
||||||
QMessageBox mb(tr("File Request Confirmation"), tr("The file has been added to your download list."),QMessageBox::Information,QMessageBox::Ok,0,0);
|
QMessageBox mb(tr("File Request Confirmation"), tr("The file has been added to your download list."),QMessageBox::Information,QMessageBox::Ok,0,0);
|
||||||
mb.setButtonText( QMessageBox::Ok, "OK" );
|
mb.setButtonText( QMessageBox::Ok, "OK" );
|
||||||
|
Loading…
Reference in New Issue
Block a user