diff --git a/containments/homescreen/applicationlistmodel.cpp b/containments/homescreen/applicationlistmodel.cpp index 443cad94..ab8638b3 100644 --- a/containments/homescreen/applicationlistmodel.cpp +++ b/containments/homescreen/applicationlistmodel.cpp @@ -71,16 +71,15 @@ void ApplicationListModel::loadSettings() QHash ApplicationListModel::roleNames() const { - QHash roleNames; - roleNames[ApplicationNameRole] = "ApplicationNameRole"; - roleNames[ApplicationIconRole] = "ApplicationIconRole"; - roleNames[ApplicationStorageIdRole] = "ApplicationStorageIdRole"; - roleNames[ApplicationEntryPathRole] = "ApplicationEntryPathRole"; - roleNames[ApplicationOriginalRowRole] = "ApplicationOriginalRowRole"; - roleNames[ApplicationStartupNotifyRole] = "ApplicationStartupNotifyRole"; - roleNames[ApplicationLocationRole] = "ApplicationLocationRole"; - - return roleNames; + return { + {ApplicationNameRole, QByteArrayLiteral("applicationName")}, + {ApplicationIconRole, QByteArrayLiteral("applicationIcon")}, + {ApplicationStorageIdRole, QByteArrayLiteral("applicationStorageId")}, + {ApplicationEntryPathRole, QByteArrayLiteral("applicationEntryPath")}, + {ApplicationOriginalRowRole, QByteArrayLiteral("applicationOriginalRow")}, + {ApplicationStartupNotifyRole, QByteArrayLiteral("applicationStartupNotify")}, + {ApplicationLocationRole, QByteArrayLiteral("applicationLocation")} + }; } void ApplicationListModel::sycocaDbChanged(const QStringList &changes) diff --git a/containments/homescreen/package/contents/ui/launcher/Delegate.qml b/containments/homescreen/package/contents/ui/launcher/Delegate.qml index 2fd9b869..3b51d8c7 100644 --- a/containments/homescreen/package/contents/ui/launcher/Delegate.qml +++ b/containments/homescreen/package/contents/ui/launcher/Delegate.qml @@ -42,7 +42,7 @@ ContainmentLayoutManager.ItemContainer { opacity: dragActive ? 0.4 : 1 - key: model.ApplicationStorageIdRole + key: model.applicationStorageId property real dragCenterX property real dragCenterY property alias iconItem: icon @@ -118,7 +118,7 @@ ContainmentLayoutManager.ItemContainer { Layout.preferredHeight: Layout.minimumHeight usesPlasmaTheme: false - source: modelData ? modelData.ApplicationIconRole : "" + source: modelData ? modelData.applicationIcon : "" Behavior on scale { NumberAnimation { duration: units.longDuration @@ -141,13 +141,13 @@ ContainmentLayoutManager.ItemContainer { maximumLineCount: 2 elide: Text.ElideRight - text: model.ApplicationNameRole + text: model.applicationName //FIXME: export smallestReadableFont font.pointSize: theme.defaultFont.pointSize * 0.9 - color: "white"//model.ApplicationLocationRole == ApplicationListModel.Desktop ? "white" : theme.textColor + color: "white"//model.applicationLocation == ApplicationListModel.Desktop ? "white" : theme.textColor - layer.enabled: true//model.ApplicationLocationRole == ApplicationListModel.Desktop + layer.enabled: true//model.applicationLocation == ApplicationListModel.Desktop layer.effect: DropShadow { horizontalOffset: 0 verticalOffset: 2 diff --git a/containments/homescreen/package/contents/ui/launcher/LauncherGrid.qml b/containments/homescreen/package/contents/ui/launcher/LauncherGrid.qml index eb783900..69787b58 100644 --- a/containments/homescreen/package/contents/ui/launcher/LauncherGrid.qml +++ b/containments/homescreen/package/contents/ui/launcher/LauncherGrid.qml @@ -51,7 +51,7 @@ LauncherContainer { parent: parentFromLocation property Item parentFromLocation: { - switch (model.ApplicationLocationRole) { + switch (model.applicationLocation) { case ApplicationListModel.Desktop: return appletsLayout; case ApplicationListModel.Favorites: @@ -61,7 +61,7 @@ LauncherContainer { } } Component.onCompleted: { - if (model.ApplicationLocationRole == ApplicationListModel.Desktop) { + if (model.applicationLocation === ApplicationListModel.Desktop) { appletsLayout.restoreItem(delegate); } } @@ -79,10 +79,10 @@ LauncherContainer { onParentFromLocationChanged: { if (!launcherDragManager.active && parent != parentFromLocation) { parent = parentFromLocation; - if (model.ApplicationLocationRole == ApplicationListModel.Favorites) { + if (model.applicationLocation === ApplicationListModel.Favorites) { plasmoid.nativeInterface.stackBefore(delegate, parentFromLocation.children[index]); - } else if (model.ApplicationLocationRole == ApplicationListModel.Grid) { + } else if (model.applicationLocation === ApplicationListModel.Grid) { plasmoid.nativeInterface.stackBefore(delegate, parentFromLocation.children[Math.max(0, index - plasmoid.nativeInterface.applicationListModel.favoriteCount)]); } }