17 #include "appdrawermodel.h" 18 #include "ualwrapper.h" 23 AppDrawerModel::AppDrawerModel(QObject *parent):
24 AppDrawerModelInterface(parent)
26 Q_FOREACH (
const QString &appId, UalWrapper::installedApps()) {
27 UalWrapper::AppInfo info = UalWrapper::getApplicationInfo(appId);
29 qWarning() <<
"Failed to get app info for app" << appId;
32 m_list.append(
new LauncherItem(appId, info.name, info.icon,
this));
33 m_list.last()->setKeywords(info.keywords);
35 qsrand(QDateTime::currentMSecsSinceEpoch() / 100);
38 int AppDrawerModel::rowCount(
const QModelIndex &parent)
const 41 return m_list.count();
44 QVariant AppDrawerModel::data(const QModelIndex &index,
int role)
const 48 return m_list.at(index.row())->appId();
50 return m_list.at(index.row())->name();
52 return m_list.at(index.row())->icon();
54 return m_list.at(index.row())->keywords();