This way we avoid repeating the return type while it is already known.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
QSize QProgressIndicator::sizeHint() const
{
- return QSize(20,20);
+ return {20, 20};
}
int QProgressIndicator::heightForWidth(int w) const
h += margin + 2 * margin + errMsgs.count() * fm.height();
}
- return QSize(0, h);
+ return {0, h};
}
int FolderStatusDelegate::rootFolderHeightWithoutErrors(const QFontMetrics &fm, const QFontMetrics &aliasFm)
QModelIndex FolderStatusModel::indexForPath(Folder *f, const QString &path) const
{
if (!f) {
- return QModelIndex();
+ return {};
}
int slashPos = path.lastIndexOf('/');
return index(j, 0, index(i));
}
}
- return QModelIndex();
+ return {};
}
}
- return QModelIndex();
+ return {};
}
auto parent = indexForPath(f, path.left(slashPos));
auto parentInfo = infoForIndex(parent);
if (!parentInfo) {
- return QModelIndex();
+ return {};
}
for (int i = 0; i < parentInfo->_subs.size(); ++i) {
if (parentInfo->_subs.at(i)._name == path.mid(slashPos + 1)) {
}
}
- return QModelIndex();
+ return {};
}
QModelIndex FolderStatusModel::index(int row, int column, const QModelIndex &parent) const
switch (classify(parent)) {
case AddButton:
case FetchLabel:
- return QModelIndex();
+ return {};
case RootFolder:
if (_folders.count() <= parent.row())
return QModelIndex(); // should not happen
case SubFolder: {
auto pinfo = static_cast<SubFolderInfo *>(parent.internalPointer());
if (pinfo->_subs.count() <= parent.row())
- return QModelIndex(); // should not happen
+ return {}; // should not happen
auto &info = pinfo->_subs[parent.row()];
if (!info.hasLabel()
&& info._subs.count() <= row)
- return QModelIndex(); // should not happen
+ return {}; // should not happen
return createIndex(row, column, &info);
}
}
- return QModelIndex();
+ return {};
}
QModelIndex FolderStatusModel::parent(const QModelIndex &child) const
{
if (!child.isValid()) {
- return QModelIndex();
+ return {};
}
switch (classify(child)) {
case RootFolder:
case AddButton:
- return QModelIndex();
+ return {};
case SubFolder:
case FetchLabel:
break;
{
QModelIndex index = QTreeView::indexAt(point);
if (index.data(FolderStatusDelegate::AddButton).toBool() && !visualRect(index).contains(point)) {
- return QModelIndex();
+ return {};
}
return index;
}
QSize GeneralSettings::sizeHint() const
{
- return QSize(ownCloudGui::settingsDialogSize().width(), QWidget::sizeHint().height());
+ return {
+ ownCloudGui::settingsDialogSize().width(),
+ QWidget::sizeHint().height()
+ };
}
void GeneralSettings::loadMiscSettings()
QSize NetworkSettings::sizeHint() const
{
- return QSize(ownCloudGui::settingsDialogSize().width(), QWidget::sizeHint().height());
+ return {
+ ownCloudGui::settingsDialogSize().width(),
+ QWidget::sizeHint().height()
+ };
}
void NetworkSettings::loadProxySettings()
pixmapSize.setWidth(std::max(pixmap.width(), pixmapSize.width()));
pixmapSize.setHeight(std::max(pixmap.height(), pixmapSize.height()));
}
- return QSize(std::max(labelSize.width(), pixmapSize.width()), labelSize.height() + Spacing + pixmapSize.height());
+ return {
+ std::max(labelSize.width(), pixmapSize.width()),
+ labelSize.height() + Spacing + pixmapSize.height()
+ };
}
void SlideShow::startShow(int interval)
if (it != _csync_ctx->remote.files.end()) {
return it->second->remotePerm;
}
- return RemotePermissions();
+ return {};
}
void SyncEngine::restoreOldFiles(SyncFileItemVector &syncItems)
if (_syncEngine->excludedFiles().isExcluded(_syncEngine->localPath() + relativePath,
_syncEngine->localPath(),
_syncEngine->ignoreHiddenFiles())) {
- return SyncFileStatus(SyncFileStatus::StatusWarning);
+ return SyncFileStatus::StatusWarning;
}
if (_dirtyPaths.contains(relativePath))
QColor Theme::wizardHeaderTitleColor() const
{
- return QColor(APPLICATION_WIZARD_HEADER_TITLE_COLOR);
+ return {APPLICATION_WIZARD_HEADER_TITLE_COLOR};
}
QColor Theme::wizardHeaderBackgroundColor() const
{
- return QColor(APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR);
+ return {APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR};
}
QPixmap Theme::wizardHeaderLogo() const
QColor Theme::getBackgroundAwareLinkColor(const QColor &backgroundColor)
{
- return QColor((isDarkColor(backgroundColor) ? QColor("#6193dc") : QGuiApplication::palette().color(QPalette::Link)));
+ return {(isDarkColor(backgroundColor) ? QColor("#6193dc") : QGuiApplication::palette().color(QPalette::Link))};
}
QColor Theme::getBackgroundAwareLinkColor()
if (QFileInfo(at(i)[0].toString()) == file)
return at(i)[1].value<SyncFileStatus>();
}
- return SyncFileStatus();
+ return {};
}
bool statusEmittedBefore(const QString &firstPath, const QString &secondPath) const {