Commit b8a6fd7c authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Don't initialize QFlags<T> with nullptr

Summary: This looks very odd.

Test Plan: Compiles.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24086
parent 2dae1535
......@@ -116,7 +116,7 @@ Client::Client()
, m_killHelperPID(0)
, m_pingTimestamp(XCB_TIME_CURRENT_TIME)
, m_userTime(XCB_TIME_CURRENT_TIME) // Not known yet
, allowed_actions(nullptr)
, allowed_actions()
, shade_geometry_change(false)
, sm_stacking_order(-1)
, activitiesDefined(false)
......@@ -1768,7 +1768,7 @@ void Client::updateAllowedActions(bool force)
if (!isManaged() && !force)
return;
NET::Actions old_allowed_actions = NET::Actions(allowed_actions);
allowed_actions = nullptr;
allowed_actions = NET::Actions();
if (isMovable())
allowed_actions |= NET::ActionMove;
if (isResizable())
......
......@@ -73,7 +73,7 @@ DesktopGridEffectConfig::DesktopGridEffectConfig(QWidget* parent, const QVariant
m_ui->shortcutEditor->addCollection(m_actionCollection);
m_ui->desktopNameAlignmentCombo->addItem(i18nc("Desktop name alignment:", "Disabled"), QVariant(Qt::Alignment(nullptr)));
m_ui->desktopNameAlignmentCombo->addItem(i18nc("Desktop name alignment:", "Disabled"), QVariant(Qt::Alignment()));
m_ui->desktopNameAlignmentCombo->addItem(i18n("Top"), QVariant(Qt::AlignHCenter | Qt::AlignTop));
m_ui->desktopNameAlignmentCombo->addItem(i18n("Top-Right"), QVariant(Qt::AlignRight | Qt::AlignTop));
m_ui->desktopNameAlignmentCombo->addItem(i18n("Right"), QVariant(Qt::AlignRight | Qt::AlignVCenter));
......
......@@ -83,7 +83,7 @@ TrackMouseEffect::~TrackMouseEffect()
void TrackMouseEffect::reconfigure(ReconfigureFlags)
{
m_modifiers = nullptr;
m_modifiers = Qt::KeyboardModifiers();
TrackMouseConfig::self()->read();
if (TrackMouseConfig::shift())
m_modifiers |= Qt::ShiftModifier;
......
......@@ -444,7 +444,7 @@ bool Client::windowEvent(xcb_generic_event_t *e)
emit opacityChanged(this, old_opacity);
} else {
// forward to the frame if there's possibly another compositing manager running
NETWinInfo i(connection(), frameId(), rootWindow(), nullptr, nullptr);
NETWinInfo i(connection(), frameId(), rootWindow(), NET::Properties(), NET::Properties2());
i.setOpacity(info->opacity());
}
}
......
......@@ -894,7 +894,7 @@ void Workspace::setMoveResizeClient(AbstractClient *c)
// (the property with the size of the frame remains on the window after the crash).
void Workspace::fixPositionAfterCrash(xcb_window_t w, const xcb_get_geometry_reply_t *geometry)
{
NETWinInfo i(connection(), w, rootWindow(), NET::WMFrameExtents, nullptr);
NETWinInfo i(connection(), w, rootWindow(), NET::WMFrameExtents, NET::Properties2());
NETStrut frame = i.frameExtents();
if (frame.left != 0 || frame.top != 0) {
......
......@@ -60,7 +60,7 @@ Group::Group(xcb_window_t leader_P)
if (leader_P != XCB_WINDOW_NONE) {
leader_client = workspace()->findClient(Predicate::WindowMatch, leader_P);
leader_info = new NETWinInfo(connection(), leader_P, rootWindow(),
nullptr, NET::WM2StartupId);
NET::Properties(), NET::WM2StartupId);
}
effect_group = new EffectWindowGroupImpl(this);
workspace()->addGroup(this);
......
......@@ -586,7 +586,7 @@ Rules* RulesWidget::rules() const
rules->wmclassmatch = static_cast< Rules::StringMatch >(wmclass_match->currentIndex());
rules->windowrole = role->text().toUtf8();
rules->windowrolematch = static_cast< Rules::StringMatch >(role_match->currentIndex());
rules->types = nullptr;
rules->types = {};
bool all_types = true;
for (int i = 0;
i < types->count();
......
......@@ -606,7 +606,7 @@ bool Client::manage(xcb_window_t w, bool isMapped)
if (opacity() == 1.0) {
return;
}
NETWinInfo info(connection(), frameId(), rootWindow(), nullptr, nullptr);
NETWinInfo info(connection(), frameId(), rootWindow(), NET::Properties(), NET::Properties2());
info.setOpacity(static_cast<unsigned long>(opacity() * 0xffffffff));
}
);
......
......@@ -172,7 +172,7 @@ Qt::MouseButton x11ToQtMouseButton(int button)
Qt::MouseButtons x11ToQtMouseButtons(int state)
{
Qt::MouseButtons ret = nullptr;
Qt::MouseButtons ret = {};
if (state & XCB_KEY_BUT_MASK_BUTTON_1)
ret |= Qt::LeftButton;
if (state & XCB_KEY_BUT_MASK_BUTTON_2)
......@@ -188,7 +188,7 @@ Qt::MouseButtons x11ToQtMouseButtons(int state)
Qt::KeyboardModifiers x11ToQtKeyboardModifiers(int state)
{
Qt::KeyboardModifiers ret = nullptr;
Qt::KeyboardModifiers ret = {};
if (state & XCB_KEY_BUT_MASK_SHIFT)
ret |= Qt::ShiftModifier;
if (state & XCB_KEY_BUT_MASK_CONTROL)
......
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