Tracker: Make sure count > 0
... in a more stylish way, no negative counts allowed.
This commit is contained in:
@@ -3058,7 +3058,7 @@ void
|
|||||||
BContainerWindow::BuildMimeTypeList(BObjectList<BString> &mimeTypes)
|
BContainerWindow::BuildMimeTypeList(BObjectList<BString> &mimeTypes)
|
||||||
{
|
{
|
||||||
int32 count = PoseView()->SelectionList()->CountItems();
|
int32 count = PoseView()->SelectionList()->CountItems();
|
||||||
if (!count) {
|
if (count > 0) {
|
||||||
// just add the type of the current directory
|
// just add the type of the current directory
|
||||||
AddMimeTypeString(mimeTypes, TargetModel());
|
AddMimeTypeString(mimeTypes, TargetModel());
|
||||||
} else {
|
} else {
|
||||||
@@ -3127,7 +3127,7 @@ BContainerWindow::BuildAddOnMenu(BMenu* menu)
|
|||||||
for (int32 index = 0; index < count; index++)
|
for (int32 index = 0; index < count; index++)
|
||||||
menu->AddItem(primaryList.ItemAt(index));
|
menu->AddItem(primaryList.ItemAt(index));
|
||||||
|
|
||||||
if (count != 0)
|
if (count > 0)
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
count = secondaryList.CountItems();
|
count = secondaryList.CountItems();
|
||||||
|
|||||||
Reference in New Issue
Block a user