Changeset View
Changeset View
Standalone View
Standalone View
stage/part/KPrCustomSlideShowsModel.cpp
Show First 20 Lines • Show All 231 Lines • ▼ Show 20 Line(s) | 230 | while(!stream.atEnd()) { | |||
---|---|---|---|---|---|
232 | stream >> v; | 232 | stream >> v; | ||
233 | slides.append(static_cast<KoPAPageBase*>((void*)v.value<qulonglong>())); | 233 | slides.append(static_cast<KoPAPageBase*>((void*)v.value<qulonglong>())); | ||
234 | } | 234 | } | ||
235 | return slides; | 235 | return slides; | ||
236 | } | 236 | } | ||
237 | 237 | | |||
238 | void KPrCustomSlideShowsModel::setCustomSlideShows(KPrCustomSlideShows *customShows) | 238 | void KPrCustomSlideShowsModel::setCustomSlideShows(KPrCustomSlideShows *customShows) | ||
239 | { | 239 | { | ||
240 | beginResetModel(); | ||||
240 | m_customSlideShows = customShows; | 241 | m_customSlideShows = customShows; | ||
241 | m_activeCustomSlideShowName.clear(); | 242 | m_activeCustomSlideShowName.clear(); | ||
242 | reset(); | 243 | endResetModel(); | ||
243 | } | 244 | } | ||
244 | 245 | | |||
245 | 246 | | |||
246 | QString KPrCustomSlideShowsModel::activeCustomSlideShow() const | 247 | QString KPrCustomSlideShowsModel::activeCustomSlideShow() const | ||
247 | { | 248 | { | ||
248 | return m_activeCustomSlideShowName; | 249 | return m_activeCustomSlideShowName; | ||
249 | } | 250 | } | ||
250 | 251 | | |||
251 | void KPrCustomSlideShowsModel::setActiveSlideShow(const QString &name) | 252 | void KPrCustomSlideShowsModel::setActiveSlideShow(const QString &name) | ||
252 | { | 253 | { | ||
253 | if (!m_customSlideShows || (m_activeCustomSlideShowName == name)) { | 254 | if (!m_customSlideShows || (m_activeCustomSlideShowName == name)) { | ||
254 | return; | 255 | return; | ||
255 | } | 256 | } | ||
256 | if (m_customSlideShows->names().contains(name)) { | 257 | if (m_customSlideShows->names().contains(name)) { | ||
258 | beginResetModel(); | ||||
257 | m_activeCustomSlideShowName = name; | 259 | m_activeCustomSlideShowName = name; | ||
258 | reset(); | 260 | endResetModel(); | ||
259 | } | 261 | } | ||
260 | } | 262 | } | ||
261 | 263 | | |||
262 | void KPrCustomSlideShowsModel::setActiveSlideShow(int index) | 264 | void KPrCustomSlideShowsModel::setActiveSlideShow(int index) | ||
263 | { | 265 | { | ||
264 | if (!m_customSlideShows) { | 266 | if (!m_customSlideShows) { | ||
265 | return; | 267 | return; | ||
266 | } | 268 | } | ||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |