dolphin: hide the view container message widget used directory loading starts

under some conditions it can happen that error occurs but it happens before
the directory loading completion signal is emitted and it is as if the
message is not shown, a typical case was when connecting to remote host
fails

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-03-20 07:25:43 +02:00
parent ef0bcb0ee5
commit a18ead4b58

View file

@ -104,7 +104,6 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
m_view = new DolphinView(url, this);
connect(m_view, SIGNAL(urlChanged(KUrl)), m_urlNavigator, SLOT(setLocationUrl(KUrl)));
connect(m_view, SIGNAL(urlChanged(KUrl)), m_messageWidget, SLOT(hide()));
connect(m_view, SIGNAL(directoryLoadingCompleted()), m_messageWidget, SLOT(hide()));
connect(m_view, SIGNAL(writeStateChanged(bool)), this, SIGNAL(writeStateChanged(bool)));
connect(m_view, SIGNAL(requestItemInfo(KFileItem)), this, SLOT(showItemInfo(KFileItem)));
connect(m_view, SIGNAL(itemActivated(KFileItem)), this, SLOT(slotItemActivated(KFileItem)));
@ -260,9 +259,6 @@ void DolphinViewContainer::showMessage(const QString& msg, MessageType type)
const int unwrappedWidth = m_messageWidget->sizeHint().width();
m_messageWidget->setWordWrap(unwrappedWidth > size().width());
if (m_messageWidget->isVisible()) {
m_messageWidget->hide();
}
m_messageWidget->animatedShow();
}
@ -399,6 +395,7 @@ void DolphinViewContainer::updateDirectorySortingProgress(int percent)
void DolphinViewContainer::slotDirectoryLoadingStarted()
{
m_messageWidget->hide();
if (isSearchUrl(url())) {
// Search KIO-slaves usually don't provide any progress information. Give
// a hint to the user that a searching is done: