Changeset View
Changeset View
Standalone View
Standalone View
src/context/AppletModel.cpp
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | 110 | { | |||
---|---|---|---|---|---|
120 | case Mainscript: | 120 | case Mainscript: | ||
121 | return package.fileUrl("mainscript"); | 121 | return package.fileUrl("mainscript"); | ||
122 | 122 | | |||
123 | case Collapsed: | 123 | case Collapsed: | ||
124 | return Amarok::config(QStringLiteral("Context")).readEntry(package.metadata().pluginId() + "_collapsed", false); | 124 | return Amarok::config(QStringLiteral("Context")).readEntry(package.metadata().pluginId() + "_collapsed", false); | ||
125 | 125 | | |||
126 | case ContentHeight: | 126 | case ContentHeight: | ||
127 | return Amarok::config(QStringLiteral("Context")).readEntry(package.metadata().pluginId() + "_contentHeight", 300); | 127 | return Amarok::config(QStringLiteral("Context")).readEntry(package.metadata().pluginId() + "_contentHeight", 300); | ||
128 | | ||||
129 | case PackagePath: | | |||
130 | return QVariant(package.path() + "contents/"); | | |||
131 | } | 128 | } | ||
132 | 129 | | |||
133 | return QVariant(); | 130 | return QVariant(); | ||
134 | } | 131 | } | ||
135 | 132 | | |||
136 | bool Context::AppletModel::setData(const QModelIndex& index, const QVariant& value, int role) | 133 | bool Context::AppletModel::setData(const QModelIndex& index, const QVariant& value, int role) | ||
137 | { | 134 | { | ||
138 | int row = index.row(); | 135 | int row = index.row(); | ||
Show All 28 Lines | |||||
167 | QHash< int, QByteArray > AppletModel::roleNames() const | 164 | QHash< int, QByteArray > AppletModel::roleNames() const | ||
168 | { | 165 | { | ||
169 | QHash<int, QByteArray> roles; | 166 | QHash<int, QByteArray> roles; | ||
170 | roles.insert(Name, "name"); | 167 | roles.insert(Name, "name"); | ||
171 | roles.insert(Id, "appletId"); | 168 | roles.insert(Id, "appletId"); | ||
172 | roles.insert(Icon, "icon"); | 169 | roles.insert(Icon, "icon"); | ||
173 | roles.insert(Mainscript, "mainscript"); | 170 | roles.insert(Mainscript, "mainscript"); | ||
174 | roles.insert(Collapsed, "collapsed"); | 171 | roles.insert(Collapsed, "collapsed"); | ||
175 | roles.insert(PackagePath, "packagePath"); | | |||
176 | roles.insert(ContentHeight, "contentHeight"); | 172 | roles.insert(ContentHeight, "contentHeight"); | ||
177 | 173 | | |||
178 | return roles; | 174 | return roles; | ||
179 | } | 175 | } | ||
180 | 176 | | |||
181 | void AppletModel::setAppletCollapsed(const QString& id, bool collapsed) | 177 | void AppletModel::setAppletCollapsed(const QString& id, bool collapsed) | ||
182 | { | 178 | { | ||
183 | DEBUG_BLOCK | 179 | DEBUG_BLOCK | ||
▲ Show 20 Lines • Show All 183 Lines • Show Last 20 Lines |