Changeset View
Changeset View
Standalone View
Standalone View
src/output.cpp
Show All 21 Lines | |||||
22 | #include "edid.h" | 22 | #include "edid.h" | ||
23 | #include "abstractbackend.h" | 23 | #include "abstractbackend.h" | ||
24 | #include "backendmanager_p.h" | 24 | #include "backendmanager_p.h" | ||
25 | #include "kscreen_debug.h" | 25 | #include "kscreen_debug.h" | ||
26 | 26 | | |||
27 | #include <QStringList> | 27 | #include <QStringList> | ||
28 | #include <QScopedPointer> | 28 | #include <QScopedPointer> | ||
29 | #include <QRect> | 29 | #include <QRect> | ||
30 | #include <QCryptographicHash> | ||||
30 | 31 | | |||
31 | using namespace KScreen; | 32 | using namespace KScreen; | ||
32 | 33 | | |||
33 | class Q_DECL_HIDDEN Output::Private | 34 | class Q_DECL_HIDDEN Output::Private | ||
34 | { | 35 | { | ||
35 | public: | 36 | public: | ||
36 | Private(): | 37 | Private(): | ||
37 | id(0), | 38 | id(0), | ||
▲ Show 20 Lines • Show All 175 Lines • ▼ Show 20 Line(s) | |||||
213 | QString Output::hash() const | 214 | QString Output::hash() const | ||
214 | { | 215 | { | ||
215 | if (edid() && edid()->isValid()) { | 216 | if (edid() && edid()->isValid()) { | ||
216 | return edid()->hash(); | 217 | return edid()->hash(); | ||
217 | } | 218 | } | ||
218 | return name(); | 219 | return name(); | ||
219 | } | 220 | } | ||
220 | 221 | | |||
222 | QString Output::hashMd5() const | ||||
223 | { | ||||
224 | if (edid() && edid()->isValid()) { | ||||
225 | return edid()->hash(); | ||||
226 | } | ||||
227 | const auto hash = QCryptographicHash::hash(name().toLatin1(), | ||||
228 | QCryptographicHash::Md5); | ||||
229 | return QString::fromLatin1(hash.toHex()); | ||||
230 | } | ||||
231 | | ||||
221 | Output::Type Output::type() const | 232 | Output::Type Output::type() const | ||
222 | { | 233 | { | ||
223 | return d->type; | 234 | return d->type; | ||
224 | } | 235 | } | ||
225 | 236 | | |||
226 | void Output::setType(Type type) | 237 | void Output::setType(Type type) | ||
227 | { | 238 | { | ||
228 | if (d->type == type) { | 239 | if (d->type == type) { | ||
▲ Show 20 Lines • Show All 397 Lines • Show Last 20 Lines |