mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Fixes crash when folder it is not set in the activity list.
Signed-off-by: Camila San <hello@camila.codes>
This commit is contained in:
parent
a1cab471e8
commit
ee612bda3a
@ -64,12 +64,14 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
|
||||
case ActivityItemDelegate::PathRole:
|
||||
if(!a._file.isEmpty()){
|
||||
auto folder = FolderMan::instance()->folder(a._folder);
|
||||
list = FolderMan::instance()->findFileInLocalFolders(folder->remotePath() + a._file, ast->account());
|
||||
QString relPath(a._file);
|
||||
if(folder) relPath.prepend(folder->remotePath());
|
||||
list = FolderMan::instance()->findFileInLocalFolders(relPath, ast->account());
|
||||
if (list.count() > 0) {
|
||||
return QVariant(list.at(0));
|
||||
}
|
||||
// File does not exist anymore? Let's try to open its path
|
||||
list = FolderMan::instance()->findFileInLocalFolders(QFileInfo(folder->remotePath() + a._file).path(), ast->account());
|
||||
list = FolderMan::instance()->findFileInLocalFolders(QFileInfo(relPath).path(), ast->account());
|
||||
if (list.count() > 0) {
|
||||
return QVariant(list.at(0));
|
||||
}
|
||||
|
||||
@ -211,6 +211,8 @@ void ActivityWidget::addError(const QString &folderAlias, const QString &message
|
||||
activity._message = folderInstance->shortGuiLocalPath();
|
||||
activity._link = folderInstance->shortGuiLocalPath();
|
||||
activity._accName = folderInstance->accountState()->account()->displayName();
|
||||
activity._folder = folderAlias;
|
||||
|
||||
|
||||
if (category == ErrorCategory::InsufficientRemoteStorage) {
|
||||
ActivityLink link;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user