diff --git a/src/plasmoid/package/contents/ui/FullRepresentation.qml b/src/plasmoid/package/contents/ui/FullRepresentation.qml index 66da2a3..86a9cae 100644 --- a/src/plasmoid/package/contents/ui/FullRepresentation.qml +++ b/src/plasmoid/package/contents/ui/FullRepresentation.qml @@ -8,6 +8,7 @@ import QtQuick.Controls import QtQuick.Layouts import "components" as Components +import org.kde.coreaddons 1.0 as KCoreAddons import org.kde.kirigami as Kirigami import org.kde.kquickcontrols import org.kde.plasma.components as PlasmaComponents3 @@ -27,7 +28,7 @@ ColumnLayout { property bool backendRunning: true property string homeDir: StandardPaths.writableLocation( StandardPaths.HomeLocation).toString().substring(7) - property string username: "" + property string username: kuser.loginName property string execName: 'kde-material-you-colors' property string execPath: "" @@ -62,6 +63,10 @@ ColumnLayout { property Item parentMain + KCoreAddons.KUser { + id: kuser + } + Connections { target: parentMain function onTogglePauseMode() { @@ -124,16 +129,9 @@ ColumnLayout { execPath = temp } - function getUsername() { - var parts = homeDir.split('/'); - if (parts.length > 2 && parts[1] === "home") { - username = parts[2]; - } - } Component.onCompleted: { findExecutablePath() - getUsername() } P5Support.DataSource {