@@ -2031,7 +2031,6 @@ QString Core::checkShortcut(const QString &shortcut, X11Shortcut &X11shortcut)
2031
2031
QPair<QString, qulonglong> Core::addOrRegisterClientAction (const QString &shortcut, const QDBusObjectPath &path, const QString &description, const QString &sender)
2032
2032
{
2033
2033
X11Shortcut X11shortcut;
2034
-
2035
2034
QString newShortcut = checkShortcut (shortcut, X11shortcut);
2036
2035
// if (newShortcut.isEmpty())
2037
2036
// {
@@ -2054,25 +2053,24 @@ QPair<QString, qulonglong> Core::addOrRegisterClientAction(const QString &shortc
2054
2053
mIdsByShortcut [newShortcut].insert (id);
2055
2054
}
2056
2055
2057
- dynamic_cast <ClientAction*>(shortcutAndAction.second )->appeared (QDBusConnection::sessionBus (), sender);
2056
+ auto action = static_cast <ClientAction*>(shortcutAndAction.second );
2057
+ action->appeared (QDBusConnection::sessionBus (), sender);
2058
2058
2059
2059
return qMakePair (newShortcut, id);
2060
2060
}
2061
2061
2062
2062
qulonglong id = ++mLastId ;
2063
-
2064
2063
if (!sender.isEmpty () && !newShortcut.isEmpty ())
2065
2064
{
2066
2065
newShortcut = grabOrReuseKey (X11shortcut, newShortcut);
2067
2066
mIdsByShortcut [newShortcut].insert (id);
2068
2067
}
2069
2068
2070
2069
mIdByClientPath [path] = id;
2071
- ClientAction * clientAction = sender.isEmpty () ? new ClientAction (this , path, description) : new ClientAction (this , QDBusConnection::sessionBus (), sender, path, description);
2070
+ auto clientAction = sender.isEmpty () ? new ClientAction (this , path, description) : new ClientAction (this , QDBusConnection::sessionBus (), sender, path, description);
2072
2071
mShortcutAndActionById [id] = qMakePair<QString, BaseAction *>(newShortcut, clientAction);
2073
2072
2074
2073
log (LOG_INFO, " addClientAction shortcut:'%s' id:%llu" , qPrintable (newShortcut), id);
2075
-
2076
2074
return qMakePair (newShortcut, id);
2077
2075
}
2078
2076
@@ -2125,7 +2123,8 @@ qulonglong Core::registerClientAction(const QString &shortcut, const QDBusObject
2125
2123
2126
2124
QMutexLocker lock (&mDataMutex );
2127
2125
2128
- return addOrRegisterClientAction (shortcut, path, description, QString ()).second ;
2126
+ auto action = addOrRegisterClientAction (shortcut, path, description, QString ());
2127
+ return action.second ;
2129
2128
}
2130
2129
2131
2130
void Core::addMethodAction (QPair<QString, qulonglong> &result, const QString &shortcut, const QString &service, const QDBusObjectPath &path, const QString &interface, const QString &method, const QString &description)
0 commit comments