get rid of some unnecessary const_casts

This commit is contained in:
Xaver Hugl 2023-06-14 16:05:57 +02:00
parent dc4c463ca3
commit 4541501ccc
6 changed files with 6 additions and 6 deletions

View file

@ -551,7 +551,7 @@ void Workspace::switchToOutput(Output *output)
void Workspace::gotFocusIn(const Window *window) void Workspace::gotFocusIn(const Window *window)
{ {
if (should_get_focus.contains(const_cast<Window *>(window))) { if (should_get_focus.contains(window)) {
// remove also all sooner elements that should have got FocusIn, // remove also all sooner elements that should have got FocusIn,
// but didn't for some reason (and also won't anymore, because they were sooner) // but didn't for some reason (and also won't anymore, because they were sooner)
while (should_get_focus.first() != window) { while (should_get_focus.first() != window) {

View file

@ -1117,7 +1117,7 @@ bool X11Window::buttonReleaseEvent(xcb_window_t w, int button, int state, int x,
return true; return true;
} }
if (w == frameId() && workspace()->userActionsMenu() && workspace()->userActionsMenu()->isShown()) { if (w == frameId() && workspace()->userActionsMenu() && workspace()->userActionsMenu()->isShown()) {
const_cast<UserActionsMenu *>(workspace()->userActionsMenu())->grabInput(); workspace()->userActionsMenu()->grabInput();
} }
x = this->x(); // translate from grab window to local coords x = this->x(); // translate from grab window to local coords
y = this->y(); y = this->y();

View file

@ -363,7 +363,7 @@ inline WindowRules::WindowRules()
inline bool WindowRules::contains(const Rules *rule) const inline bool WindowRules::contains(const Rules *rule) const
{ {
return rules.contains(const_cast<Rules *>(rule)); return rules.contains(rule);
} }
inline void WindowRules::remove(Rules *rule) inline void WindowRules::remove(Rules *rule)

View file

@ -394,7 +394,7 @@ TileManager *Tile::manager() const
int Tile::row() const int Tile::row() const
{ {
if (m_parentTile) { if (m_parentTile) {
return m_parentTile->m_children.indexOf(const_cast<Tile *>(this)); return m_parentTile->m_children.indexOf(this);
} }
return -1; return -1;

View file

@ -306,7 +306,7 @@ public:
* it's not already. * it's not already.
*/ */
void showWindowMenu(const QRect &pos, Window *cl); void showWindowMenu(const QRect &pos, Window *cl);
const UserActionsMenu *userActionsMenu() const UserActionsMenu *userActionsMenu() const
{ {
return m_userActionsMenu; return m_userActionsMenu;
} }

View file

@ -3404,7 +3404,7 @@ bool X11Window::hasTransientInternal(const X11Window *cl, bool indirect, QList<c
return false; return false;
} }
// cl is group transient, search from top // cl is group transient, search from top
if (transients().contains(const_cast<X11Window *>(cl))) { if (transients().contains(cl)) {
return true; return true;
} }
if (!indirect) { if (!indirect) {