Compare commits
4 commits
01f2be057e
...
c57ac4b1f2
Author | SHA1 | Date | |
---|---|---|---|
c57ac4b1f2 | |||
08966f91c5 | |||
84e3f04f3c | |||
bdc9fe958b |
3 changed files with 8 additions and 5 deletions
|
@ -71,8 +71,8 @@ void QsMenuOpener::setMenu(QsMenuHandle* menu) {
|
|||
QObject::disconnect(this->mMenu, nullptr, this, nullptr);
|
||||
|
||||
if (this->mMenu->menu()) {
|
||||
this->mMenu->menu()->unref();
|
||||
QObject::disconnect(this->mMenu->menu(), nullptr, this, nullptr);
|
||||
this->mMenu->menu()->unref();
|
||||
}
|
||||
|
||||
this->mMenu->unrefHandle();
|
||||
|
|
|
@ -98,7 +98,7 @@ void DBusMenuItem::updateLayout() const {
|
|||
this->menu->updateLayout(this->id, -1);
|
||||
}
|
||||
|
||||
bool DBusMenuItem::hasChildren() const { return this->displayChildren; }
|
||||
bool DBusMenuItem::hasChildren() const { return this->displayChildren || this->id == 0; }
|
||||
|
||||
QQmlListProperty<QsMenuEntry> DBusMenuItem::children() {
|
||||
return QQmlListProperty<QsMenuEntry>(
|
||||
|
@ -545,6 +545,9 @@ void DBusMenuHandle::onMenuPathChanged() {
|
|||
qCDebug(logDbusMenu) << "Updating" << this << "with refcount" << this->refcount;
|
||||
|
||||
if (this->mMenu) {
|
||||
// Without this, layout updated can be sent after mMenu is set to null,
|
||||
// leaving loaded = true while mMenu = nullptr.
|
||||
QObject::disconnect(&this->mMenu->rootItem, nullptr, this, nullptr);
|
||||
this->mMenu->deleteLater();
|
||||
this->mMenu = nullptr;
|
||||
this->loaded = false;
|
||||
|
|
|
@ -14,7 +14,7 @@ QImage DBusSniIconPixmap::createImage() const {
|
|||
// fix byte order if on a little endian machine
|
||||
if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) {
|
||||
auto* newbuf = new quint32[this->data.size()];
|
||||
const auto* oldbuf = reinterpret_cast<const quint32*>(this->data.data()); // NOLINT
|
||||
const auto* oldbuf = reinterpret_cast<const quint32*>(this->data.constData()); // NOLINT
|
||||
|
||||
for (uint i = 0; i < this->data.size() / sizeof(quint32); ++i) {
|
||||
newbuf[i] = qFromBigEndian(oldbuf[i]); // NOLINT
|
||||
|
@ -25,12 +25,12 @@ QImage DBusSniIconPixmap::createImage() const {
|
|||
this->width,
|
||||
this->height,
|
||||
QImage::Format_ARGB32,
|
||||
[](void* ptr) { delete reinterpret_cast<quint32*>(ptr); }, // NOLINT
|
||||
[](void* ptr) { delete[] reinterpret_cast<quint32*>(ptr); }, // NOLINT
|
||||
newbuf
|
||||
);
|
||||
} else {
|
||||
return QImage(
|
||||
reinterpret_cast<const uchar*>(this->data.data()), // NOLINT
|
||||
reinterpret_cast<const uchar*>(this->data.constData()), // NOLINT
|
||||
this->width,
|
||||
this->height,
|
||||
QImage::Format_ARGB32
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue