switch(role) {
case Qt::DisplayRole:
if (x->_hasError) {
- return tr("Error while loading the list of folders from the server.");
+ return QVariant(tr("Error while loading the list of folders from the server.")
+ + QString("\n") + x->_lastErrorString);
} else {
return tr("Fetching folder list from server...");
}
auto info = infoForIndex(parent);
if (!info || info->_fetched || info->_fetching)
return false;
+ if (info->_hasError) {
+ // Keep showing the error to the user, it will be hidden when the account reconnects
+ return false;
+ }
return true;
}
if (parentInfo->hasLabel()) {
beginRemoveRows(idx, 0 ,0);
+ parentInfo->_lastErrorString.clear();
parentInfo->_hasError = false;
parentInfo->_fetchingLabel = false;
endRemoveRows();
}
auto parentInfo = infoForIndex(idx);
if (parentInfo) {
+ qDebug() << r->errorString();
+ parentInfo->_lastErrorString = r->errorString();
+
if (r->error() == QNetworkReply::ContentNotFoundError) {
parentInfo->_fetched = true;
} else {
bool _fetched; // If we did the LSCOL for this folder already
bool _fetching; // Whether a LSCOL job is currently running
bool _hasError; // If the last fetching job ended in an error
+ QString _lastErrorString;
bool _fetchingLabel; // Whether a 'fetching in progress' label is shown.
bool _isUndecided; // undecided folders are the big folders that the user has not accepted yet