mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
only resolve the MIME-types asynchronously, if no preview is generated
CCMAIL: faure@kde.org CCMAIL: ereslibre@kde.org svn path=/trunk/KDE/kdebase/apps/; revision=819162
This commit is contained in:
parent
82416aa5a5
commit
929b3c99c9
4 changed files with 15 additions and 3 deletions
|
@ -37,7 +37,6 @@
|
|||
#include <kio/previewjob.h>
|
||||
#include <kiconeffect.h>
|
||||
#include <kjob.h>
|
||||
#include <kmimetyperesolver.h>
|
||||
#include <konqmimedata.h>
|
||||
|
||||
#include "iconmanager.h"
|
||||
|
@ -133,7 +132,6 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent,
|
|||
m_selectionManager, SLOT(reset()));
|
||||
}
|
||||
|
||||
new KMimeTypeResolver(this, m_dolphinModel);
|
||||
m_iconManager = new IconManager(this, m_proxyModel);
|
||||
m_iconManager->setShowPreview(m_view->m_controller->dolphinView()->showPreview());
|
||||
|
||||
|
|
|
@ -1125,7 +1125,6 @@ void DolphinView::createView()
|
|||
|
||||
view->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
|
||||
new KMimeTypeResolver(view, m_dolphinModel);
|
||||
m_iconManager = new IconManager(view, m_proxyModel);
|
||||
m_iconManager->setShowPreview(m_showPreview);
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <kiconeffect.h>
|
||||
#include <kio/previewjob.h>
|
||||
#include <kdirlister.h>
|
||||
#include <kmimetyperesolver.h>
|
||||
#include <konqmimedata.h>
|
||||
|
||||
#include <QApplication>
|
||||
|
@ -45,6 +46,7 @@ IconManager::IconManager(QAbstractItemView* parent, DolphinSortFilterProxyModel*
|
|||
m_previewJobs(),
|
||||
m_dolphinModel(0),
|
||||
m_proxyModel(model),
|
||||
m_mimeTypeResolver(0),
|
||||
m_cutItemsCache(),
|
||||
m_previews(),
|
||||
m_pendingItems(),
|
||||
|
@ -97,6 +99,16 @@ void IconManager::setShowPreview(bool show)
|
|||
updatePreviews();
|
||||
}
|
||||
}
|
||||
|
||||
if (show && (m_mimeTypeResolver != 0)) {
|
||||
// don't resolve the MIME types if the preview is turned on
|
||||
m_mimeTypeResolver->deleteLater();
|
||||
m_mimeTypeResolver = 0;
|
||||
} else if (!show && (m_mimeTypeResolver == 0)) {
|
||||
// the preview is turned off: resolve the MIME-types so that
|
||||
// the icons gets updated
|
||||
m_mimeTypeResolver = new KMimeTypeResolver(m_view, m_dolphinModel);
|
||||
}
|
||||
}
|
||||
|
||||
void IconManager::updatePreviews()
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
class DolphinModel;
|
||||
class DolphinSortFilterProxyModel;
|
||||
class KJob;
|
||||
class KMimeTypeResolver;
|
||||
class QAbstractItemView;
|
||||
|
||||
/**
|
||||
|
@ -166,6 +167,8 @@ private:
|
|||
DolphinModel* m_dolphinModel;
|
||||
DolphinSortFilterProxyModel* m_proxyModel;
|
||||
|
||||
KMimeTypeResolver* m_mimeTypeResolver;
|
||||
|
||||
QList<ItemInfo> m_cutItemsCache;
|
||||
QList<ItemInfo> m_previews;
|
||||
|
||||
|
|
Loading…
Reference in a new issue