Commit 788c65d2 authored by Adrien Faveraux's avatar Adrien Faveraux
Browse files

Fix Build Warning

parent d97f12c1
......@@ -187,7 +187,7 @@ void ScriptedEffectsTest::testEffectsHandler()
// this triggers and tests some of the signals in EffectHandler, which is exposed to JS as context property "effects"
auto *effect = new ScriptedEffectWithDebugSpy; // cleaned up in ::clean
QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput);
auto waitFor = [&effectOutputSpy, this](const QString &expected) {
auto waitFor = [&effectOutputSpy](const QString &expected) {
QVERIFY(effectOutputSpy.count() > 0 || effectOutputSpy.wait());
QCOMPARE(effectOutputSpy.first().first(), expected);
effectOutputSpy.removeFirst();
......
......@@ -73,7 +73,6 @@ private:
KWayland::Client::Compositor *m_compositor = nullptr;
KWayland::Client::Seat *m_seat = nullptr;
KWayland::Client::ShmPool *m_shm = nullptr;
KWayland::Client::Shell *m_shell = nullptr;
};
class HelperEffect : public Effect
......
......@@ -119,7 +119,7 @@ void TestMaximized::testMaximizedPassedToDeco()
// now maximize
QSignalSpy bordersChangedSpy(decoration, &KDecoration2::Decoration::bordersChanged);
QVERIFY(bordersChangedSpy.isValid());
QSignalSpy maximizedChangedSpy(decoration->client().data(), &KDecoration2::DecoratedClient::maximizedChanged);
QSignalSpy maximizedChangedSpy(decoration->client().toStrongRef().data(), &KDecoration2::DecoratedClient::maximizedChanged);
QVERIFY(maximizedChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
......
......@@ -388,7 +388,7 @@ void MoveResizeWindowTest::testPackAgainstClient()
QVERIFY(!shellSurface3.isNull());
QScopedPointer<XdgShellSurface> shellSurface4(Test::createXdgShellStableSurface(surface4.data()));
QVERIFY(!shellSurface4.isNull());
auto renderWindow = [this] (Surface *surface, const QString &methodCall, const QRect &expectedGeometry) {
auto renderWindow = [] (Surface *surface, const QString &methodCall, const QRect &expectedGeometry) {
// let's render
auto c = Test::renderAndWaitForShown(surface, QSize(10, 10), Qt::blue);
......
......@@ -199,6 +199,7 @@ Device::Device(libinput_device *device, QObject *parent)
, m_scrollButton(libinput_device_config_scroll_get_button(m_device))
, m_defaultPointerAcceleration(libinput_device_config_accel_get_default_speed(m_device))
, m_pointerAcceleration(libinput_device_config_accel_get_speed(m_device))
, m_scrollFactor(scrollFactorDefault())
, m_supportedPointerAccelerationProfiles(libinput_device_config_accel_get_profiles(m_device))
, m_defaultPointerAccelerationProfile(libinput_device_config_accel_get_default_profile(m_device))
, m_pointerAccelerationProfile(libinput_device_config_accel_get_profile(m_device))
......@@ -208,7 +209,6 @@ Device::Device(libinput_device *device, QObject *parent)
, m_supportedClickMethods(libinput_device_config_click_get_methods(m_device))
, m_defaultClickMethod(libinput_device_config_click_get_default_method(m_device))
, m_clickMethod(libinput_device_config_click_get_method(m_device))
, m_scrollFactor(scrollFactorDefault())
{
libinput_device_ref(m_device);
......
......@@ -2096,7 +2096,7 @@ class KWINEFFECTS_EXPORT EffectWindow : public QObject
* @since 5.16
*/
Q_PROPERTY(QWindow *internalWindow READ internalWindow CONSTANT)
/**
* Whether this EffectWindow represents the outline.
*
......@@ -2111,7 +2111,7 @@ class KWINEFFECTS_EXPORT EffectWindow : public QObject
*
* @since 5.18
*/
Q_PROPERTY(bool outline READ isOutline CONSTANT)
Q_PROPERTY(pid_t pid READ pid CONSTANT)
public:
/** Flags explaining why painting should be disabled */
......
......@@ -274,7 +274,7 @@ void SceneQPainter::Window::performPaint(int mask, const QRegion &_region, const
void SceneQPainter::Window::renderWindowPixmap(QPainter *painter, QPainterWindowPixmap *windowPixmap)
{
const QRegion shape = windowPixmap->shape();
for (const QRectF &rect : shape) {
for (const QRectF rect : shape) {
const QPointF windowTopLeft = windowPixmap->mapToWindow(rect.topLeft());
const QPointF windowBottomRight = windowPixmap->mapToWindow(rect.bottomRight());
......
......@@ -1030,7 +1030,7 @@ WindowQuadList Scene::Window::makeContentsQuads() const
const QRegion region = windowPixmap->shape();
const int quadId = id++;
for (const QRectF &rect : region) {
for (const QRectF rect : region) {
// Note that the window quad id is not unique if the window is shaped, i.e. the
// region contains more than just one rectangle. We assume that the "source" quad
// had been subdivided.
......
......@@ -177,12 +177,12 @@ void TabBoxHandlerPrivate::updateHighlightWindows()
TabBoxClientList order = q->stackingOrder();
int succIdx = order.count() + 1;
for (int i=0; i<order.count(); ++i) {
if (order.at(i).data() == lastRaisedClient) {
if (order.at(i).toStrongRef() == lastRaisedClient) {
succIdx = i + 1;
break;
}
}
lastRaisedClientSucc = (succIdx < order.count()) ? order.at(succIdx).data() : nullptr;
lastRaisedClientSucc = (succIdx < order.count()) ? order.at(succIdx).toStrongRef().data() : nullptr;
q->raiseClient(lastRaisedClient);
}
}
......
......@@ -116,8 +116,8 @@ Workspace::Workspace()
, workspaceInit(true)
, set_active_client_recursion(0)
, block_stacking_updates(0)
, m_sessionManager(new SessionManager(this))
, m_quickTileCombineTimer(nullptr)
, m_sessionManager(new SessionManager(this))
, m_lastTilingMode(0)
{
// If KWin was already running it saved its configuration after loosing the selection -> Reread
......
......@@ -4395,7 +4395,7 @@ void X11Client::changeMaximize(bool horizontal, bool vertical, bool adjust)
// call into decoration update borders
if (isDecorated() && decoration()->client() && !(options->borderlessMaximizedWindows() && max_mode == KWin::MaximizeFull)) {
changeMaximizeRecursion = true;
const auto c = decoration()->client().data();
const auto c = decoration()->client().toStrongRef();
if ((max_mode & MaximizeVertical) != (old_mode & MaximizeVertical)) {
emit c->maximizedVerticallyChanged(max_mode & MaximizeVertical);
}
......
......@@ -218,7 +218,7 @@ void Xvisit::sendPosition(const QPointF &globalPos)
}
m_pos.pending = true;
xcb_client_message_data_t data = {0};
xcb_client_message_data_t data = {};
data.data32[0] = DataBridge::self()->dnd()->window();
data.data32[2] = (x << 16) | y;
data.data32[3] = XCB_CURRENT_TIME;
......@@ -273,7 +273,7 @@ void Xvisit::enter()
void Xvisit::sendEnter()
{
xcb_client_message_data_t data = {0};
xcb_client_message_data_t data = {};
data.data32[0] = DataBridge::self()->dnd()->window();
data.data32[1] = m_version << 24;
......@@ -283,7 +283,7 @@ void Xvisit::sendEnter()
const int mimesCount = mimeTypesNames.size();
size_t cnt = 0;
size_t totalCnt = 0;
for (const auto mimeName : mimeTypesNames) {
for (const auto &mimeName : mimeTypesNames) {
// 3 mimes and less can be sent directly in the XdndEnter message
if (totalCnt == 3) {
break;
......@@ -308,7 +308,7 @@ void Xvisit::sendEnter()
targets.resize(mimesCount);
size_t cnt = 0;
for (const auto mimeName : mimeTypesNames) {
for (const auto &mimeName : mimeTypesNames) {
const auto atom = Selection::mimeTypeToAtom(mimeName);
if (atom != XCB_ATOM_NONE) {
targets[cnt] = atom;
......@@ -328,7 +328,7 @@ void Xvisit::sendEnter()
void Xvisit::sendDrop(uint32_t time)
{
xcb_client_message_data_t data = {0};
xcb_client_message_data_t data = {};
data.data32[0] = DataBridge::self()->dnd()->window();
data.data32[2] = time;
......@@ -341,7 +341,7 @@ void Xvisit::sendDrop(uint32_t time)
void Xvisit::sendLeave()
{
xcb_client_message_data_t data = {0};
xcb_client_message_data_t data = {};
data.data32[0] = DataBridge::self()->dnd()->window();
Drag::sendClientMessage(m_target->window(), atoms->xdnd_leave, &data);
}
......
......@@ -227,7 +227,7 @@ void XToWlDrag::setOffers(const Mimes &offers)
// TODO: make sure that offers are not changed in between visits
m_offersPending = m_offers = offers;
for (const auto mimePair : offers) {
for (const auto &mimePair : offers) {
m_dataSource->offer(mimePair.first);
}
}
......@@ -371,7 +371,7 @@ bool WlVisit::handleEnter(xcb_client_message_event_t *event)
for (size_t i = 0; i < 3; i++) {
xcb_atom_t mimeAtom = data->data32[2 + i];
const auto mimeStrings = atomToMimeTypes(mimeAtom);
for (const auto mime : mimeStrings ) {
for (const auto &mime : mimeStrings ) {
if (!hasMimeName(offers, mime)) {
offers << Mime(mime, mimeAtom);
}
......@@ -409,7 +409,7 @@ void WlVisit::getMimesFromWinProperty(Mimes &offers)
xcb_atom_t *mimeAtoms = static_cast<xcb_atom_t *>(xcb_get_property_value(reply));
for (size_t i = 0; i < reply->value_len; ++i) {
const auto mimeStrings = atomToMimeTypes(mimeAtoms[i]);
for (const auto mime : mimeStrings) {
for (const auto &mime : mimeStrings) {
if (!hasMimeName(offers, mime)) {
offers << Mime(mime, mimeAtoms[i]);
}
......@@ -495,7 +495,7 @@ void WlVisit::sendStatus()
// accept the drop
flags |= (1 << 0);
}
xcb_client_message_data_t data = {0};
xcb_client_message_data_t data = {};
data.data32[0] = m_window;
data.data32[1] = flags;
data.data32[4] = flags & (1 << 0) ? m_actionAtom : static_cast<uint32_t>(XCB_ATOM_NONE);
......@@ -505,7 +505,7 @@ void WlVisit::sendStatus()
void WlVisit::sendFinished()
{
const bool accepted = m_entered && m_action != DnDAction::None;
xcb_client_message_data_t data = {0};
xcb_client_message_data_t data = {};
data.data32[0] = m_window;
data.data32[1] = accepted;
data.data32[2] = accepted ? m_actionAtom : static_cast<uint32_t>(XCB_ATOM_NONE);
......
......@@ -92,7 +92,7 @@ void WlSource::sendTargets(xcb_selection_request_event_t *event)
targets[1] = atoms->targets;
size_t cnt = 2;
for (const auto mime : m_offers) {
for (const auto &mime : m_offers) {
targets[cnt] = Selection::mimeTypeToAtom(mime);
cnt++;
}
......@@ -236,7 +236,7 @@ void X11Source::handleTargets()
all << mimePair;
}
// all left in m_offers are not in the updated targets
for (const auto mimePair : m_offers) {
for (const auto &mimePair : m_offers) {
removed << mimePair.first;
}
m_offers = all;
......
Markdown is supported
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