forked from qt-creator/qt-creator
put debug Context operator where it belongs
Change-Id: I2f38d670a10bbc37c7a62432a1780ede53835160 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -84,3 +84,4 @@ protected:
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
CORE_EXPORT QDebug operator<<(QDebug debug, const Core::Context &context);
|
||||
|
||||
Reference in New Issue
Block a user