Changeset View
Changeset View
Standalone View
Standalone View
console/console.cpp
Show All 29 Lines | |||||
30 | #include <kscreen/config.h> | 30 | #include <kscreen/config.h> | ||
31 | #include <kscreen/output.h> | 31 | #include <kscreen/output.h> | ||
32 | #include <kscreen/mode.h> | 32 | #include <kscreen/mode.h> | ||
33 | #include <kscreen/configmonitor.h> | 33 | #include <kscreen/configmonitor.h> | ||
34 | #include <kscreen/edid.h> | 34 | #include <kscreen/edid.h> | ||
35 | #include <kscreen/getconfigoperation.h> | 35 | #include <kscreen/getconfigoperation.h> | ||
36 | 36 | | |||
37 | 37 | | |||
38 | static QTextStream cout(stdout); | ||||
39 | | ||||
38 | namespace KScreen | 40 | namespace KScreen | ||
39 | { | 41 | { | ||
40 | namespace ConfigSerializer | 42 | namespace ConfigSerializer | ||
41 | { | 43 | { | ||
42 | // Exported private symbol in configserializer_p.h in KScreen | 44 | // Exported private symbol in configserializer_p.h in KScreen | ||
43 | extern QJsonObject serializeConfig(const KScreen::ConfigPtr &config); | 45 | extern QJsonObject serializeConfig(const KScreen::ConfigPtr &config); | ||
44 | } | 46 | } | ||
45 | } | 47 | } | ||
▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Line(s) | 145 | { | |||
175 | 177 | | |||
176 | }; | 178 | }; | ||
177 | return QStringLiteral("Invalid Type") + QString::number(type); | 179 | return QStringLiteral("Invalid Type") + QString::number(type); | ||
178 | } | 180 | } | ||
179 | 181 | | |||
180 | void Console::printJSONConfig() | 182 | void Console::printJSONConfig() | ||
181 | { | 183 | { | ||
182 | QJsonDocument doc(KScreen::ConfigSerializer::serializeConfig(m_config)); | 184 | QJsonDocument doc(KScreen::ConfigSerializer::serializeConfig(m_config)); | ||
183 | qDebug() << doc.toJson(QJsonDocument::Indented); | 185 | cout << doc.toJson(QJsonDocument::Indented); | ||
184 | } | 186 | } | ||
185 | 187 | | |||
186 | void Console::printSerializations() | 188 | void Console::printSerializations() | ||
187 | { | 189 | { | ||
188 | QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/kscreen/"; | 190 | QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/kscreen/"; | ||
189 | qDebug() << "Configs in: " << path; | 191 | qDebug() << "Configs in: " << path; | ||
190 | 192 | | |||
191 | QDir dir(path); | 193 | QDir dir(path); | ||
Show All 30 Lines |