- KToolTip::showTip(QPoint(x, y), tip);
-}
-
-
-
-void ToolTipManager::startPreviewJob()
-{
- m_generatingPreview = true;
- KIO::PreviewJob* job = KIO::filePreview(KFileItemList() << m_item,
- PREVIEW_WIDTH,
- PREVIEW_HEIGHT);
-
- connect(job, SIGNAL(gotPreview(const KFileItem&, const QPixmap&)),
- this, SLOT(setPreviewPix(const KFileItem&, const QPixmap&)));
- connect(job, SIGNAL(failed(const KFileItem&)),
- this, SLOT(previewFailed(const KFileItem&)));
-}
-
-
-void ToolTipManager::setPreviewPix(const KFileItem& item,
- const QPixmap& pixmap)
-{
- if (m_item.url() != item.url()) {
- m_generatingPreview = false;
- return;
- }
-
- if (m_previewIsLate) {
- // always use the maximal width
- QPixmap paddedImage(QSize(PREVIEW_WIDTH, pixmap.height()));
- paddedImage.fill(Qt::transparent);
- QPainter painter(&paddedImage);
- painter.drawPixmap((PREVIEW_WIDTH - pixmap.width()) / 2, 0, pixmap);
- m_pix = paddedImage;
+ if (!updateWidth && !updateHeight) {
+ // Default case: There is enough room below and right of the mouse
+ // pointer and the tooltip can be positioned there.
+ m_fileMetaDataToolTip->move(x, y);
+ m_fileMetaDataToolTip->show();