Changeset View
Changeset View
Standalone View
Standalone View
src/panels/places/placesitem.cpp
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Line(s) | |||||
124 | 124 | | |||
125 | Solid::Device PlacesItem::device() const | 125 | Solid::Device PlacesItem::device() const | ||
126 | { | 126 | { | ||
127 | return m_device; | 127 | return m_device; | ||
128 | } | 128 | } | ||
129 | 129 | | |||
130 | void PlacesItem::setBookmark(const KBookmark& bookmark) | 130 | void PlacesItem::setBookmark(const KBookmark& bookmark) | ||
131 | { | 131 | { | ||
132 | if (bookmark == m_bookmark) { | 132 | const bool bookmarkDataChanged = !(bookmark == m_bookmark); | ||
ngraham: Cahnged -> Changed | |||||
elvisangelaccio: Why not `bookmark != m_bookmark` ? | |||||
133 | return; | | |||
134 | } | | |||
135 | 133 | | |||
134 | // bookmark object must be updated to keep in sync with source model | ||||
elvisangelaccio: Typo: "must be updated" | |||||
136 | m_bookmark = bookmark; | 135 | m_bookmark = bookmark; | ||
137 | 136 | | |||
137 | if (!bookmarkDataChanged) { | ||||
ngraham: Cahnged -> Changed | |||||
138 | return; | ||||
139 | } | ||||
140 | | ||||
138 | delete m_access; | 141 | delete m_access; | ||
139 | delete m_volume; | 142 | delete m_volume; | ||
140 | delete m_disc; | 143 | delete m_disc; | ||
141 | delete m_mtp; | 144 | delete m_mtp; | ||
142 | 145 | | |||
143 | const QString udi = bookmark.metaDataItem(QStringLiteral("UDI")); | 146 | const QString udi = bookmark.metaDataItem(QStringLiteral("UDI")); | ||
144 | if (udi.isEmpty()) { | 147 | if (udi.isEmpty()) { | ||
145 | setIcon(bookmark.icon()); | 148 | setIcon(bookmark.icon()); | ||
▲ Show 20 Lines • Show All 143 Lines • Show Last 20 Lines |
Cahnged -> Changed