QString itemString = qvariant_cast<QString>(index.data(SyncProgressItemString));
int warningCount = qvariant_cast<int>(index.data(WarningCount));
bool syncOngoing = qvariant_cast<bool>(index.data(SyncRunning));
-
- // QString statusText = qvariant_cast<QString>(index.data(FolderStatus));
- bool syncEnabled = index.data(FolderAccountConnected).toBool();
- // QString syncStatus = syncEnabled? tr( "Enabled" ) : tr( "Disabled" );
+ bool syncEnabled = qvariant_cast<bool>(index.data(FolderAccountConnected));
QRect iconRect = option.rect;
QRect aliasRect = option.rect;
painter->restore();
{
+ QRect rectWithoutErrors = option.rect;
+ rectWithoutErrors.setTop(iconRect.top());
+ rectWithoutErrors.setBottom(iconRect.bottom());
QStyleOptionToolButton btnOpt;
//btnOpt.text = QLatin1String("...");
btnOpt.state = option.state;
btnOpt.state |= QStyle::State_Raised;
btnOpt.arrowType = Qt::NoArrow;
btnOpt.subControls = QStyle::SC_ToolButton;
- btnOpt.rect = optionsButtonRect(option.rect);
+ btnOpt.rect = optionsButtonRect(rectWithoutErrors);
btnOpt.icon = m_moreIcon;
btnOpt.iconSize = btnOpt.rect.size();
QApplication::style()->drawComplexControl( QStyle::CC_ToolButton, &btnOpt, painter );
switch (role) {
case FolderStatusDelegate::FolderPathRole : return f->shortGuiPath();
case FolderStatusDelegate::FolderSecondPathRole : return f->remotePath();
+ case FolderStatusDelegate::FolderErrorMsg : return f->syncResult().errorStrings();
+ case FolderStatusDelegate::SyncRunning : return f->syncResult().status() == SyncResult::SyncRunning;
case FolderStatusDelegate::HeaderRole : return f->aliasGui();
case FolderStatusDelegate::FolderAliasRole : return f->alias();
case FolderStatusDelegate::FolderSyncPaused : return f->syncPaused();
if( ! folder ) return;
for (int i = 0; i < _folders.count(); ++i) {
if (_folders.at(i)._folder == folder) {
- emit dataChanged(index(i), index(i),
- QVector<int>() << FolderStatusDelegate::FolderStatus);
+ emit dataChanged(index(i), index(i));
}
}
}
// Reset the progress info after a sync.
_folders[folderIndex]._progress = SubFolderInfo::Progress();
} else if (state == SyncResult::Error) {
- _folders[folderIndex]._progress._progressString = f->syncResult().errorString();
+ _folders[folderIndex]._progress = SubFolderInfo::Progress();
}
// update the icon etc. now