summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5ebc6b8)
Rather than "Folder empty", which is misleading as we didn't
actually load anything.
m_assureVisibleCurrentIndex(false),
m_isFolderWritable(true),
m_dragging(false),
m_assureVisibleCurrentIndex(false),
m_isFolderWritable(true),
m_dragging(false),
m_url(url),
m_viewPropertiesContext(),
m_mode(DolphinView::IconsView),
m_url(url),
m_viewPropertiesContext(),
m_mode(DolphinView::IconsView),
void DolphinView::slotDirectoryLoadingStarted()
{
void DolphinView::slotDirectoryLoadingStarted()
{
+ m_loadingState = LoadingState::Loading;
updatePlaceholderLabel();
// Disable the writestate temporary until it can be determined in a fast way
updatePlaceholderLabel();
// Disable the writestate temporary until it can be determined in a fast way
void DolphinView::slotDirectoryLoadingCompleted()
{
void DolphinView::slotDirectoryLoadingCompleted()
{
+ m_loadingState = LoadingState::Completed;
// Update the view-state. This has to be done asynchronously
// because the view might not be in its final state yet.
// Update the view-state. This has to be done asynchronously
// because the view might not be in its final state yet.
void DolphinView::slotDirectoryLoadingCanceled()
{
void DolphinView::slotDirectoryLoadingCanceled()
{
+ m_loadingState = LoadingState::Canceled;
updatePlaceholderLabel();
updatePlaceholderLabel();
+ if (m_loadingState == LoadingState::Loading) {
m_placeholderLabel->setVisible(false);
m_showLoadingPlaceholderTimer->start();
return;
}
m_placeholderLabel->setVisible(false);
m_showLoadingPlaceholderTimer->start();
return;
}
- if (!nameFilter().isEmpty()) {
+ if (m_loadingState == LoadingState::Canceled) {
+ m_placeholderLabel->setText(i18n("Loading canceled"));
+ } else if (!nameFilter().isEmpty()) {
m_placeholderLabel->setText(i18n("No items matching the filter"));
} else if (m_url.scheme() == QLatin1String("baloosearch") || m_url.scheme() == QLatin1String("filenamesearch")) {
m_placeholderLabel->setText(i18n("No items matching the search"));
m_placeholderLabel->setText(i18n("No items matching the filter"));
} else if (m_url.scheme() == QLatin1String("baloosearch") || m_url.scheme() == QLatin1String("filenamesearch")) {
m_placeholderLabel->setText(i18n("No items matching the search"));
bool m_isFolderWritable;
bool m_dragging; // True if a dragging is done. Required to be able to decide whether a
// tooltip may be shown when hovering an item.
bool m_isFolderWritable;
bool m_dragging; // True if a dragging is done. Required to be able to decide whether a
// tooltip may be shown when hovering an item.
+
+ enum class LoadingState {
+ Idle,
+ Loading,
+ Canceled,
+ Completed
+ };
+ LoadingState m_loadingState = LoadingState::Idle;
QUrl m_url;
QString m_viewPropertiesContext;
QUrl m_url;
QString m_viewPropertiesContext;