[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    D14426: [Folder View] Create KFilePlacesModel only when needed and listen for changes
From:       Kai Uwe Broulik <noreply () phabricator ! kde ! org>
Date:       2018-09-10 8:08:37
Message-ID: 1a253d38631e89b94be7ab38ae36f7a1 () localhost ! localdomain
[Download RAW message or body]

[Attachment #2 (text/plain)]

broulik updated this revision to Diff 41318.
broulik edited the summary of this revision.
broulik added a comment.


  - Make `KFilePlacesModel` `static` and ref-counted
  
  For simplicify the ref count is increased/decreased in the constructor and not \
depending on whether the model is actually used, e.g. when user changes setting from \
default display label to something else. This would make the patch super complicated \
otherwise. The model is then only not loaded again on next startup.

REPOSITORY
  R119 Plasma Desktop

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D14426?vs=38587&id=41318

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

AFFECTED FILES
  containments/desktop/plugins/folder/labelgenerator.cpp
  containments/desktop/plugins/folder/labelgenerator.h

To: broulik, #plasma, hein
Cc: plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, \
abetts, sebas, apol, mart


[Attachment #3 (text/html)]

<table><tr><td style="">broulik updated this revision to Diff 41318.<br />broulik \
edited the summary of this revision. <a \
href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-t7oy3lerwqd223h/">(Show \
Details)</a><br />broulik added a comment. </td><a style="text-decoration: none; \
padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; \
border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to \
bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" \
href="https://phabricator.kde.org/D14426">View Revision</a></tr></table><br \
/><div><div><ul class="remarkup-list"> <li class="remarkup-list-item">Make <tt \
style="background: #ebebeb; font-size: 13px;">KFilePlacesModel</tt> <tt \
style="background: #ebebeb; font-size: 13px;">static</tt> and ref-counted</li> </ul>

<p>For simplicify the ref count is increased/decreased in the constructor and not \
depending on whether the model is actually used, e.g. when user changes setting from \
default display label to something else. This would make the patch super complicated \
otherwise. The model is then only not loaded again on next \
startup.</p></div></div><br /><div><strong>CHANGES TO REVISION \
SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;">When no \
label is displayed, there&#039;s no point in creating a `KFilePlacesModel`<span \
style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, \
.6);">.</span><br /> Also, only emit a change for `displayLabel` when it actually \
changed.<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, \
.6);"><br /> Moreover, listen to changes in the `KFilePlacesModel` and update the \
label if needed.</span><br /> <span style="padding: 0 2px; color: #333333; \
background: rgba(251, 175, 175, .7);">Moreover</span><span style="padding: 0 2px; \
color: #333333; background: rgba(151, 234, 151, .6);">Also</span>, <span \
style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">listen \
to changes in</span><span style="padding: 0 2px; color: #333333; background: \
rgba(151, 234, 151, .6);">make</span> the `KFilePlacesModel`<span style="padding: 0 \
2px; color: #333333; background: rgba(151, 234, 151, .6);"> static</span> and <span \
style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">update \
the label if needed</span><span style="padding: 0 2px; color: #333333; background: \
rgba(151, 234, 151, .6);">shared between all Folder View \
instances.</span></div></div></div><br \
/><div><strong>REPOSITORY</strong><div><div>R119 Plasma Desktop</div></div></div><br \
/><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a \
href="https://phabricator.kde.org/D14426?vs=38587&amp;id=41318">https://phabricator.kde.org/D14426?vs=38587&amp;id=41318</a></div></div><br \
/><div><strong>REVISION DETAIL</strong><div><a \
href="https://phabricator.kde.org/D14426">https://phabricator.kde.org/D14426</a></div></div><br \
/><div><strong>AFFECTED \
FILES</strong><div><div>containments/desktop/plugins/folder/labelgenerator.cpp<br /> \
containments/desktop/plugins/folder/labelgenerator.h</div></div></div><br \
/><div><strong>To: </strong>broulik, Plasma, hein<br /><strong>Cc: \
</strong>plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, \
jensreuterberg, abetts, sebas, apol, mart<br /></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic