property bool isFileActivityList: false
- signal showFileActivity(string objectName, int objectId)
+ signal openFile(string filePath)
signal activityItemClicked(int index)
contentWidth: availableWidth
width: activityList.contentWidth
flickable: activityList
onClicked: {
- if (model.isCurrentUserFileActivity) {
- showFileActivity(model.objectName, model.objectId)
+ if (model.isCurrentUserFileActivity && model.openablePath) {
+ openFile("file://" + model.openablePath);
} else {
activityItemClicked(model.index)
}
\r
activeFocusOnTab: true\r
model: activityModel\r
- onShowFileActivity: {\r
- openFileActivityDialog(objectName, objectId)\r
- }\r
+ onOpenFile: Qt.openUrlExternally(filePath);\r
onActivityItemClicked: {\r
model.slotTriggerDefaultAction(index)\r
}\r
activity._dateTime = QDateTime::fromString(json.value(QStringLiteral("datetime")).toString(), Qt::ISODate);
activity._icon = json.value(QStringLiteral("icon")).toString();
activity._isCurrentUserFileActivity = activity._objectType == QStringLiteral("files") && activityUser == account->davUser();
+ activity._isMultiObjectActivity = json.value("objects").toObject().count() > 1;
auto richSubjectData = json.value(QStringLiteral("subject_rich")).toArray();
static Activity fromActivityJson(const QJsonObject &json, const AccountPtr account);
static QString relativeServerFileTypeIconPath(const QMimeType &mimeType);
+ static QString localFilePathForActivity(const Activity &activity, const AccountPtr account);
struct RichSubjectParameter {
QString type; // Required
QString _folder;
QString _file;
QString _renamedFile;
+ bool _isMultiObjectActivity;
QUrl _link;
QDateTime _dateTime;
qint64 _expireAtMsecs = -1;
auto roles = QAbstractListModel::roleNames();
roles[DisplayPathRole] = "displayPath";
roles[PathRole] = "path";
+ roles[OpenablePathRole] = "openablePath";
roles[DisplayLocationRole] = "displayLocation";
roles[LinkRole] = "link";
roles[MessageRole] = "message";
roles[DisplayActions] = "displayActions";
roles[ShareableRole] = "isShareable";
roles[IsCurrentUserFileActivityRole] = "isCurrentUserFileActivity";
+ roles[IsCurrentUserFileActivityRole] = "isCurrentUserFileActivity";
roles[ThumbnailRole] = "thumbnail";
roles[TalkNotificationConversationTokenRole] = "conversationToken";
roles[TalkNotificationMessageIdRole] = "messageId";
return getDisplayPath();
case PathRole:
return QFileInfo(getFilePath()).path();
+ case OpenablePathRole:
+ return a._isMultiObjectActivity ? QFileInfo(getFilePath()).canonicalPath() : QFileInfo(getFilePath()).canonicalFilePath();
case DisplayLocationRole:
return displayLocation();
case ActionsLinksRole: {
MessageRole,
DisplayPathRole,
PathRole,
+ OpenablePathRole,
DisplayLocationRole, // Provides the display path to a file's parent folder, relative to Nextcloud root
LinkRole,
PointInTimeRole,