Commit ecf864cc authored by Sebastian Kügler's avatar Sebastian Kügler

add debug << operator to config

This shows some information about the config, makes it much easier to
check what a config is than comparing pointer addresses
parent 1b95f2f3
......@@ -363,4 +363,22 @@ void Config::apply(const ConfigPtr& other)
setValid(other->isValid());
}
QDebug operator<<(QDebug dbg, const KScreen::ConfigPtr &config)
{
if (config) {
dbg << "KScreen::Config(";
for (const auto output : config->outputs()) {
if (output->isConnected()) {
dbg << endl << output;
}
}
dbg << ")";
} else {
dbg << "KScreen::Config(NULL)";
}
return dbg;
}
#include "config.moc"
......@@ -168,4 +168,8 @@ class KSCREEN_EXPORT Config : public QObject
Q_DECLARE_OPERATORS_FOR_FLAGS(KScreen::Config::Features)
KSCREEN_EXPORT QDebug operator<<(QDebug dbg, const KScreen::ConfigPtr &config);
#endif //KSCREEN_CONFIG_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment