Drop static getStringProperty wrappers in Toplevel

The methods Toplevel::staticWmCommand and Toplevel::staticSessionId were
both only used from one method and just wrapping an invocation to
getStringProperty.

REVIEW: 117474
This commit is contained in:
Martin Gräßlin 2014-04-10 13:47:35 +02:00
parent f1f6d6eea8
commit acdff6ea52
2 changed files with 4 additions and 22 deletions

View file

@ -145,22 +145,6 @@ QRect Toplevel::visibleRect() const
return r.translated(geometry().topLeft());
}
/*!
Returns SM_CLIENT_ID property for a given window.
*/
QByteArray Toplevel::staticSessionId(xcb_window_t w)
{
return getStringProperty(w, atoms->sm_client_id);
}
/*!
Returns WM_COMMAND property for a given window.
*/
QByteArray Toplevel::staticWmCommand(xcb_window_t w)
{
return getStringProperty(w, XCB_ATOM_WM_COMMAND, ' ');
}
/*!
Returns WM_CLIENT_LEADER property for a given window.
*/
@ -187,9 +171,9 @@ void Toplevel::getWmClientLeader()
*/
QByteArray Toplevel::sessionId() const
{
QByteArray result = staticSessionId(window());
QByteArray result = getStringProperty(window(), atoms->sm_client_id);
if (result.isEmpty() && wmClientLeaderWin && wmClientLeaderWin != window())
result = staticSessionId(wmClientLeaderWin);
result = getStringProperty(wmClientLeaderWin, atoms->sm_client_id);
return result;
}
@ -199,9 +183,9 @@ QByteArray Toplevel::sessionId() const
*/
QByteArray Toplevel::wmCommand()
{
QByteArray result = staticWmCommand(window());
QByteArray result = getStringProperty(window(), XCB_ATOM_WM_COMMAND, ' ');
if (result.isEmpty() && wmClientLeaderWin && wmClientLeaderWin != window())
result = staticWmCommand(wmClientLeaderWin);
result = getStringProperty(wmClientLeaderWin, XCB_ATOM_WM_COMMAND, ' ');
return result;
}

View file

@ -424,8 +424,6 @@ protected:
bool m_isDamaged;
private:
static QByteArray staticSessionId(xcb_window_t);
static QByteArray staticWmCommand(xcb_window_t);
static xcb_window_t staticWmClientLeader(xcb_window_t);
// when adding new data members, check also copyToDeleted()
Xcb::Window m_client;