D10512: try to preload certain applets in a smart way

Kai Uwe Broulik noreply at phabricator.kde.org
Mon Feb 19 16:58:11 UTC 2018


broulik added inline comments.

INLINE COMMENTS

> appletquickitem.cpp:55
>  {
> +    if (qEnvironmentVariableIsSet("KDE_PLASMA_PRELOAD_POLICY")) {
> +        const QByteArray policy = qgetenv("KDE_PLASMA_PRELOAD_POLICY");

Cache the result in a static to read it only once?

> appletquickitem.cpp:57
> +        const QByteArray policy = qgetenv("KDE_PLASMA_PRELOAD_POLICY");
> +        if (policy == "Aggressive") {
> +            preloadPolicy = Aggressive;

case insensitive?

> appletquickitem.cpp:653
> +            const int delay = qrand() % ((max + 1) - min) + min;
> +            QTimer::singleShot(delay, [this, delay]() {
> +                qCInfo(LOG_PLASMAQUICK) << "Delayed preload of " << d->applet->title() << "after" << (qreal)delay/1000 << "seconds";

Still missing `this` context:

  QTimer::singleShot(delay, this, [this, delay]() {

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D10512

To: mart, #plasma
Cc: davidedmundson, broulik, apol, ngraham, plasma-devel, #frameworks, michaelh, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180219/b14a8fd0/attachment.html>


More information about the Plasma-devel mailing list