diff --git a/containments/desktop/package/contents/ui/FolderView.qml b/containments/desktop/package/contents/ui/FolderView.qml --- a/containments/desktop/package/contents/ui/FolderView.qml +++ b/containments/desktop/package/contents/ui/FolderView.qml @@ -503,8 +503,6 @@ + (3 * units.smallSpacing) + (2 * units.largeSpacing)); } - model: positioner - delegate: FolderItemDelegate { width: gridView.cellWidth height: gridView.cellHeight @@ -958,6 +956,19 @@ previews: plasmoid.configuration.previews previewPlugins: plasmoid.configuration.previewPlugins + onListingStarted: { + if (!gridView.model) { + plasmoid.busy = true; + } + } + + onListingCompleted: { + if (!gridView.model) { + plasmoid.busy = false; + gridView.model = positioner; + } + } + onMove: { var rows = (gridView.flow == GridView.FlowLeftToRight); var axis = rows ? gridView.width : gridView.height; diff --git a/containments/desktop/plugins/folder/foldermodel.h b/containments/desktop/plugins/folder/foldermodel.h --- a/containments/desktop/plugins/folder/foldermodel.h +++ b/containments/desktop/plugins/folder/foldermodel.h @@ -60,6 +60,7 @@ Q_SIGNALS: void error(const QString &string); + void completed(); protected: void handleError(KIO::Job *job); @@ -212,6 +213,8 @@ Q_SIGNALS: void urlChanged() const; + void listingStarted() const; + void listingCompleted() const; void iconNameChanged() const; void resolvedUrlChanged() const; void errorStringChanged() const; diff --git a/containments/desktop/plugins/folder/foldermodel.cpp b/containments/desktop/plugins/folder/foldermodel.cpp --- a/containments/desktop/plugins/folder/foldermodel.cpp +++ b/containments/desktop/plugins/folder/foldermodel.cpp @@ -62,6 +62,8 @@ #include #include +#include +#include #include #include #include @@ -115,6 +117,9 @@ dirLister->setAutoErrorHandlingEnabled(false, 0); connect(dirLister, &DirLister::error, this, &FolderModel::dirListFailed); connect(dirLister, &KCoreDirLister::itemsDeleted, this, &FolderModel::evictFromIsDirCache); + connect(dirLister, &KCoreDirLister::started, this, &FolderModel::listingStarted); + void (KCoreDirLister::*myCompletedSignal)() = &KCoreDirLister::completed; + QObject::connect(dirLister, myCompletedSignal, this, &FolderModel::listingCompleted); m_dirModel = new KDirModel(this); m_dirModel->setDirLister(dirLister);