mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-22 13:44:34 +03:00
[CSE] Add new method "infoForFolderId"
we need to query the model for the subfolderinfo, but we don't have the model index, we have the folder id. this returns it.
This commit is contained in:
parent
c592871f94
commit
82c07236c1
2 changed files with 13 additions and 1 deletions
|
@ -396,6 +396,18 @@ FolderStatusModel::SubFolderInfo *FolderStatusModel::infoForIndex(const QModelIn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FolderStatusModel::SubFolderInfo *FolderStatusModel::infoForFileId(const QByteArray& fileId) const
|
||||||
|
{
|
||||||
|
for(int i = 0, end = _folders.size(); i < end; i++) {
|
||||||
|
auto *info = const_cast<SubFolderInfo *>(&_folders[i]);
|
||||||
|
if (info->_fileId == fileId) {
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
QModelIndex FolderStatusModel::indexForPath(Folder *f, const QString &path) const
|
QModelIndex FolderStatusModel::indexForPath(Folder *f, const QString &path) const
|
||||||
{
|
{
|
||||||
if (!f) {
|
if (!f) {
|
||||||
|
|
|
@ -120,7 +120,7 @@ public:
|
||||||
FetchLabel };
|
FetchLabel };
|
||||||
ItemType classify(const QModelIndex &index) const;
|
ItemType classify(const QModelIndex &index) const;
|
||||||
SubFolderInfo *infoForIndex(const QModelIndex &index) const;
|
SubFolderInfo *infoForIndex(const QModelIndex &index) const;
|
||||||
|
SubFolderInfo *infoForFileId(const QByteArray &fileId) const;
|
||||||
// If the selective sync check boxes were changed
|
// If the selective sync check boxes were changed
|
||||||
bool isDirty() { return _dirty; }
|
bool isDirty() { return _dirty; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue