FIX(client): Clear shortcut data also for user-types

Up to now the logic for clearing shortcut data upon a change in the
shortcut config window was to see if the type() of the current data
matches that of the shortcut's default data. However, for user-defined
types QVariant::type() always returns QVariant::UserType and thus
different user-defined types could not be distinguished.

If we instead use QVariant::userType(), this problem does no longer
exist.
This commit is contained in:
Robert Adam 2022-09-09 12:57:15 +02:00
parent 7c08eaba1e
commit a8b98487d4

View File

@ -665,7 +665,7 @@ void GlobalShortcutConfig::on_qtwShortcuts_itemChanged(QTreeWidgetItem *item, in
sc.bSuppress = item->checkState(3) == Qt::Checked;
const ::GlobalShortcut *gs = GlobalShortcutEngine::engine->qmShortcuts.value(sc.iIndex);
if (gs && sc.qvData.type() != gs->qvDefault.type()) {
if (gs && sc.qvData.userType() != gs->qvDefault.userType()) {
item->setData(1, Qt::DisplayRole, gs->qvDefault);
}
}