Commit c43777d1 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳

Rename roleNames to be lowecase

parent d90bfc9b
......@@ -71,16 +71,15 @@ void ApplicationListModel::loadSettings()
QHash<int, QByteArray> ApplicationListModel::roleNames() const
{
QHash<int, QByteArray> 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)
......
......@@ -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
......
......@@ -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)]);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment