dolphin: adjust to KDirLister changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-07-03 13:38:25 +03:00
parent 8040340e8b
commit 0ccc580f03
5 changed files with 6 additions and 21 deletions

View file

@ -120,11 +120,6 @@ void KFileItemModel::loadDirectory(const KUrl& url)
m_dirLister->openUrl(url); m_dirLister->openUrl(url);
} }
void KFileItemModel::refreshDirectory(const KUrl& url)
{
m_dirLister->openUrl(url, KDirLister::Reload);
}
KUrl KFileItemModel::directory() const KUrl KFileItemModel::directory() const
{ {
return m_dirLister->url(); return m_dirLister->url();

View file

@ -58,12 +58,6 @@ public:
*/ */
void loadDirectory(const KUrl& url); void loadDirectory(const KUrl& url);
/**
* Throws away all currently loaded items and refreshes the directory
* by reloading all items again.
*/
void refreshDirectory(const KUrl& url);
/** /**
* @return Parent directory of the items that are shown. In case * @return Parent directory of the items that are shown. In case
* if a directory tree is shown, KFileItemModel::dir() returns * if a directory tree is shown, KFileItemModel::dir() returns
@ -74,7 +68,7 @@ public:
/** /**
* Cancels the loading of a directory which has been started by either * Cancels the loading of a directory which has been started by either
* loadDirectory() or refreshDirectory(). * loadDirectory().
*/ */
void cancelDirectoryLoading(); void cancelDirectoryLoading();

View file

@ -25,10 +25,10 @@
#include <QSet> #include <QSet>
#include <QQueue> #include <QQueue>
#include <QString>
class KDirWatch; class KDirWatch;
class KFileItemModel; class KFileItemModel;
#include <QString>
class KDirectoryContentsCounter : public QObject class KDirectoryContentsCounter : public QObject
{ {

View file

@ -460,7 +460,7 @@ void DolphinView::reload()
m_selectedUrls = itemList.urlList(); m_selectedUrls = itemList.urlList();
setUrl(url()); setUrl(url());
loadDirectory(url(), true); loadDirectory(url());
QDataStream restoreStream(viewState); QDataStream restoreStream(viewState);
restoreState(restoreStream); restoreState(restoreStream);
@ -1429,7 +1429,7 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con
} }
} }
void DolphinView::loadDirectory(const KUrl& url, bool reload) void DolphinView::loadDirectory(const KUrl& url)
{ {
if (!url.isValid()) { if (!url.isValid()) {
const QString location(url.pathOrUrl()); const QString location(url.pathOrUrl());
@ -1441,11 +1441,7 @@ void DolphinView::loadDirectory(const KUrl& url, bool reload)
return; return;
} }
if (reload) {
m_model->refreshDirectory(url);
} else {
m_model->loadDirectory(url); m_model->loadDirectory(url);
}
} }
void DolphinView::applyViewProperties() void DolphinView::applyViewProperties()

View file

@ -679,7 +679,7 @@ private slots:
void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const; void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const;
private: private:
void loadDirectory(const KUrl& url, bool reload = false); void loadDirectory(const KUrl& url);
/** /**
* Applies the view properties which are defined by the current URL * Applies the view properties which are defined by the current URL