Skip to content

Commit

Permalink
eListboxPythonServiceContent: fix sonar warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jbleyel authored and fairbird committed Jan 19, 2024
1 parent efe8aab commit 479face
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/service/elistboxservicecontent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,13 +567,14 @@ bool eListboxPythonServiceContent::getIsMarked(int selected)
void eListboxPythonServiceContent::setBuildArgs(int selected)
{
eServiceReference &ref = *m_service_cursor;
bool isSelected = selected > 0;
bool isFolder = ref.flags & eServiceReference::isDirectory;
bool isMarker = ref.flags & eServiceReference::isMarker;
bool isPlayable = !(isFolder || isMarker);
bool isRecorded = m_record_indicator_mode && isPlayable && checkServiceIsRecorded(ref,pNavigation::RecordType(pNavigation::isRealRecording|pNavigation::isUnknownRecording));
bool isStreamed = m_record_indicator_mode && isPlayable && checkServiceIsRecorded(ref,pNavigation::isStreaming);
bool isPseudoRecorded = m_record_indicator_mode && isPlayable && checkServiceIsRecorded(ref,pNavigation::isPseudoRecording);
bool marked = ((m_current_marked && selected) || (cursorValid() && isMarked(*m_service_cursor)));
bool marked = ((m_current_marked && isSelected) || (cursorValid() && isMarked(*m_service_cursor)));

// status bitmask
// 1 selected
Expand All @@ -585,7 +586,7 @@ void eListboxPythonServiceContent::setBuildArgs(int selected)
// 64 isPseudoRecorded
// 128 isFolder

int status = (selected << 0) + (marked << 1) + (isMarker << 2) + (isPlayable << 3) + (isRecorded << 4) + (isStreamed << 5) + (isPseudoRecorded << 6) + (isFolder << 7);
int status = (isSelected << 0) + (marked << 1) + (isMarker << 2) + (isPlayable << 3) + (isRecorded << 4) + (isStreamed << 5) + (isPseudoRecorded << 6) + (isFolder << 7);

m_pArgs = PyTuple_New(2);
PyTuple_SET_ITEM(m_pArgs, 0, NEW_eServiceReference(ref));
Expand Down

0 comments on commit 479face

Please sign in to comment.