Commit 5a934300 authored by Bernd Gehrmann's avatar Bernd Gehrmann
Browse files

* Escape all text inserted in richtext tooltips

* Don't hide tooltips on leaveEvent(), since somehow that event happens absolute spontaneously, not reproducible :-(

svn path=/trunk/kdesdk/cervisia/; revision=163121
parent 267643ba
......@@ -18,6 +18,7 @@
* Load .ui, .docbook and .xml files with utf8
encoding. This can be implemented in a cleaner way
* Resolved accelerator conflict in resolve dialog
* Escape all text inserted in richtext tooltips
2002-06-22 Bernd Gehrmann <bernd@mail.berlios.de>
......
......@@ -202,18 +202,18 @@ void AnnotateView::contentsMouseMoveEvent(QMouseEvent *e)
if (!currentLabel && item && col == AnnotateViewItem::AuthorColumn && !item->mauthor.isNull())
{
QString text = "<qt><b>";
text += item->mrev;
text += QStyleSheet::escape(item->mrev);
text += "</b>&nbsp;&nbsp;";
text += item->mauthor;
text += QStyleSheet::escape(item->mauthor);
text += "&nbsp;&nbsp;<b>";
text += item->mdate;
text += QStyleSheet::escape(item->mdate);
text += "</b>";
QStringList list = QStringList::split("\n", item->mcomment);
QStringList::Iterator it;
for (it = list.begin(); it != list.end(); ++it)
{
text += "<br>";
text += (*it);
text += QStyleSheet::escape(*it);
}
text += "</qt>";
......@@ -235,7 +235,8 @@ void AnnotateView::windowActivationChange(bool oldActive)
void AnnotateView::leaveEvent(QEvent *e)
{
hideLabel();
// has strange effects
// hideLabel();
QListView::leaveEvent(e);
}
......
......@@ -16,6 +16,7 @@
#include <qkeycode.h>
#include <qstrlist.h>
#include <qstylesheet.h>
#include <kapplication.h>
#include <kconfig.h>
#include <klocale.h>
......@@ -316,18 +317,18 @@ void LogListView::contentsMouseMoveEvent(QMouseEvent *e)
if (!currentLabel && item)
{
QString text = "<qt><b>";
text += item->mrev;
text += QStyleSheet::escape(item->mrev);
text += "</b>&nbsp;&nbsp;";
text += item->mauthor;
text += QStyleSheet::escape(item->mauthor);
text += "&nbsp;&nbsp;<b>";
text += item->mdate;
text += QStyleSheet::escape(item->mdate);
text += "</b>";
QStringList list2 = QStringList::split("\n", item->mcomment);
QStringList::Iterator it2;
for (it2 = list2.begin(); it2 != list2.end(); ++it2)
{
text += "<br>";
text += (*it2);
text += QStyleSheet::escape(*it2);
}
if (!item->mtagcomment.isEmpty())
{
......@@ -337,7 +338,7 @@ void LogListView::contentsMouseMoveEvent(QMouseEvent *e)
for (it3 = list3.begin(); it3 != list3.end(); ++it3)
{
text += "<br>";
text += (*it3);
text += QStyleSheet::escape(*it3);
}
text += "</i>";
}
......
......@@ -13,9 +13,12 @@
#include "logtree.h"
#include <qtooltip.h>
#include <qapplication.h>
#include <qpainter.h>
#include <qapp.h>
#include <qstylesheet.h>
#include <qtooltip.h>
#include <kdebug.h>
#include "tiplabel.h"
#include "misc.h"
......@@ -445,8 +448,10 @@ void LogTreeView::mouseMoveEvent(QMouseEvent *e)
int row = findRow(static_cast<QMouseEvent*>(e)->y());
int col = findCol(static_cast<QMouseEvent*>(e)->x());
if (row != currentRow || col != currentCol)
if (row != currentRow || col != currentCol) {
// kdDebug() << "hidden because of row/col change" << endl;
hideLabel();
}
LogTreeItem *item = 0;
......@@ -463,18 +468,18 @@ void LogTreeView::mouseMoveEvent(QMouseEvent *e)
if (!item->author.isNull())
{
QString text = "<qt><b>";
text += item->rev;
text += QStyleSheet::escape(item->rev);
text += "</b>&nbsp;&nbsp;";
text += item->author;
text += QStyleSheet::escape(item->author);
text += "&nbsp;&nbsp;<b>";
text += item->date;
text += QStyleSheet::escape(item->date);
text += "</b>";
QStringList list2 = QStringList::split("\n", item->comment);
QStringList::Iterator it2;
for (it2 = list2.begin(); it2 != list2.end(); ++it2)
{
text += "<br>";
text += (*it2);
text += QStyleSheet::escape(*it2);
}
if (!item->tagcomment.isEmpty())
{
......@@ -484,7 +489,7 @@ void LogTreeView::mouseMoveEvent(QMouseEvent *e)
for (it3 = list3.begin(); it3 != list3.end(); ++it3)
{
text += "<br>";
text += (*it3);
text += QStyleSheet::escape(*it3);
}
text += "</i>";
}
......@@ -502,6 +507,7 @@ void LogTreeView::mouseMoveEvent(QMouseEvent *e)
void LogTreeView::windowActivationChange(bool oldActive)
{
// kdDebug() << "windowActivationChange" << endl;
hideLabel();
QtTableView::windowActivationChange(oldActive);
}
......@@ -509,6 +515,9 @@ void LogTreeView::windowActivationChange(bool oldActive)
void LogTreeView::leaveEvent(QEvent *e)
{
// kdDebug() << "leaveEvent" << endl;
// has strange effects
// hideLabel();
hideLabel();
QtTableView::leaveEvent(e);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment