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 == "")
|
||||
|
@ -73,6 +73,8 @@ class RetroShareLink
|
||||
/// <a href="retroshare://person|name|hash">retroshare://person|name|hash</a>
|
||||
QString toHtmlFull() const ;
|
||||
|
||||
QString toHtmlSize() const ;
|
||||
|
||||
QUrl toUrl() const ;
|
||||
|
||||
bool valid() const { return _valid; }
|
||||
@ -126,6 +128,10 @@ class RSLinkClipboard
|
||||
//
|
||||
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