summaryrefslogtreecommitdiffstats
path: root/src/gvcore/fileviewcontroller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gvcore/fileviewcontroller.cpp')
-rw-r--r--src/gvcore/fileviewcontroller.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/gvcore/fileviewcontroller.cpp b/src/gvcore/fileviewcontroller.cpp
index 1a1005a..4da91b0 100644
--- a/src/gvcore/fileviewcontroller.cpp
+++ b/src/gvcore/fileviewcontroller.cpp
@@ -1063,10 +1063,11 @@ void FileViewController::dirListerRefreshItems(const KFileItemList& list) {
for (; *it!=0L; ++it) {
updateViewItem(*it);
}
+ loadMetaInfo(list, true);
}
-void FileViewController::updateViewItem(const KFileItem *item) {
- currentFileView()->updateView(item);
+void FileViewController::updateViewItem(const KFileItem *item, bool metaDataOnly) {
+ currentFileView()->updateView(item, metaDataOnly);
if (item==currentFileView()->shownFileItem()) {
emit shownFileItemRefreshed(item);
}
@@ -1114,7 +1115,7 @@ void FileViewController::delayedDirListerCompleted() {
// around is not in firstFileItem() because it's const and sort() is a non
// const method
if (mMode!=FILE_LIST) {
- mFileThumbnailView->sort(mFileThumbnailView->sortDirection());
+ mFileThumbnailView->sortView();
}
if (mChangeDirStatus != CHANGE_DIR_STATUS_NONE) {
@@ -1339,7 +1340,14 @@ KFileItem* FileViewController::findItemByFileName(const TQString& fileName) cons
//
//-----------------------------------------------------------------------------
-void FileViewController::loadMetaInfo(const KFileItemList& items) {
+void FileViewController::loadMetaInfo(const KFileItemList& items, bool forceReload) {
+ if (forceReload) {
+ // Reset metadata of all items if we want MetaInfoJob to reload it
+ for(const auto& item: items) {
+ item->setMetaInfo(KFileMetaInfo());
+ }
+ }
+
if(d->mMetaInfoTodo.isEmpty()) {
d->mMetaInfoTodo = items;
} else {
@@ -1359,10 +1367,16 @@ void FileViewController::nextMetaInfoJob() {
connect( d->mMetaInfoJob, TQ_SIGNAL(result(TDEIO::Job *)),
this, TQ_SLOT(nextMetaInfoJob()) );
connect( d->mMetaInfoJob, TQ_SIGNAL( gotMetaInfo(const KFileItem *)),
- this, TQ_SLOT(updateViewItem(const KFileItem *)) );
+ this, TQ_SLOT(updateItemMetaInfo(const KFileItem *)) );
d->mMetaInfoTodo.clear();
} else {
d->mMetaInfoJob = NULL;
+
+ // When we finished all metadata load we should update view sorting
+ // We can't do it during the item update due to performance impact
+ if (mMode!=FILE_LIST) {
+ mFileThumbnailView->sortView();
+ }
}
}
@@ -1374,4 +1388,8 @@ void FileViewController::stopMetaInfoUpdate() {
}
}
+void FileViewController::updateItemMetaInfo(const KFileItem *item) {
+ updateViewItem(item, /* metaInfoOnly = */ true);
+}
+
} // namespace