Added Auto-Expand Folder On Unread option
ClosedPublic

Authored by sagara on Oct 7 2017, 4:07 AM.

Details

Summary

This patch adds a new option, to auto-expand folders whenever any of its
children have unread content. This makes it quicker to navigate to new
content when using folders.

akregator_part.rc:

  • added an action to <Menu name="view"> with name=auto_expand_folders
  • bumped version

settings_general.ui:

  • added kcfg_AutoExpandFolders field under General->Global

subscriptionlistview:

  • added slotSetAutoExpandFolders to expand any unread folders when enabling the auto_expand_folders setting

actionmanagerimpl:

  • added code to slotSettingsChanged, to update the auto_expand_folders action state
  • added a KAction to ActionManagerImpl:initSubscriptionListView, connected to SubscriptionListView::slotSetAutoExpandFolders

selectioncontroller:

  • added subscriptionDataChanged to update folder expand state for newly updated items
  • connect m_subscriptionModel's dataChanged signal to subscriptionDataChanged

Diff Detail

Repository
R201 Akregator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sagara created this revision.Oct 7 2017, 4:07 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptOct 7 2017, 4:07 AM
Restricted Application added a subscriber: KDE PIM. · View Herald Transcript
dvratil requested changes to this revision.Oct 7 2017, 2:40 PM
dvratil added a subscriber: dvratil.
dvratil added inline comments.
src/selectioncontroller.cpp
277

Spaces around =

src/subscription/subscriptionlistview.cpp
430

Spaces around =

438

Shouldn't this call setExpanded(current, true)? The condition implies that the current index has unread (sub)feeds and thus should be expanded, no?

This revision now requires changes to proceed.Oct 7 2017, 2:40 PM
sagara marked 3 inline comments as done.Oct 7 2017, 4:11 PM
sagara updated this revision to Diff 20449.Oct 7 2017, 4:11 PM
  • Style, logic fixes
sagara added inline comments.Oct 7 2017, 4:14 PM
src/subscription/subscriptionlistview.cpp
438

Yes, I moved the statement out to keep the indentation flat during cleanup but seems I forgot to negate the condition when doing so. At a quick glance the patch seemed to work alright so I didn't pick up on it.

dvratil accepted this revision.Oct 9 2017, 2:08 PM

Looks good to me now, thanks!

Do you have a developer account, or should I push it for you?

This revision is now accepted and ready to land.Oct 9 2017, 2:08 PM
sagara added a comment.Oct 9 2017, 4:21 PM

I don't have a developer account, so could you push it for me?

This revision was automatically updated to reflect the committed changes.