plasma: remove bogus status notifier item animation feature

AttentionMovieName is not valid property of the org.kde.StatusNotifierItem
interface, see:
kdelibs/kdeui/notifications/kstatusnotifieritemdbus_p.h

it is in the interface file:
kdeui/notifications/org.kde.StatusNotifierItem.xml

but not implemented in the D-Bus interface

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-09-28 16:59:19 +03:00
parent 1a1da76fd2
commit dc50956578
4 changed files with 2 additions and 68 deletions

View file

@ -39,7 +39,6 @@ Item {
property variant __icon: __has_task ? task.icon : QIcon("default")
property variant __att_icon: __has_task ? task.attIcon : __getDefaultIcon()
property string __overlay_icon_name: __has_task ? task.overlayIconName : ""
property string __movie_path: __has_task ? task.moviePath : ""
property int __status: __has_task ? task.status : UnknownStatus
//Hack for activating only items that has been clicked by ourselves
property variant __clickTime: 0;
@ -154,18 +153,6 @@ Item {
plasmoid.destroyShortcutAction(act)
}
}
// Animation (Movie icon)
AnimatedImage {
id: animation
anchors.fill: parent
playing: false
visible: false
smooth: true
source: __movie_path
}
}
onWheelMoved: {
if (wheel.orientation === Qt.Horizontal)
@ -217,11 +204,6 @@ Item {
source: __getDefaultIcon()
visible: true
}
PropertyChanges {
target: animation
visible: false
playing: false
}
StateChangeScript {
script: tooltip.target = icon_widget // binding to property doesn't work
}
@ -229,7 +211,7 @@ Item {
// Attention icon
State {
name: "__BLINK"
when: __status === NeedsAttention && !__movie_path
when: __status === NeedsAttention
PropertyChanges {
target: icon_widget
source: __getAttentionIcon()
@ -240,36 +222,9 @@ Item {
running: true
is_att_icon: false
}
PropertyChanges {
target: animation
visible: false
playing: false
}
StateChangeScript {
script: tooltip.target = icon_widget
}
},
// Animation icon
State {
name: "__ANIM"
when: __status === NeedsAttention && __movie_path
PropertyChanges {
target: timer_blink
running: false
}
PropertyChanges {
target: icon_widget
source: __getDefaultIcon()
visible: false
}
PropertyChanges {
target: animation
visible: true
playing: true
}
StateChangeScript {
script: tooltip.target = animation
}
}
]

View file

@ -284,12 +284,10 @@ void DBusSystemTrayTask::syncIcons(const Plasma::DataEngine::Data &properties)
QString icon_name = properties["IconName"].toString();
QString att_icon_name = properties["AttentionIconName"].toString();
QString movie_path = properties["AttentionMovieName"].toString();
QString overlay_icon_name = properties["OverlayIconName"].value<QString>();
QString icon_theme_path = properties["IconThemePath"].value<QString>();
bool is_icon_name_changed = false;
bool is_att_icon_name_changed = false;
bool is_movie_path_changed = false;
bool is_overlay_icon_name_changed = false;
if (icon_name != m_iconName) {
@ -302,15 +300,6 @@ void DBusSystemTrayTask::syncIcons(const Plasma::DataEngine::Data &properties)
is_att_icon_name_changed = true;
}
if (!movie_path.isEmpty() && !QDir::isAbsolutePath(movie_path)) {
movie_path = KIconLoader::global()->moviePath(movie_path, KIconLoader::Panel);
}
if (movie_path != m_moviePath) {
m_moviePath = movie_path;
is_movie_path_changed = true;
}
if (overlay_icon_name != m_overlayIconName) {
m_overlayIconName = overlay_icon_name;
is_overlay_icon_name_changed = true;
@ -356,9 +345,6 @@ void DBusSystemTrayTask::syncIcons(const Plasma::DataEngine::Data &properties)
if (is_att_icon_name_changed) {
emit changedAttIconName();
}
if (is_movie_path_changed) {
emit changedMoviePath();
}
if (is_overlay_icon_name_changed) {
emit changedOverlayIconName();
}

View file

@ -49,7 +49,6 @@ class DBusSystemTrayTask : public Task
Q_PROPERTY(QString overlayIconName READ overlayIconName NOTIFY changedOverlayIconName)
Q_PROPERTY(QString iconName READ iconName NOTIFY changedIconName)
Q_PROPERTY(QString attIconName READ attIconName NOTIFY changedAttIconName)
Q_PROPERTY(QString moviePath READ moviePath NOTIFY changedMoviePath)
Q_PROPERTY(bool isMenu READ isMenu NOTIFY changedIsMenu)
Q_PROPERTY(QString title READ title NOTIFY changedTitle)
Q_PROPERTY(QString tooltipTitle READ tooltipTitle NOTIFY changedTooltipTitle)
@ -77,7 +76,6 @@ public:
QString iconName() const { return m_iconName; }
QIcon attIcon() const { return m_attentionIcon; }
QString attIconName() const { return m_attentionIconName; }
QString moviePath() const { return m_moviePath; }
QString overlayIconName() const { return m_overlayIconName; }
QString title() const { return name(); }
bool isMenu() const { return m_isMenu; }
@ -96,10 +94,9 @@ public:
Q_INVOKABLE QVariant customIcon(QVariant variant) const;
signals:
void changedIcons(); // if icons, icon names, movie path are changed
void changedIcons(); // if icons, icon names are changed
void changedIconName(); // if icon name changed
void changedAttIconName(); // if attention icon name is changed
void changedMoviePath();
void changedOverlayIconName();
void changedIsMenu();
void changedTitle();
@ -128,7 +125,6 @@ private:
QIcon m_attentionIcon;
QString m_attentionIconName;
QString m_shortcut;
QString m_moviePath;
QString m_overlayIconName;
QString m_iconThemePath;
QString m_tooltipTitle;

View file

@ -236,9 +236,6 @@ void StatusNotifierItemSource::refreshCallback(QDBusPendingCallWatcher *call)
setData("WindowId", properties["WindowId"]);
setData("ItemIsMenu", properties["ItemIsMenu"]);
//Attention Movie
setData("AttentionMovieName", properties["AttentionMovieName"]);
QIcon overlay;
QStringList overlayNames;