From 315df0b8a8ba7e76609cecbfe440805ef5de950f Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 2 Nov 2014 11:46:51 +0100 Subject: [PATCH] Coding style fixes. --- src/autotype/x11/AutoTypeX11.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/autotype/x11/AutoTypeX11.cpp b/src/autotype/x11/AutoTypeX11.cpp index 6a175c727..843fbfa40 100644 --- a/src/autotype/x11/AutoTypeX11.cpp +++ b/src/autotype/x11/AutoTypeX11.cpp @@ -209,23 +209,26 @@ QString AutoTypePlatformX11::windowTitle(Window window, bool useBlacklist) unsigned long after; unsigned char* data = Q_NULLPTR; + // the window manager spec says we should read _NET_WM_NAME first, then fall back to WM_NAME + int retVal = XGetWindowProperty(m_dpy, window, m_atomNetWmName, 0, 1000, false, m_atomUtf8String, &type, &format, &nitems, &after, &data); - if (retVal == 0 && data) { + if ((retVal == 0) && data) { title = QString::fromUtf8(reinterpret_cast(data)); } else { XTextProperty textProp; retVal = XGetTextProperty(m_dpy, window, &textProp, m_atomWmName); - if (retVal != 0 && textProp.value) { + if ((retVal != 0) && textProp.value) { char** textList = Q_NULLPTR; int count; if (textProp.encoding == m_atomUtf8String) { title = QString::fromUtf8(reinterpret_cast(textProp.value)); } - else if (XmbTextPropertyToTextList(m_dpy, &textProp, &textList, &count) == 0 && textList && count > 0) { + else if ((XmbTextPropertyToTextList(m_dpy, &textProp, &textList, &count) == 0) + && textList && (count > 0)) { title = QString::fromLocal8Bit(textList[0]); } else if (textProp.encoding == m_atomString) {