put debug Context operator where it belongs

Change-Id: I2f38d670a10bbc37c7a62432a1780ede53835160
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tim Jenssen
2017-01-26 16:56:31 +01:00
parent eaf60c13e8
commit acbd85388c
3 changed files with 21 additions and 8 deletions

View File

@@ -393,14 +393,6 @@ ActionManagerPrivate::~ActionManagerPrivate()
qDeleteAll(m_idCmdMap);
}
QDebug operator<<(QDebug d, const Context &context)
{
d << "CONTEXT: ";
foreach (Id id, context)
d << " " << id.toString();
return d;
}
void ActionManagerPrivate::setContext(const Context &context)
{
// here are possibilities for speed optimization if necessary:

View File

@@ -24,3 +24,23 @@
****************************************************************************/
#include "icontext.h"
#include <QDebug>
QDebug operator<<(QDebug debug, const Core::Context &context)
{
debug.nospace() << "Context(";
Core::Context::const_iterator it = context.begin();
Core::Context::const_iterator end = context.end();
if (it != end) {
debug << *it;
++it;
}
while (it != end) {
debug << ", " << *it;
++it;
}
debug << ')';
return debug;
}

View File

@@ -84,3 +84,4 @@ protected:
};
} // namespace Core
CORE_EXPORT QDebug operator<<(QDebug debug, const Core::Context &context);