PVS: V560 A part of conditional expression is always true

This commit is contained in:
wmayer
2019-02-17 13:56:48 +01:00
parent b52f8d1e1d
commit f581d5c8cb
16 changed files with 42 additions and 42 deletions

View File

@@ -108,31 +108,29 @@ bool GUIApplication::notify (QObject * receiver, QEvent * event)
}
// Print some more information to the log file (if active) to ease bug fixing
if (receiver && event) {
try {
std::stringstream dump;
dump << "The event type " << (int)event->type() << " was sent to "
<< receiver->metaObject()->className() << "\n";
dump << "Object tree:\n";
if (receiver->isWidgetType()) {
QWidget* w = qobject_cast<QWidget*>(receiver);
while (w) {
dump << "\t";
dump << w->metaObject()->className();
QString name = w->objectName();
if (!name.isEmpty())
dump << " (" << (const char*)name.toUtf8() << ")";
w = w->parentWidget();
if (w)
dump << " is child of\n";
}
std::string str = dump.str();
Base::Console().Log("%s",str.c_str());
try {
std::stringstream dump;
dump << "The event type " << (int)event->type() << " was sent to "
<< receiver->metaObject()->className() << "\n";
dump << "Object tree:\n";
if (receiver->isWidgetType()) {
QWidget* w = qobject_cast<QWidget*>(receiver);
while (w) {
dump << "\t";
dump << w->metaObject()->className();
QString name = w->objectName();
if (!name.isEmpty())
dump << " (" << (const char*)name.toUtf8() << ")";
w = w->parentWidget();
if (w)
dump << " is child of\n";
}
std::string str = dump.str();
Base::Console().Log("%s",str.c_str());
}
catch (...) {
Base::Console().Log("Invalid recipient and/or event in GUIApplication::notify\n");
}
}
catch (...) {
Base::Console().Log("Invalid recipient and/or event in GUIApplication::notify\n");
}
return true;