Changeset View
Changeset View
Standalone View
Standalone View
lib/slideshow.cpp
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | 94 | if (GwenviewConfig::random()) { | |||
---|---|---|---|---|---|
95 | return findNextRandomUrl(); | 95 | return findNextRandomUrl(); | ||
96 | } else { | 96 | } else { | ||
97 | return findNextOrderedUrl(); | 97 | return findNextOrderedUrl(); | ||
98 | } | 98 | } | ||
99 | } | 99 | } | ||
100 | 100 | | |||
101 | QUrl findNextOrderedUrl() | 101 | QUrl findNextOrderedUrl() | ||
102 | { | 102 | { | ||
103 | QVector<QUrl>::ConstIterator it = qFind(mUrls.constBegin(), mUrls.constEnd(), mCurrentUrl); | 103 | QVector<QUrl>::ConstIterator it = std::find(mUrls.constBegin(), mUrls.constEnd(), mCurrentUrl); | ||
104 | GV_RETURN_VALUE_IF_FAIL2(it != mUrls.constEnd(), QUrl(), "Current url not found in list."); | 104 | GV_RETURN_VALUE_IF_FAIL2(it != mUrls.constEnd(), QUrl(), "Current url not found in list."); | ||
105 | 105 | | |||
106 | ++it; | 106 | ++it; | ||
107 | if (GwenviewConfig::loop()) { | 107 | if (GwenviewConfig::loop()) { | ||
108 | // Looping, if we reach the end, start again | 108 | // Looping, if we reach the end, start again | ||
109 | if (it == mUrls.constEnd()) { | 109 | if (it == mUrls.constEnd()) { | ||
110 | it = mUrls.constBegin(); | 110 | it = mUrls.constBegin(); | ||
111 | } | 111 | } | ||
▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Line(s) | |||||
211 | QAction* SlideShow::randomAction() const | 211 | QAction* SlideShow::randomAction() const | ||
212 | { | 212 | { | ||
213 | return d->mRandomAction; | 213 | return d->mRandomAction; | ||
214 | } | 214 | } | ||
215 | 215 | | |||
216 | void SlideShow::start(const QList<QUrl>& urls) | 216 | void SlideShow::start(const QList<QUrl>& urls) | ||
217 | { | 217 | { | ||
218 | d->mUrls.resize(urls.size()); | 218 | d->mUrls.resize(urls.size()); | ||
219 | qCopy(urls.begin(), urls.end(), d->mUrls.begin()); | 219 | std::copy(urls.begin(), urls.end(), d->mUrls.begin()); | ||
220 | 220 | | |||
221 | d->mStartIt = qFind(d->mUrls.constBegin(), d->mUrls.constEnd(), d->mCurrentUrl); | 221 | d->mStartIt = std::find(d->mUrls.constBegin(), d->mUrls.constEnd(), d->mCurrentUrl); | ||
222 | if (d->mStartIt == d->mUrls.constEnd()) { | 222 | if (d->mStartIt == d->mUrls.constEnd()) { | ||
223 | qWarning() << "Current url not found in list, aborting.\n"; | 223 | qWarning() << "Current url not found in list, aborting.\n"; | ||
224 | return; | 224 | return; | ||
225 | } | 225 | } | ||
226 | 226 | | |||
227 | if (GwenviewConfig::random()) { | 227 | if (GwenviewConfig::random()) { | ||
228 | d->initShuffledUrls(); | 228 | d->initShuffledUrls(); | ||
229 | } | 229 | } | ||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |