~unity-api-team/hud/test-failures

« back to all changes in this revision

Viewing changes to libqtgmenu/internal/QtGMenuUtils.cpp

  • Committer: Pete Woods
  • Date: 2014-03-19 23:26:48 UTC
  • Revision ID: pete.woods@canonical.com-20140319232648-c1nhfkfnvgg11xm2
Prefix handling should be more robust

Show diffs side-by-side

added added

removed removed

Lines of Context:
229
229
 
230
230
  return QKeySequence::fromString( shortcut );
231
231
}
 
232
 
 
233
QPair<QString, QString> QtGMenuUtils::splitPrefixAndName( const QString& name )
 
234
{
 
235
  int index = name.indexOf( '.' );
 
236
 
 
237
  if( index == -1 )
 
238
  {
 
239
    return qMakePair(QString(), name);
 
240
  }
 
241
  else
 
242
  {
 
243
    return qMakePair(name.left( index ), name.right( name.size() - index - 1 ));
 
244
  }
 
245
}