summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Schweer <ws.seh.de>2006-10-13 11:48:44 +0000
committerWerner Schweer <ws.seh.de>2006-10-13 11:48:44 +0000
commit96c6663ceeb1cf134b2c365a5d21285297ca6001 (patch)
treecf83f1f2bfe02a01aaf6d1402aff98366c5efd9f
parent0e96d0cae4f978d2e746ca304c06869f8b0236b5 (diff)
remove old plugin guis when loading new song
-rw-r--r--muse/muse/muse.cpp25
1 files 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,