Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gui] add container.actualitems infolabel #10888

Merged
merged 1 commit into from Dec 10, 2016

Conversation

@phil65
Copy link
Member

commented Nov 7, 2016

Absolute amount of items in a container (including parentfolder item).
Much more helpful than Container.NumItems for several use cases.
@HitcherUK @ronie @BigNoid

@phil65 phil65 force-pushed the phil65:container_actualitems branch from 17a8db7 to 80b6129 Nov 7, 2016

@ronie

This comment has been minimized.

Copy link
Member

commented Nov 7, 2016

looks good to me

@@ -1308,6 +1308,12 @@ std::string CGUIBaseContainer::GetLabel(int info) const
label = StringUtils::Format("%u", numItems);
}
break;
case CONTAINER_ACTUAL_ITEMS:

This comment has been minimized.

Copy link
@BigNoid

BigNoid Nov 7, 2016

Member

wouldn't it be easier to combine with CONTAINER_NUM_ITEMS above?

This comment has been minimized.

Copy link
@phil65

phil65 Nov 7, 2016

Author Member

I dont think so, the way it is now only adds two lines of actual code (could even condense it into one).

This comment has been minimized.

Copy link
@BigNoid

BigNoid Nov 7, 2016

Member

Combine is only one line extra:

    case CONTAINER_ACTUAL_ITEMS:
    case CONTAINER_NUM_ITEMS:
    {
      unsigned int numItems = GetNumItems();
      if (info == CONTAINER_NUM_ITEMS && numItems && m_items[0]->IsFileItem() && (std::static_pointer_cast<CFileItem>(m_items[0]))->IsParentFolder())
        label = StringUtils::Format("%u", numItems-1);
      else
        label = StringUtils::Format("%u", numItems);
    }

This comment has been minimized.

Copy link
@phil65

phil65 Nov 7, 2016

Author Member

Also fine for me, doesnt really matter here imo.

This comment has been minimized.

Copy link
@BigNoid

BigNoid Nov 7, 2016

Member

I was told to avoid duplicate code in one of my pr's :)

This comment has been minimized.

Copy link
@phil65

phil65 Nov 7, 2016

Author Member

I know, but in those cases more logic was involved. ;)

This comment has been minimized.

Copy link
@phil65

phil65 Nov 7, 2016

Author Member

Anyways, updated to your suggestion.

/// \table_row3{ <b>`Container(id).ActualItems`</b>,
/// \anchor Container_ActualItems
/// _boolean_,
/// Number of items in the container or grouplist with given id, including parent folder item. If no id is

This comment has been minimized.

Copy link
@AlwinEsch

AlwinEsch Nov 7, 2016

Member

Don't forget the \ before the commas in text!

Is the bad part on doxygen if on a Macro (e.g. \table_row3) are more as one value, then the comma separate the values. If now a text is there also with them brings it problems.

This comment has been minimized.

Copy link
@phil65

phil65 Nov 7, 2016

Author Member

Thx, will fix!

@phil65 phil65 force-pushed the phil65:container_actualitems branch from 80b6129 to 94d9953 Nov 7, 2016

@phil65

This comment has been minimized.

Copy link
Member Author

commented Dec 3, 2016

jenkins build this please.

@MartijnKaijser MartijnKaijser added this to the L 18.0-alpha1 milestone Dec 4, 2016

@phil65

This comment has been minimized.

Copy link
Member Author

commented Dec 10, 2016

jenkins build and merge.

@jenkins4kodi jenkins4kodi merged commit 6f2a2af into xbmc:master Dec 10, 2016

2 of 4 checks passed

default I've found some spare time so building this now
Details
jenkins4kodi Yeah yeah I'll get to it when i have some time
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ksooo

This comment has been minimized.

Copy link
Member

commented Dec 10, 2016

@phil65: PLEASE, no! I guess you mean "current" items, not "actual"? "Actual" is a false friend for Germans as in German "aktuell" means "current". English "actual" means "tatsächlich"!

Due to the large number of Germans in the project we have this language flaw at different places in the api and in the code, already. Please not one more of these, please.

@phil65

This comment has been minimized.

Copy link
Member Author

commented Dec 10, 2016

that label was proposed by @HitcherUK who is native speaker.

@ksooo

This comment has been minimized.

Copy link
Member

commented Dec 10, 2016

that label was proposed by @HitcherUK who is native speaker.

As I'm not a native English speaker... i will shut up, although it still looks strange to me.

@ksooo

This comment has been minimized.

Copy link
Member

commented Dec 10, 2016

Seems I misunderstood the semantics of this new label. I was just explained what it actually is supposed for and yes, then the wording is correct. Sorry for the noise.

@phil65 phil65 deleted the phil65:container_actualitems branch Dec 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.