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 172 Lines • ▼ Show 20 Line(s) | 204 | { | |||
210 | Q_EMIT outputChanged(); | 211 | Q_EMIT outputChanged(); | ||
211 | } | 212 | } | ||
212 | 213 | | |||
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 | const auto hash = QCryptographicHash::hash(name().toLatin1(), | ||
220 | QCryptographicHash::Md5); | ||||
221 | return QString::fromLatin1(hash.toHex()); | ||||
219 | } | 222 | } | ||
220 | 223 | | |||
221 | Output::Type Output::type() const | 224 | Output::Type Output::type() const | ||
222 | { | 225 | { | ||
223 | return d->type; | 226 | return d->type; | ||
224 | } | 227 | } | ||
225 | 228 | | |||
226 | void Output::setType(Type type) | 229 | void Output::setType(Type type) | ||
▲ Show 20 Lines • Show All 398 Lines • Show Last 20 Lines |