X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.cpp;h=7e26f000bc73a63c3a4293d5c024ec14fc309852;hp=758de8d0b9d53c86b0d7b2d8eaec7d317cd3456b;hb=e65e46d007d7f5f59274590dec3bc1d8e5f94e91;hpb=3ff2a8a6d3750fc5b68af6faeece5b60e7a25f20 diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index 758de8d0..7e26f000 100644 --- a/src/qtui/chatitem.cpp +++ b/src/qtui/chatitem.cpp @@ -26,7 +26,9 @@ #include #include #include +#ifdef HAVE_WEBKIT #include +#endif #include #include "chatitem.h" @@ -381,7 +383,9 @@ void ContentsChatItem::endHoverMode() { if(hasLayout() && privateData()->currentClickable.isValid()) { setCursor(Qt::ArrowCursor); privateData()->currentClickable = Clickable(); +#ifdef HAVE_WEBKIT privateData()->clearPreview(); +#endif update(); } } @@ -441,6 +445,7 @@ void ContentsChatItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { if(!hasLayout()) updateLayout(); +#ifdef HAVE_WEBKIT QTextLine line = layout()->lineForTextPosition(click.start); qreal x = line.cursorToX(click.start); qreal width = line.cursorToX(click.start + click.length) - x; @@ -451,6 +456,7 @@ void ContentsChatItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { if(!url.contains("://")) url = "http://" + url; privateData()->loadWebPreview(url, urlRect); +#endif } else if(click.type == Clickable::Channel) { // TODO: don't make clickable if it's our own name //onClickable = true; //FIXME disabled for now @@ -471,9 +477,12 @@ void ContentsChatItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { // ContentsChatItemPrivate // **************************************** ContentsChatItemPrivate::~ContentsChatItemPrivate() { +#ifdef HAVE_WEBKIT clearPreview(); +#endif } +#ifdef HAVE_WEBKIT void ContentsChatItemPrivate::loadWebPreview(const QString &url, const QRectF &urlRect) { if(!controller) controller = new PreviewController(contentsItem); @@ -549,6 +558,7 @@ void ContentsChatItemPrivate::PreviewItem::paint(QPainter *painter, const QStyle QString text = QString::number(zValue()); painter->drawText(_boundingRect.center(), text); } +#endif // #ifdef HAVE_WEBKIT /*************************************************************************************************/