Commit d623e520 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use Q_EMIT to make it compile against kf5.82

parent 7fd773cf
......@@ -141,12 +141,12 @@ bool MockClient::providesContextHelp() const
void MockClient::requestClose()
{
emit closeRequested();
Q_EMIT closeRequested();
}
void MockClient::requestContextHelp()
{
emit quickHelpRequested();
Q_EMIT quickHelpRequested();
}
void MockClient::requestToggleMaximization(Qt::MouseButtons buttons)
......@@ -166,56 +166,56 @@ void MockClient::requestToggleMaximization(Qt::MouseButtons buttons)
const bool wasMaximized = isMaximized();
if (m_maximizedHorizontally != maximizedHorizontally) {
m_maximizedHorizontally = maximizedHorizontally;
emit client()->maximizedHorizontallyChanged(m_maximizedHorizontally);
Q_EMIT client()->maximizedHorizontallyChanged(m_maximizedHorizontally);
}
if (m_maximizedVertically != maximizedVertically) {
m_maximizedVertically = maximizedVertically;
emit client()->maximizedVerticallyChanged(m_maximizedVertically);
Q_EMIT client()->maximizedVerticallyChanged(m_maximizedVertically);
}
if (wasMaximized != isMaximized()) {
emit client()->maximizedChanged(isMaximized());
Q_EMIT client()->maximizedChanged(isMaximized());
}
}
void MockClient::requestMinimize()
{
emit minimizeRequested();
Q_EMIT minimizeRequested();
}
void MockClient::requestShowWindowMenu(const QRect &rect)
{
emit menuRequested();
Q_EMIT menuRequested();
}
void MockClient::requestShowApplicationMenu(const QRect &rect, int actionId)
{
Q_UNUSED(rect);
Q_UNUSED(actionId);
emit applicationMenuRequested(); // FIXME TODO pass geometry
Q_EMIT applicationMenuRequested(); // FIXME TODO pass geometry
}
void MockClient::requestToggleKeepAbove()
{
m_keepAbove = !m_keepAbove;
emit client()->keepAboveChanged(m_keepAbove);
Q_EMIT client()->keepAboveChanged(m_keepAbove);
}
void MockClient::requestToggleKeepBelow()
{
m_keepBelow = !m_keepBelow;
emit client()->keepBelowChanged(m_keepBelow);
Q_EMIT client()->keepBelowChanged(m_keepBelow);
}
void MockClient::requestToggleOnAllDesktops()
{
m_onAllDesktops = !m_onAllDesktops;
emit client()->onAllDesktopsChanged(m_onAllDesktops);
Q_EMIT client()->onAllDesktopsChanged(m_onAllDesktops);
}
void MockClient::requestToggleShade()
{
m_shaded = !m_shaded;
emit client()->shadedChanged(m_shaded);
Q_EMIT client()->shadedChanged(m_shaded);
}
void MockClient::requestShowToolTip(const QString &text)
......@@ -245,43 +245,43 @@ WId MockClient::windowId() const
void MockClient::setCloseable(bool set)
{
m_closeable = set;
emit client()->closeableChanged(set);
Q_EMIT client()->closeableChanged(set);
}
void MockClient::setMinimizable(bool set)
{
m_minimizable = set;
emit client()->minimizeableChanged(set);
Q_EMIT client()->minimizeableChanged(set);
}
void MockClient::setProvidesContextHelp(bool set)
{
m_contextHelp = set;
emit client()->providesContextHelpChanged(set);
Q_EMIT client()->providesContextHelpChanged(set);
}
void MockClient::setShadeable(bool set)
{
m_shadeable = set;
emit client()->shadeableChanged(set);
Q_EMIT client()->shadeableChanged(set);
}
void MockClient::setMaximizable(bool set)
{
m_maximizable = set;
emit client()->maximizeableChanged(set);
Q_EMIT client()->maximizeableChanged(set);
}
void MockClient::setWidth(int w)
{
m_width = w;
emit client()->widthChanged(w);
Q_EMIT client()->widthChanged(w);
}
void MockClient::setHeight(int h)
{
m_height = h;
emit client()->heightChanged(h);
Q_EMIT client()->heightChanged(h);
}
void MockClient::showApplicationMenu(int actionId)
......
......@@ -47,7 +47,7 @@ void MockSettings::setOnAllDesktopsAvailabe(bool set)
return;
}
m_onAllDesktopsAvailable = set;
emit decorationSettings()->onAllDesktopsAvailableChanged(m_onAllDesktopsAvailable);
Q_EMIT decorationSettings()->onAllDesktopsAvailableChanged(m_onAllDesktopsAvailable);
}
void MockSettings::setCloseOnDoubleClickOnMenu(bool set)
......@@ -56,5 +56,5 @@ void MockSettings::setCloseOnDoubleClickOnMenu(bool set)
return;
}
m_closeDoubleClickOnMenu = set;
emit decorationSettings()->closeOnDoubleClickOnMenuChanged(m_closeDoubleClickOnMenu);
Q_EMIT decorationSettings()->closeOnDoubleClickOnMenuChanged(m_closeDoubleClickOnMenu);
}
......@@ -45,7 +45,7 @@ void Decoration::Private::setSectionUnderMouse(Qt::WindowFrameSection section)
return;
}
sectionUnderMouse = section;
emit q->sectionUnderMouseChanged(sectionUnderMouse);
Q_EMIT q->sectionUnderMouseChanged(sectionUnderMouse);
}
void Decoration::Private::updateSectionUnderMouse(const QPoint &mousePosition)
......@@ -216,7 +216,7 @@ void Decoration::requestShowApplicationMenu(const QRect &rect, int actionId)
return; \
} \
d->variableName = a; \
emit variableName##Changed(emitValue); \
Q_EMIT variableName##Changed(emitValue); \
}
DELEGATE(setBorders, borders, const QMargins &, )
......
......@@ -157,7 +157,7 @@ void DecorationButton::Private::setHovered(bool set)
return;
}
hovered = set;
emit q->hoveredChanged(hovered);
Q_EMIT q->hoveredChanged(hovered);
}
void DecorationButton::Private::setEnabled(bool set)
......@@ -166,12 +166,12 @@ void DecorationButton::Private::setEnabled(bool set)
return;
}
enabled = set;
emit q->enabledChanged(enabled);
Q_EMIT q->enabledChanged(enabled);
if (!enabled) {
setHovered(false);
if (isPressed()) {
m_pressed = Qt::NoButton;
emit q->pressedChanged(false);
Q_EMIT q->pressedChanged(false);
}
}
}
......@@ -182,12 +182,12 @@ void DecorationButton::Private::setVisible(bool set)
return;
}
visible = set;
emit q->visibilityChanged(set);
Q_EMIT q->visibilityChanged(set);
if (!visible) {
setHovered(false);
if (isPressed()) {
m_pressed = Qt::NoButton;
emit q->pressedChanged(false);
Q_EMIT q->pressedChanged(false);
}
}
}
......@@ -198,7 +198,7 @@ void DecorationButton::Private::setChecked(bool set)
return;
}
checked = set;
emit q->checkedChanged(checked);
Q_EMIT q->checkedChanged(checked);
}
void DecorationButton::Private::setCheckable(bool set)
......@@ -210,7 +210,7 @@ void DecorationButton::Private::setCheckable(bool set)
setChecked(false);
}
checkable = set;
emit q->checkableChanged(checkable);
Q_EMIT q->checkableChanged(checkable);
}
void DecorationButton::Private::setPressed(Qt::MouseButton button, bool pressed)
......@@ -220,7 +220,7 @@ void DecorationButton::Private::setPressed(Qt::MouseButton button, bool pressed)
} else {
m_pressed = m_pressed & ~button;
}
emit q->pressedChanged(isPressed());
Q_EMIT q->pressedChanged(isPressed());
}
void DecorationButton::Private::setAcceptedButtons(Qt::MouseButtons buttons)
......@@ -229,7 +229,7 @@ void DecorationButton::Private::setAcceptedButtons(Qt::MouseButtons buttons)
return;
}
acceptedButtons = buttons;
emit q->acceptedButtonsChanged(acceptedButtons);
Q_EMIT q->acceptedButtonsChanged(acceptedButtons);
}
void DecorationButton::Private::startDoubleClickTimer()
......@@ -358,16 +358,16 @@ DecorationButton::DecorationButton(DecorationButtonType type, const QPointer<Dec
connect(this, &DecorationButton::visibilityChanged, this, updateSlot);
connect(this, &DecorationButton::hoveredChanged, this, [this](bool hovered) {
if (hovered) {
emit pointerEntered();
Q_EMIT pointerEntered();
} else {
emit pointerLeft();
Q_EMIT pointerLeft();
}
});
connect(this, &DecorationButton::pressedChanged, this, [this](bool p) {
if (p) {
emit pressed();
Q_EMIT pressed();
} else {
emit released();
Q_EMIT released();
}
});
}
......@@ -436,7 +436,7 @@ DELEGATE(setVisible, bool)
return; \
} \
d->variableName = a; \
emit variableName##Changed(d->variableName); \
Q_EMIT variableName##Changed(d->variableName); \
}
DELEGATE(setGeometry, geometry, const QRectF &)
......@@ -522,7 +522,7 @@ void DecorationButton::mousePressEvent(QMouseEvent *event)
// check for double click
if (d->wasDoubleClick()) {
event->setAccepted(true);
emit doubleClicked();
Q_EMIT doubleClicked();
}
d->invalidateDoubleClickTimer();
}
......@@ -538,7 +538,7 @@ void DecorationButton::mouseReleaseEvent(QMouseEvent *event)
}
if (contains(event->localPos())) {
if (!d->pressAndHold || event->button() != Qt::LeftButton) {
emit clicked(event->button());
Q_EMIT clicked(event->button());
} else {
d->stopPressAndHold();
}
......
......@@ -27,7 +27,7 @@ void DecorationButtonGroup::Private::setGeometry(const QRectF &geo)
return;
}
geometry = geo;
emit q->geometryChanged(geometry);
Q_EMIT q->geometryChanged(geometry);
}
namespace
......@@ -148,7 +148,7 @@ void DecorationButtonGroup::setSpacing(qreal spacing)
return;
}
d->spacing = spacing;
emit spacingChanged(d->spacing);
Q_EMIT spacingChanged(d->spacing);
d->updateLayout();
}
......
......@@ -23,12 +23,12 @@ DecorationSettings::DecorationSettings(DecorationBridge *bridge, QObject *parent
}
if (gridUnit != d->gridUnit()) {
d->setGridUnit(gridUnit);
emit gridUnitChanged(gridUnit);
Q_EMIT gridUnitChanged(gridUnit);
}
if (gridUnit != d->largeSpacing()) {
d->setSmallSpacing(qMax(2, (int)(gridUnit / 4))); // 1/4 of gridUnit, at least 2
d->setLargeSpacing(gridUnit); // msize.height
emit spacingChanged();
Q_EMIT spacingChanged();
}
};
updateUnits();
......
......@@ -134,7 +134,7 @@ I(left, Left)
return; \
} \
d->name = arg; \
emit name##Changed(d->name); \
Q_EMIT name##Changed(d->name); \
}
SETTER(const QImage &, setShadow, shadow)
......@@ -148,7 +148,7 @@ void DecorationShadow::setPadding(const QMargins &margins)
return;
}
d->padding = margins;
emit paddingChanged();
Q_EMIT paddingChanged();
}
void DecorationShadow::setInnerShadowRect(const QRect &rect)
......@@ -157,7 +157,7 @@ void DecorationShadow::setInnerShadowRect(const QRect &rect)
return;
}
d->innerShadowRect = rect;
emit innerShadowRectChanged();
Q_EMIT innerShadowRectChanged();
}
}
Supports Markdown
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