Truncate the length of a tooltip's main text and sub text to 5000 characters.

svn path=/trunk/KDE/kdelibs/; revision=1178011
This commit is contained in:
Anthony Bryant 2010-09-21 23:50:57 +00:00
parent b6d4b71680
commit 968d659989

View File

@ -44,6 +44,8 @@ struct ToolTipResource
QVariant data;
};
const int MAXIMUM_TEXT_LENGTH = 5000;
class ToolTipContentPrivate
{
public:
@ -121,7 +123,9 @@ void ToolTipContent::setMainText(const QString &text)
QString ToolTipContent::mainText() const
{
return d->mainText;
QString text = d->mainText;
text.truncate(MAXIMUM_TEXT_LENGTH);
return text;
}
void ToolTipContent::setSubText(const QString &text)
@ -131,7 +135,9 @@ void ToolTipContent::setSubText(const QString &text)
QString ToolTipContent::subText() const
{
return d->subText;
QString text = d->subText;
text.truncate(MAXIMUM_TEXT_LENGTH);
return text;
}
void ToolTipContent::setImage(const QPixmap &image)