Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 4ddd665f authored by Laurent Montel's avatar Laurent Montel 😁

Allow to edit attachment name

parent da585c5e
......@@ -324,7 +324,7 @@ bool AttachmentModel::setData(const QModelIndex &index, const QVariant &value, i
bool emitDataChanged = true;
AttachmentPart::Ptr part = d->parts[ index.row() ];
if (role == Qt::DisplayRole) {
if (role == Qt::EditRole) {
switch (index.column()) {
case NameColumn:
if (!value.toString().isEmpty()) {
......@@ -434,11 +434,14 @@ Qt::ItemFlags AttachmentModel::flags(const QModelIndex &index) const
return Qt::ItemIsDropEnabled | defaultFlags;
}
if (index.column() == CompressColumn
|| index.column() == EncryptColumn
|| index.column() == SignColumn
|| index.column() == AutoDisplayColumn) {
return Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsUserCheckable | defaultFlags;
} else if (index.column() == NameColumn) {
return Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEditable | defaultFlags;
} else {
return Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | defaultFlags;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment