From 96c6663ceeb1cf134b2c365a5d21285297ca6001 Mon Sep 17 00:00:00 2001 From: Werner Schweer Date: Fri, 13 Oct 2006 11:48:44 +0000 Subject: remove old plugin guis when loading new song --- muse/muse/muse.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp index cc4e7221..0ac714c9 100644 --- a/muse/muse/muse.cpp +++ b/muse/muse/muse.cpp @@ -1162,16 +1162,16 @@ void MusE::loadProject1(const QString& path) foreach(QWidget* w, QApplication::topLevelWidgets()) { if (!w->isVisible()) continue; - if (strcmp("DrumEdit", w->metaObject()->className()) == 0) - w->close(); - else if (strcmp("PianoRoll", w->metaObject()->className()) == 0) - w->close(); - else if (strcmp("MasterEdit", w->metaObject()->className()) == 0) - w->close(); - else if (strcmp("WaveEdit", w->metaObject()->className()) == 0) - w->close(); - else if (strcmp("ListEdit", w->metaObject()->className()) == 0) - w->close(); + static const char* const top[] = { + "DrumEdit", "PianoRoll", "MasterEdit", "WaveEdit", + "ListEdit", "PluginGui" + }; + for (unsigned i = 0; i < sizeof(top)/sizeof(*top); ++i) { + if (strcmp(top[i], w->metaObject()->className()) == 0) { + w->close(); + break; + } + } } emit startLoadSong(); @@ -1358,11 +1358,6 @@ void MusE::quitDoc() bool MusE::leaveProject() { - // - // delete all wave files created in this session and not - // referenced any more - // - if (song->dirty) { int n = 0; n = QMessageBox::warning(this, appName, -- cgit v1.2.3