Skip to content

Commit 1d353d3

Browse files
author
Tim
committed
Further Event List fixes
1 parent 820c56c commit 1d353d3

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/muse/app.cpp

+11-9
Original file line numberDiff line numberDiff line change
@@ -3412,28 +3412,30 @@ MusEGui::ListEdit* MusE::findOpenListEditor(MusECore::PartList* pl) {
34123412
&& QGuiApplication::keyboardModifiers() & Qt::AltModifier)
34133413
return nullptr;
34143414

3415+
const unsigned int pl_sz = pl->size();
3416+
if(pl_sz == 0)
3417+
return nullptr;
3418+
34153419
for (const auto& d : findChildren<QDockWidget*>()) {
34163420
if (strcmp(d->widget()->metaObject()->className(), "MusEGui::ListEdit") != 0)
34173421
continue;
34183422

34193423
MusEGui::ListEdit* le = static_cast<MusEGui::ListEdit*>(d->widget());
34203424
const MusECore::PartList* pl_tmp = le->parts();
34213425

3422-
bool found = false;
3423-
for(MusECore::ciPart ip_tmp = pl_tmp->cbegin(); ip_tmp != pl_tmp->cend(); ++ip_tmp)
3426+
MusECore::ciPart ip = pl->cbegin();
3427+
for(; ip != pl->cend(); ++ip)
34243428
{
3425-
for(MusECore::ciPart ip = pl->cbegin(); ip != pl->cend(); ++ip)
3429+
MusECore::ciPart ip_tmp = pl_tmp->cbegin();
3430+
for(; ip_tmp != pl_tmp->cend(); ++ip_tmp)
34263431
{
3427-
if(ip->second->uuid() == ip_tmp->second->uuid())
3428-
{
3429-
found = true;
3432+
if(ip_tmp->second->uuid() == ip->second->uuid())
34303433
break;
3431-
}
34323434
}
3433-
if(found)
3435+
if(ip_tmp == pl_tmp->cend())
34343436
break;
34353437
}
3436-
if(!found)
3438+
if(ip != pl->cend())
34373439
continue;
34383440

34393441
if (!d->isVisible())

0 commit comments

Comments
 (0)