Added title to the RetroShare file links shown as toolhelp "hash (size)".

Fixed german language.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4181 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-05-01 22:26:41 +00:00
parent 34fc615d2c
commit 60138e0137
6 changed files with 109 additions and 62 deletions

View file

@ -302,6 +302,26 @@ void RetroShareLink::check()
}
}
QString RetroShareLink::title() const
{
if (!valid()) {
return "";
}
switch (_type) {
case TYPE_UNKNOWN:
break;
case TYPE_FILE:
return QString("%1 (%2)").arg(hash()).arg(misc::friendlyUnit(size()));
case TYPE_PERSON:
case TYPE_FORUM:
case TYPE_CHANNEL:
break;
}
return "";
}
QString RetroShareLink::toString(bool encoded /*= true*/) const
{
switch (_type) {
@ -386,7 +406,15 @@ QString RetroShareLink::niceName() const
QString RetroShareLink::toHtml() const
{
return QString("<a href=\"") + toString(true) + "\">" + niceName() + "</a>" ;
QString html = "<a href=\"" + toString(true);
QString linkTitle = title();
if (!linkTitle.isEmpty()) {
html += " title=\"" + linkTitle + "\"";
}
html += "\">" + niceName() + "</a>" ;
return html;
}
QString RetroShareLink::toHtmlFull() const