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

« back to all changes in this revision

Viewing changes to service/ItemStore.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:
279
279
}
280
280
 
281
281
QString ItemStore::executeParameterized(unsigned long long commandId,
282
 
                QString &baseAction, QDBusObjectPath &actionPath,
 
282
                QString &prefix, QString &baseAction, QDBusObjectPath &actionPath,
283
283
                QDBusObjectPath &modelPath) {
284
284
 
285
285
        Item::Ptr item(m_items[commandId]);
297
297
                return QString();
298
298
        }
299
299
 
300
 
        baseAction = action->property("actionName").toString();
 
300
        QString name = action->property("actionName").toString();
 
301
        int index = name.indexOf( '.' );
 
302
        if (index == -1) {
 
303
                baseAction = name;
 
304
        } else {
 
305
                prefix = name.left(index);
 
306
                baseAction = name.right(name.size() - index - 1);
 
307
        }
 
308
 
301
309
        actionPath = QDBusObjectPath(action->property("actionsPath").toString());
302
310
        modelPath = QDBusObjectPath(action->property("menuPath").toString());
303
311