]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tooltipmanager.cpp
Improve the performance of the code part which checks which items are visible. Althou...
[dolphin.git] / src / tooltipmanager.cpp
index c133980166167f3fe74fb18ff5a99e1c90f510a7..2edd008fc85256b65e119e534bb1a39dd222fc44 100644 (file)
 
 #include "dolphinmodel.h"
 #include "dolphinsortfilterproxymodel.h"
-#include "ktooltip.h"
-#include "kicon.h"
+
+#include <kformattedballoontipdelegate.h>
+#include <kicon.h>
+#include <ktooltip.h>
 
 #include <QTimer>
 
+K_GLOBAL_STATIC(KFormattedBalloonTipDelegate, g_delegate)
+
 ToolTipManager::ToolTipManager(QAbstractItemView* parent,
                                DolphinSortFilterProxyModel* model) :
     QObject(parent),
@@ -34,10 +38,9 @@ ToolTipManager::ToolTipManager(QAbstractItemView* parent,
     m_proxyModel(model),
     m_timer(0),
     m_item(),
-    m_pos(),
-    m_delegate()
+    m_pos()
 {
-    KToolTip::setToolTipDelegate(&m_delegate);
+    KToolTip::setToolTipDelegate(g_delegate);
 
     m_dolphinModel = static_cast<DolphinModel*>(m_proxyModel->sourceModel());
     connect(parent, SIGNAL(entered(const QModelIndex&)),