D8493: Make Folder View screen aware

Milian Wolff noreply at phabricator.kde.org
Thu Nov 16 10:46:10 UTC 2017


mwolff added inline comments.

INLINE COMMENTS

> screenmapper.cpp:82
> +        // the screen got completely removed, not only its path changed
> +        pathIt = m_screensPerPath.begin();
> +        while (pathIt != m_screensPerPath.end()) {

personally I'd make this code explicit. i.e. this here is somewhat harder to grasp I think (and also slower, due to the repeated lookups) to something like this:

  const auto newFirstScreen = std::min_element(m_availableScreens.constBegin(), m_availableScreens.constEnd());
  for (auto &screen : m_firstScreenForPath) {
      if (screen == screenId) {
          screen = newFirstScreen;
      }
  }

potentially we also need to update m_screensPerPath though, which the current code doesn't do either. The branch above does write to `pathIt` though, is this missing here?

> screenmapper.cpp:105
> +        for (const auto &name: it.value()) {
> +            const auto url = QUrl(name);
> +            // add the items to the new screen, if they are on a disabled screen and their

unused variable, remove

REPOSITORY
  R119 Plasma Desktop

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

To: amantia, #plasma, ervin, mlaurent, dvratil, hein, aacid, davidedmundson, apol, mwolff
Cc: anthonyfieroni, ngraham, mwolff, davidedmundson, broulik, mart, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20171116/a6bb9d75/attachment.html>


More information about the Plasma-devel mailing list