From bf0861baf08e739ab3721d642178dbab64015675 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Fri, 16 Jan 2015 12:35:56 +0900 Subject: Added required refreshItems logic. This relates to bug 146. Signed-off-by: Michele Calgaro --- libkonq/konq_dirpart.cc | 13 +++++++++---- libkonq/konq_dirpart.h | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 6 deletions(-) (limited to 'libkonq') diff --git a/libkonq/konq_dirpart.cc b/libkonq/konq_dirpart.cc index 602496b7c..030cc90a9 100644 --- a/libkonq/konq_dirpart.cc +++ b/libkonq/konq_dirpart.cc @@ -440,20 +440,25 @@ void KonqDirPart::updatePasteAction() // KDE4: merge into method above emit m_extension->enableAction( "paste", paste ); } -void KonqDirPart::newItems( const KFileItemList & entries ) +void KonqDirPart::newItems(const KFileItemList &entries) { d->dirSizeDirty = true; if ( m_findPart ) { emitTotalCount(); } - emit itemsAdded( entries ); + emit itemsAdded(entries); } -void KonqDirPart::deleteItem( KFileItem * fileItem ) +void KonqDirPart::deleteItem(KFileItem * fileItem) { d->dirSizeDirty = true; - emit itemRemoved( fileItem ); + emit itemRemoved(fileItem); +} + +void KonqDirPart::refreshItems(const KFileItemList &entries) +{ + emit itemsRefresh(entries); } void KonqDirPart::emitTotalCount() diff --git a/libkonq/konq_dirpart.h b/libkonq/konq_dirpart.h index 6b24bf9c5..4a8d82cca 100644 --- a/libkonq/konq_dirpart.h +++ b/libkonq/konq_dirpart.h @@ -128,6 +128,11 @@ public: */ void deleteItem( KFileItem * fileItem ); + /** + * Refresh the items + */ + void refreshItems(const KFileItemList &entries); + /** * Show the counts for the directory in the status bar */ @@ -220,13 +225,19 @@ signals: * Emitted as the part is updated with new items. * Useful for informing plugins of changes in view. */ - void itemsAdded( const KFileItemList& ); + void itemsAdded(const KFileItemList &); /** * Emitted as the part is updated with these items. * Useful for informing plugins of changes in view. */ - void itemRemoved( const KFileItem* ); + void itemRemoved(const KFileItem *); + + /** + * Emitted when items need to be refreshed (for example when + * a file is renamed) + */ + void itemsRefresh(const KFileItemList &); /** * Emitted with the list of filtered-out items whenever -- cgit v1.2.1