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 6a226d94 authored by Laurent Montel's avatar Laurent Montel 😁

Allow to create item even if we didn't select a group

Bug found by david
parent ca4e1988
......@@ -374,12 +374,13 @@ bool SnippetsModel::dropMimeData(const QMimeData *data, Qt::DropAction action, i
if (column > 1) {
return false;
}
const QString encodedData = QString::fromUtf8(data->data(QStringLiteral("text/plain")));
if (!parent.isValid()) {
Q_EMIT addNewDndSnippset(encodedData);
return false;
}
SnippetItem *item = static_cast<SnippetItem *>(parent.internalPointer());
const QString encodedData = QString::fromUtf8(data->data(QStringLiteral("text/plain")));
if (item->isGroup()) {
Q_EMIT addNewDndSnippset(encodedData);
} else {
......
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