Logo Search packages:      
Sourcecode: kmess version File versions  Download package

bool EmoticonTheme::renameEmoticon ( QString  oldShortcut,
QString  newShortcut 

Change the shortcut and the tooltip of a custom emoticon

oldShortcutThe shortcut of the emoticon to replace
newShortcutThe new shortcut for that emoticon

Definition at line 549 of file emoticontheme.cpp.

References Emoticon::getShortcuts(), Emoticon::setShortcut(), Emoticon::setTooltip(), and updateCache().

Referenced by AddEmoticonDialog::slotButtonClicked().

  // Can't remove emoticons from a standard theme
  if( ! isCustomTheme_ )
    return false;

  kmDebug() << "Renaming emoticon" << oldShortcut << "to" << newShortcut << ".";

  foreach( Emoticon *emoticon, emoticons_ )
    // This is not the emoticon we need to rename
    if( emoticon->getShortcuts().indexOf( oldShortcut ) == -1 )

    // Replace all the shortcuts with the new one
    emoticon->setShortcut( newShortcut );

    // Also update its tooltip
    emoticon->setTooltip( newShortcut );

    // Update the cache

    return true;

  return false;

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index