Changeset View
Changeset View
Standalone View
Standalone View
src/output.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 47 | Private(const Private &other): | |||
---|---|---|---|---|---|
61 | connected(other.connected), | 61 | connected(other.connected), | ||
62 | enabled(other.enabled), | 62 | enabled(other.enabled), | ||
63 | primary(other.primary) | 63 | primary(other.primary) | ||
64 | { | 64 | { | ||
65 | Q_FOREACH (const ModePtr &otherMode, other.modeList) { | 65 | Q_FOREACH (const ModePtr &otherMode, other.modeList) { | ||
66 | modeList.insert(otherMode->id(), otherMode->clone()); | 66 | modeList.insert(otherMode->id(), otherMode->clone()); | ||
67 | } | 67 | } | ||
68 | if (other.edid) { | 68 | if (other.edid) { | ||
69 | edid = other.edid->clone(); | 69 | edid.reset(other.edid->clone()); | ||
70 | } | 70 | } | ||
71 | } | 71 | } | ||
72 | 72 | | |||
73 | QString biggestMode(const ModeList& modes) const; | 73 | QString biggestMode(const ModeList& modes) const; | ||
74 | bool compareModeList(const ModeList& before, const ModeList& after); | 74 | bool compareModeList(const ModeList& before, const ModeList& after); | ||
75 | 75 | | |||
76 | QScopedPointer<Edid> edid; | ||||
76 | int id; | 77 | int id; | ||
77 | QString name; | 78 | QString name; | ||
78 | Type type; | 79 | Type type; | ||
79 | QString icon; | 80 | QString icon; | ||
80 | ModeList modeList; | 81 | ModeList modeList; | ||
81 | QList<int> clones; | 82 | QList<int> clones; | ||
82 | QString currentMode; | 83 | QString currentMode; | ||
83 | QString preferredMode; | 84 | QString preferredMode; | ||
▲ Show 20 Lines • Show All 372 Lines • ▼ Show 20 Line(s) | 452 | { | |||
456 | d->clones = outputlist; | 457 | d->clones = outputlist; | ||
457 | 458 | | |||
458 | Q_EMIT clonesChanged(); | 459 | Q_EMIT clonesChanged(); | ||
459 | } | 460 | } | ||
460 | 461 | | |||
461 | void Output::setEdid(const QByteArray& rawData) | 462 | void Output::setEdid(const QByteArray& rawData) | ||
462 | { | 463 | { | ||
463 | Q_ASSERT(d->edid.isNull()); | 464 | Q_ASSERT(d->edid.isNull()); | ||
464 | d->edid = new Edid(rawData); | 465 | d->edid.reset(new Edid(rawData)); | ||
465 | } | 466 | } | ||
466 | 467 | | |||
467 | Edid *Output::edid() const | 468 | Edid *Output::edid() const | ||
468 | { | 469 | { | ||
469 | return d->edid; | 470 | return d->edid.data(); | ||
470 | } | 471 | } | ||
471 | 472 | | |||
472 | QSize Output::sizeMm() const | 473 | QSize Output::sizeMm() const | ||
473 | { | 474 | { | ||
474 | return d->sizeMm; | 475 | return d->sizeMm; | ||
475 | } | 476 | } | ||
476 | 477 | | |||
477 | void Output::setSizeMm(const QSize &size) | 478 | void Output::setSizeMm(const QSize &size) | ||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 502 | { | |||
559 | ModeList modes; | 560 | ModeList modes; | ||
560 | Q_FOREACH (const ModePtr &otherMode, other->modes()) { | 561 | Q_FOREACH (const ModePtr &otherMode, other->modes()) { | ||
561 | modes.insert(otherMode->id(), otherMode->clone()); | 562 | modes.insert(otherMode->id(), otherMode->clone()); | ||
562 | } | 563 | } | ||
563 | setModes(modes); | 564 | setModes(modes); | ||
564 | 565 | | |||
565 | // Non-notifyable changes | 566 | // Non-notifyable changes | ||
566 | if (other->d->edid) { | 567 | if (other->d->edid) { | ||
567 | delete d->edid; | 568 | d->edid.reset(other->d->edid->clone()); | ||
568 | d->edid = other->d->edid->clone(); | | |||
569 | } | 569 | } | ||
570 | 570 | | |||
571 | blockSignals(keepBlocked); | 571 | blockSignals(keepBlocked); | ||
572 | 572 | | |||
573 | while (!changes.isEmpty()) { | 573 | while (!changes.isEmpty()) { | ||
574 | const ChangeSignal &sig = changes.first(); | 574 | const ChangeSignal &sig = changes.first(); | ||
575 | Q_EMIT (this->*sig)(); | 575 | Q_EMIT (this->*sig)(); | ||
576 | changes.removeAll(sig); | 576 | changes.removeAll(sig); | ||
Show All 20 Lines |