mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kio: check if the currently set URL is valid before updating in KDirLister::updateDirectory()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7762ec727b
commit
db4190995a
2 changed files with 6 additions and 1 deletions
|
@ -420,6 +420,11 @@ KUrl KDirLister::url() const
|
|||
|
||||
void KDirLister::updateDirectory()
|
||||
{
|
||||
if (!d->url.isValid()) {
|
||||
// attempt to update before anything was listed or after invalid was listed
|
||||
return;
|
||||
}
|
||||
|
||||
// NOTE: no partial updates for non-local directories because the signals are bogus for
|
||||
// some KIO slaves (such as trash:/, see kde-workspace/kioslave/trash/ktrash.cpp for example)
|
||||
openUrl(d->url, d->recursive);
|
||||
|
|
|
@ -362,7 +362,7 @@ void KDirModelPrivate::_k_slotAddedItems(const KFileItemList& items)
|
|||
|
||||
KDirModelNode* result = nodeForUrl(directoryUrl); // O(depth)
|
||||
// If the directory containing the items wasn't found, then we have a big problem.
|
||||
// Are you calling KDirLister::openUrl(url,true,false)? Please use expandToUrl() instead.
|
||||
// Are you calling KDirLister::openUrl()? Please use expandToUrl() instead.
|
||||
if (!result) {
|
||||
kError(7008) << "Items emitted in directory" << directoryUrl
|
||||
<< "but that directory isn't in KDirModel!"
|
||||
|
|
Loading…
Add table
Reference in a new issue