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
This commit is contained in:
Vlad Zahorodnii 2019-09-19 18:16:14 +03:00
parent 2dae153558
commit b8a6fd7c46
9 changed files with 11 additions and 11 deletions

View file

@ -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())

View file

@ -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));

View file

@ -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;

View file

@ -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());
}
}

View file

@ -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) {

View file

@ -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);

View file

@ -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();

View file

@ -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));
}
);

View file

@ -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)