service/mpris: add uniqueId property to detect track changes

Also emits all property changes after trackChanged
This commit is contained in:
outfoxxed 2024-07-29 01:34:44 -07:00
parent d9f66e63a3
commit abc0201f6e
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
4 changed files with 104 additions and 34 deletions

View file

@ -21,3 +21,22 @@ Qt::Edges Edges::toQt(Edges::Flags edges) { return Qt::Edges(edges.toInt()); }
bool Edges::isOpposing(Edges::Flags edges) {
return edges.testFlags(Edges::Top | Edges::Bottom) || edges.testFlags(Edges::Left | Edges::Right);
}
DropEmitter::DropEmitter(DropEmitter&& other) noexcept: object(other.object), signal(other.signal) {
other.object = nullptr;
}
DropEmitter& DropEmitter::operator=(DropEmitter&& other) noexcept {
this->object = other.object;
this->signal = other.signal;
other.object = nullptr;
return *this;
}
DropEmitter::~DropEmitter() { this->call(); }
void DropEmitter::call() {
if (!this->object) return;
this->signal(this->object);
this->object = nullptr;
}