diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index 83991fbee..a6e1538bb 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -29,6 +29,7 @@ #include #include "RetroShareLink.h" +#include "util/misc.h" #include #include @@ -187,6 +188,11 @@ QString RetroShareLink::toHtmlFull() const return QString("" + toString() + "" ; } +QString RetroShareLink::toHtmlSize() const +{ + return QString("" + name() +"" + " " + "" + "(" + misc::friendlyUnit(_size) + ")" +""; +} + bool RetroShareLink::checkName(const QString& name) { if(name == "") diff --git a/retroshare-gui/src/gui/RetroShareLink.h b/retroshare-gui/src/gui/RetroShareLink.h index 84fad51c7..bbb3d1fca 100644 --- a/retroshare-gui/src/gui/RetroShareLink.h +++ b/retroshare-gui/src/gui/RetroShareLink.h @@ -72,6 +72,8 @@ class RetroShareLink /// returns the string retroshare://file|name|size|hash /// retroshare://person|name|hash 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. diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index b490776fd..388396f24 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -1004,7 +1004,7 @@ void PopupChatDialog::fileHashingFinished(AttachFileItem* file) message+="
"; } - 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;