mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Added for Private Chat Attachments to display for each rs link with file size
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3346 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0abfbbb911
commit
bbd3902bbe
@ -29,6 +29,7 @@
|
||||
#include <QObject>
|
||||
|
||||
#include "RetroShareLink.h"
|
||||
#include "util/misc.h"
|
||||
|
||||
#include <retroshare/rsfiles.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
@ -187,6 +188,11 @@ QString RetroShareLink::toHtmlFull() const
|
||||
return QString("<a href='") + toString() + "'>" + toString() + "</a>" ;
|
||||
}
|
||||
|
||||
QString RetroShareLink::toHtmlSize() const
|
||||
{
|
||||
return QString("<a href='") + toString() + "'>" + name() +"</a>" + " " + "<HTML><font color=\"blue\">" + "(" + misc::friendlyUnit(_size) + ")" +"</font></HTML>";
|
||||
}
|
||||
|
||||
bool RetroShareLink::checkName(const QString& name)
|
||||
{
|
||||
if(name == "")
|
||||
|
@ -72,6 +72,8 @@ class RetroShareLink
|
||||
/// returns the string <a href="retroshare://file|name|size|hash">retroshare://file|name|size|hash</a>
|
||||
/// <a href="retroshare://person|name|hash">retroshare://person|name|hash</a>
|
||||
QString toHtmlFull() const ;
|
||||
|
||||
QString toHtmlSize() const ;
|
||||
|
||||
QUrl toUrl() const ;
|
||||
|
||||
@ -125,6 +127,10 @@ class RSLinkClipboard
|
||||
// produces a list of html links that displays the full links
|
||||
//
|
||||
static QString toHtmlFull();
|
||||
|
||||
// produces a list of html links that displays with the file name + filesize
|
||||
//
|
||||
static QString toHtmlSize();
|
||||
|
||||
// Returns true is no links are found to paste.
|
||||
// Useful for menus.
|
||||
|
@ -1004,7 +1004,7 @@ void PopupChatDialog::fileHashingFinished(AttachFileItem* file)
|
||||
message+="<br>";
|
||||
}
|
||||
|
||||
message+= RetroShareLink(QString::fromStdString(file->FileName()),file->FileSize(),QString::fromStdString(file->FileHash())).toHtml();
|
||||
message+= RetroShareLink(QString::fromStdString(file->FileName()),file->FileSize(),QString::fromStdString(file->FileHash())).toHtmlSize();
|
||||
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << "PopupChatDialog::anchorClicked message : " << message.toStdString() << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user