Changeset View
Changeset View
Standalone View
Standalone View
src/abstractrunner.cpp
Show First 20 Lines • Show All 202 Lines • ▼ Show 20 Line(s) | 202 | { | |||
---|---|---|---|---|---|
203 | if (match.urls().isEmpty()) { | 203 | if (match.urls().isEmpty()) { | ||
204 | return nullptr; | 204 | return nullptr; | ||
205 | } | 205 | } | ||
206 | QMimeData *result = new QMimeData(); | 206 | QMimeData *result = new QMimeData(); | ||
207 | result->setUrls(match.urls()); | 207 | result->setUrls(match.urls()); | ||
208 | return result; | 208 | return result; | ||
209 | } | 209 | } | ||
210 | 210 | | |||
211 | #if KRUNNER_BUILD_DEPRECATED_SINCE(5, 70) | ||||
211 | bool AbstractRunner::hasRunOptions() | 212 | bool AbstractRunner::hasRunOptions() | ||
212 | { | 213 | { | ||
213 | return d->hasRunOptions; | 214 | return d->hasRunOptions; | ||
214 | } | 215 | } | ||
215 | 216 | | |||
216 | void AbstractRunner::setHasRunOptions(bool hasRunOptions) | 217 | void AbstractRunner::setHasRunOptions(bool hasRunOptions) | ||
217 | { | 218 | { | ||
218 | d->hasRunOptions = hasRunOptions; | 219 | d->hasRunOptions = hasRunOptions; | ||
219 | } | 220 | } | ||
220 | 221 | | |||
221 | void AbstractRunner::createRunOptions(QWidget *parent) | 222 | void AbstractRunner::createRunOptions(QWidget *parent) | ||
kossebau: Given EXCLUDE_DEPRECATED_BEFORE_AND_AT is used with KRunner, you want to also wrap all the… | |||||
And best practice seems to be not to do mass wrapping of many methods, but do explicitely per method. While more code/lines, has the advantage to be easier to read/understand, as usually begin/emd are in view, and also avoids that actually wrong code is wrapped (e.g. when methods get added later and by accident are placed amid the wrapped ones. kossebau: And best practice seems to be not to do mass wrapping of many methods, but do explicitely per… | |||||
222 | { | 223 | { | ||
223 | Q_UNUSED(parent); | 224 | Q_UNUSED(parent) | ||
224 | } | 225 | } | ||
226 | #endif | ||||
225 | 227 | | |||
226 | AbstractRunner::Speed AbstractRunner::speed() const | 228 | AbstractRunner::Speed AbstractRunner::speed() const | ||
227 | { | 229 | { | ||
228 | // the only time the read lock will fail is if we were slow are going to speed up | 230 | // the only time the read lock will fail is if we were slow are going to speed up | ||
229 | // or if we were fast and are going to slow down; so don't wait in this case, just | 231 | // or if we were fast and are going to slow down; so don't wait in this case, just | ||
230 | // say we're slow. we either will be soon or were just a moment ago and it doesn't | 232 | // say we're slow. we either will be soon or were just a moment ago and it doesn't | ||
231 | // hurt to do one more run the slow way | 233 | // hurt to do one more run the slow way | ||
232 | if (!d->speedLock.tryLockForRead()) { | 234 | if (!d->speedLock.tryLockForRead()) { | ||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |
Given EXCLUDE_DEPRECATED_BEFORE_AND_AT is used with KRunner, you want to also wrap all the implementations of the now deprecated API with the BUILD variant of the macro, so here for example:
This allows to build KRunner itself without any of the deprecated API actually part of the build.
Test yourself by setting the cmake var EXCLUDE_DEPRECATED_BEFORE_AND_AT=CURRENT (e.g. edit the var in the cmake cache).