D10512: try to preload certain applets in a smart way

Marco Martin noreply at phabricator.kde.org
Tue Feb 20 10:02:30 UTC 2018


mart added inline comments.

INLINE COMMENTS

> anthonyfieroni wrote in appletquickitem.cpp:57-68
> So Adaptive can a default even environment variable is not setted?
> Furthermore you can make a static function to access value
> 
>   AppletQuickItemPrivate::PreloadPolicy AppletQuickItemPrivate::appletPolicy()
>   {
>       static const PreloadPolicy preloadPolicy = []() -> PreloadPolicy {
>           if (qEnvironmentVariableIsSet("PLASMA_PRELOAD_POLICY")) {
>               const QString policy = QString::fromUtf8(qgetenv("PLASMA_PRELOAD_POLICY")).toLower();
>               if (policy == QStringLiteral("aggressive")) {
>                   return Aggressive;
>               } else if (policy == QStringLiteral("none")) {
>                   return None;
>               }
>           }
>           return Adaptive;
>       }();
>       return preloadPolicy;
>   }

> So Adaptive can a default even environment variable is not setted?

yes, adaptive is the default

> Furthermore you can make a static function to access value

it's done anyways only once as preloadPolicy is already a static?

REPOSITORY
  R242 Plasma Framework (Library)

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

To: mart, #plasma
Cc: anthonyfieroni, 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/kde-frameworks-devel/attachments/20180220/0950b689/attachment.html>


More information about the Kde-frameworks-devel mailing list