anthonyfieroni added inline comments.

INLINE COMMENTS

> appletquickitem.cpp:57-68
> +    if (s_preloadPolicy == Uninitialized) {
> +        if (qEnvironmentVariableIsSet("PLASMA_PRELOAD_POLICY")) {
> +            const QString policy = 
> QString::fromUtf8(qgetenv("PLASMA_PRELOAD_POLICY")).toLower();
> +            if (policy == QStringLiteral("aggressive")) {
> +                s_preloadPolicy = Aggressive;
> +            } else if (policy == QStringLiteral("none")) {
> +                s_preloadPolicy = None;

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;
  }

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

Reply via email to