khotkeys: do not rely on QString operator

aside from fixing the build against Katie it removes the need to convert
the QUuid to QString multiple times by storing it as QString. that also
saves a conversion when _uuid it overriden from the object name but that's
just a bonus.

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2016-05-31 16:02:04 +00:00
parent c1e6ba7aca
commit 274568b838
3 changed files with 4 additions and 4 deletions

View file

@ -70,7 +70,7 @@ KAction *ShortcutsHandler::addAction(
if (_actions->action(id))
{
qDebug() << id << " already present. Using new id!";
realId = QUuid::createUuid();
realId = QUuid::createUuid().toString();
}
// Create the action

View file

@ -38,7 +38,7 @@ ShortcutTrigger::ShortcutTrigger(
const KShortcut& shortcut,
const QUuid &uuid )
: Trigger( data_P ),
_uuid(uuid),
_uuid(uuid.toString()),
_active(false),
_shortcut(shortcut)
{
@ -122,7 +122,7 @@ void ShortcutTrigger::cfg_write( KConfigGroup& cfg_P ) const
base::cfg_write( cfg_P );
cfg_P.writeEntry( "Key", shortcut().toString());
cfg_P.writeEntry( "Type", "SHORTCUT" ); // overwrites value set in base::cfg_write()
cfg_P.writeEntry( "Uuid", _uuid.toString() );
cfg_P.writeEntry( "Uuid", _uuid );
}

View file

@ -196,7 +196,7 @@ class KDE_EXPORT ShortcutTrigger
private:
//! A persistent identifier for this shortcut
QUuid _uuid;
QString _uuid;
//! Are the conditions met?
bool _active;