Fix warning: -Wdeprecated-copy - implement StrutRect::operator=
Summary: /home/frederik/kdesrc/kde/workspace/kwin/geometry.cpp:156:88: warning: implicitly-declared ‘constexpr KWin::StrutRect& KWin::StrutRect::operator=(const KWin::StrutRect&)’ is deprecated [-Wdeprecated-copy] 156 | *strut = StrutRect((*strut).intersected(clientsScreenRect), (*strut).area()); | ^ In file included from /home/frederik/kdesrc/kde/workspace/kwin/rules.h:32, from /home/frederik/kdesrc/kde/workspace/kwin/client.h:27, from /home/frederik/kdesrc/kde/workspace/kwin/geometry.cpp:30: /home/frederik/kdesrc/kde/workspace/kwin/utils.h:113:5: note: because ‘KWin::StrutRect’ has user-provided ‘KWin::StrutRect::StrutRect(const KWin::StrutRect&)’ 113 | StrutRect(const StrutRect& other); | ^~~~~~~~~ Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: zzag, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D23084icc-effect-5.17.5
parent
e6ad8786da
commit
dd944b2d5e
|
@ -69,6 +69,15 @@ StrutRect::StrutRect(const StrutRect& other)
|
|||
{
|
||||
}
|
||||
|
||||
StrutRect &StrutRect::operator=(const StrutRect &other)
|
||||
{
|
||||
if (this != &other) {
|
||||
QRect::operator=(other);
|
||||
m_area = other.area();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef KCMRULES
|
||||
|
|
Loading…
Reference in New Issue