From 01d2680f0d18f7783ca1e1f48098590cd0317284 Mon Sep 17 00:00:00 2001
From: Florian Jung <flo@windfisch.org>
Date: Sun, 14 Aug 2011 18:24:47 +0000
Subject: removed the senseless (unsigned long)(some_pointer) stuff, as
 some_pointer was stored as "real" (uncasted) pointer in the same struct

---
 muse2/muse/app.cpp                   | 45 ++++++++++++++++++------------------
 muse2/muse/app.h                     |  2 +-
 muse2/muse/arranger/arrangerview.cpp |  4 ++--
 muse2/muse/arranger/arrangerview.h   |  2 +-
 muse2/muse/cliplist/cliplist.cpp     |  2 +-
 muse2/muse/cliplist/cliplist.h       |  2 +-
 muse2/muse/cobject.h                 |  9 +++-----
 muse2/muse/liste/listedit.cpp        |  2 +-
 muse2/muse/liste/listedit.h          |  2 +-
 muse2/muse/marker/markerview.cpp     |  2 +-
 muse2/muse/marker/markerview.h       |  2 +-
 muse2/muse/master/lmaster.cpp        |  2 +-
 muse2/muse/master/lmaster.h          |  2 +-
 muse2/muse/master/masteredit.cpp     |  2 +-
 muse2/muse/master/masteredit.h       |  2 +-
 muse2/muse/midiedit/drumedit.cpp     |  2 +-
 muse2/muse/midiedit/drumedit.h       |  2 +-
 muse2/muse/midiedit/pianoroll.cpp    |  2 +-
 muse2/muse/midiedit/pianoroll.h      |  2 +-
 muse2/muse/midiedit/scoreedit.cpp    |  2 +-
 muse2/muse/midiedit/scoreedit.h      |  2 +-
 muse2/muse/songfile.cpp              | 24 +++++++++----------
 muse2/muse/waveedit/waveedit.cpp     |  2 +-
 muse2/muse/waveedit/waveedit.h       |  2 +-
 muse2/muse/widgets/midisyncimpl.cpp  |  2 --
 muse2/muse/widgets/midisyncimpl.h    |  3 ---
 26 files changed, 59 insertions(+), 68 deletions(-)

(limited to 'muse2')

diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp
index 74eda773..cb1b9363 100644
--- a/muse2/muse/app.cpp
+++ b/muse2/muse/app.cpp
@@ -874,7 +874,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow()
       arrangerView = new ArrangerView(this);
       arrangerView->shareToolsAndMenu(true);
       connect(arrangerView, SIGNAL(closed()), SLOT(arrangerClosed()));
-      toplevels.push_back(Toplevel(Toplevel::ARRANGER, (unsigned long)(arrangerView), arrangerView));
+      toplevels.push_back(Toplevel(Toplevel::ARRANGER, arrangerView));
       arrangerView->hide();
       arranger=arrangerView->getArranger();
       
@@ -1550,7 +1550,7 @@ void MusE::showMarker(bool flag)
             markerView = new MarkerView(this);
 
             connect(markerView, SIGNAL(closed()), SLOT(markerClosed()));
-            toplevels.push_back(Toplevel(Toplevel::MARKER, (unsigned long)(markerView), markerView));
+            toplevels.push_back(Toplevel(Toplevel::MARKER, markerView));
             markerView->show();
             }
       markerView->setVisible(flag);
@@ -1748,8 +1748,8 @@ void MusE::openInScoreEdit(ScoreEdit* destination, PartList* pl, bool allInOne)
 	{
       destination = new ScoreEdit(this, 0, arranger->cursorValue());
       destination->show();
-      toplevels.push_back(Toplevel(Toplevel::SCORE, (unsigned long)(destination), destination));
-      connect(destination, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long)));
+      toplevels.push_back(Toplevel(Toplevel::SCORE, destination));
+      connect(destination, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
       connect(destination, SIGNAL(name_changed()), arrangerView, SLOT(scoreNamingChanged()));
       //connect(muse, SIGNAL(configChanged()), destination, SLOT(config_changed()));
       //commented out by flo, because the ScoreEditor connects to all 
@@ -1786,8 +1786,8 @@ void MusE::startPianoroll(PartList* pl, bool showDefaultCtrls)
       if(showDefaultCtrls)       // p4.0.12
         pianoroll->addCtrl();
       pianoroll->show();
-      toplevels.push_back(Toplevel(Toplevel::PIANO_ROLL, (unsigned long)(pianoroll), pianoroll));
-      connect(pianoroll, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long)));
+      toplevels.push_back(Toplevel(Toplevel::PIANO_ROLL, pianoroll));
+      connect(pianoroll, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
       connect(muse, SIGNAL(configChanged()), pianoroll, SLOT(configChanged()));
       }
 
@@ -1807,8 +1807,8 @@ void MusE::startListEditor(PartList* pl)
       {
       ListEdit* listEditor = new ListEdit(pl);
       listEditor->show();
-      toplevels.push_back(Toplevel(Toplevel::LISTE, (unsigned long)(listEditor), listEditor));
-      connect(listEditor, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long)));
+      toplevels.push_back(Toplevel(Toplevel::LISTE, listEditor));
+      connect(listEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
       connect(muse,SIGNAL(configChanged()), listEditor, SLOT(configChanged()));
       }
 
@@ -1820,8 +1820,8 @@ void MusE::startMasterEditor()
       {
       MasterEdit* masterEditor = new MasterEdit();
       masterEditor->show();
-      toplevels.push_back(Toplevel(Toplevel::MASTER, (unsigned long)(masterEditor), masterEditor));
-      connect(masterEditor, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long)));
+      toplevels.push_back(Toplevel(Toplevel::MASTER, masterEditor));
+      connect(masterEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
       }
 
 //---------------------------------------------------------
@@ -1832,8 +1832,8 @@ void MusE::startLMasterEditor()
       {
       LMaster* lmaster = new LMaster();
       lmaster->show();
-      toplevels.push_back(Toplevel(Toplevel::LMASTER, (unsigned long)(lmaster), lmaster));
-      connect(lmaster, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long)));
+      toplevels.push_back(Toplevel(Toplevel::LMASTER, lmaster));
+      connect(lmaster, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
       connect(muse, SIGNAL(configChanged()), lmaster, SLOT(configChanged()));
       }
 
@@ -1856,8 +1856,8 @@ void MusE::startDrumEditor(PartList* pl, bool showDefaultCtrls)
       if(showDefaultCtrls)       // p4.0.12
         drumEditor->addCtrl();
       drumEditor->show();
-      toplevels.push_back(Toplevel(Toplevel::DRUM, (unsigned long)(drumEditor), drumEditor));
-      connect(drumEditor, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long)));
+      toplevels.push_back(Toplevel(Toplevel::DRUM, drumEditor));
+      connect(drumEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
       connect(muse, SIGNAL(configChanged()), drumEditor, SLOT(configChanged()));
       }
 
@@ -1880,8 +1880,8 @@ void MusE::startWaveEditor(PartList* pl)
       WaveEdit* waveEditor = new WaveEdit(pl);
       waveEditor->show();
       connect(muse, SIGNAL(configChanged()), waveEditor, SLOT(configChanged()));
-      toplevels.push_back(Toplevel(Toplevel::WAVE, (unsigned long)(waveEditor), waveEditor));
-      connect(waveEditor, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long)));
+      toplevels.push_back(Toplevel(Toplevel::WAVE, waveEditor));
+      connect(waveEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
       }
 
 
@@ -1937,8 +1937,8 @@ void MusE::startClipList(bool checked)
       if (clipListEdit == 0) {
             //clipListEdit = new ClipListEdit();
             clipListEdit = new ClipListEdit(this);
-            toplevels.push_back(Toplevel(Toplevel::CLIPLIST, (unsigned long)(clipListEdit), clipListEdit));
-            connect(clipListEdit, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long)));
+            toplevels.push_back(Toplevel(Toplevel::CLIPLIST, clipListEdit));
+            connect(clipListEdit, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
             }
       clipListEdit->show();
       viewCliplistAction->setChecked(checked);
@@ -1986,12 +1986,12 @@ void MusE::selectProject(QAction* act)
 //   toplevelDeleted
 //---------------------------------------------------------
 
-void MusE::toplevelDeleted(unsigned long tl)
+void MusE::toplevelDeleted(TopWin* tl)
       {
       for (iToplevel i = toplevels.begin(); i != toplevels.end(); ++i) {
             if (i->object() == tl) {
                   
-                  if (i->cobject() == currentMenuSharingTopwin)
+                  if (tl == currentMenuSharingTopwin)
                     setCurrentMenuSharingTopwin(NULL);
               
               
@@ -2025,7 +2025,7 @@ void MusE::toplevelDeleted(unsigned long tl)
                   return;
                   }
             }
-      printf("topLevelDeleted: top level %lx not found\n", tl);
+      printf("topLevelDeleted: top level %p not found\n", tl);
       //assert(false);
       }
 
@@ -2624,7 +2624,6 @@ bool MusE::clearSong(bool clear_all)
 again:
       for (iToplevel i = toplevels.begin(); i != toplevels.end(); ++i) {
             Toplevel tl = *i;
-            unsigned long obj = tl.object();
             switch (tl.type()) {
                   case Toplevel::CLIPLIST:
                   case Toplevel::MARKER:
@@ -2637,7 +2636,7 @@ again:
                   case Toplevel::MASTER:
                   case Toplevel::WAVE:
                   case Toplevel::LMASTER:
-                        ((QWidget*)(obj))->close();
+                        tl.object()->close();
                         goto again;
                   }
             }
diff --git a/muse2/muse/app.h b/muse2/muse/app.h
index f1d112e9..a070c864 100644
--- a/muse2/muse/app.h
+++ b/muse2/muse/app.h
@@ -294,7 +294,7 @@ class MusE : public QMainWindow
       void closeEvent(QCloseEvent*e);
       void loadProjectFile(const QString&);
       void loadProjectFile(const QString&, bool songTemplate, bool loadAll);
-      void toplevelDeleted(unsigned long tl);
+      void toplevelDeleted(TopWin* tl);
       void loadTheme(const QString&);
       void loadStyleSheetFile(const QString&);
       bool seqRestart();
diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp
index e9ace563..8c0627b4 100644
--- a/muse2/muse/arranger/arrangerview.cpp
+++ b/muse2/muse/arranger/arrangerview.cpp
@@ -581,7 +581,7 @@ ArrangerView::~ArrangerView()
 
 void ArrangerView::closeEvent(QCloseEvent* e)
 {
-	emit deleted((unsigned long)this);
+	emit deleted(static_cast<TopWin*>(this));
 	emit closed();
 	e->accept();
 }
@@ -759,7 +759,7 @@ void ArrangerView::updateScoreMenus()
 	for (ToplevelList::const_iterator it=toplevels->begin(); it!=toplevels->end(); it++)
 		if (it->type()==Toplevel::SCORE)
 		{
-			ScoreEdit* score = (ScoreEdit*) it->cobject();
+			ScoreEdit* score = (ScoreEdit*) it->object();
 			
 			action=new QAction(score->get_name(), this);
 			connect(action, SIGNAL(activated()), scoreOneStaffPerTrackMapper, SLOT(map()));
diff --git a/muse2/muse/arranger/arrangerview.h b/muse2/muse/arranger/arrangerview.h
index 9f869402..dc4aa638 100644
--- a/muse2/muse/arranger/arrangerview.h
+++ b/muse2/muse/arranger/arrangerview.h
@@ -102,7 +102,7 @@ class ArrangerView : public TopWin
       void cmd(int);
 		
    signals:
-      void deleted(unsigned long);
+      void deleted(TopWin*);
       void closed();
 		
 	public:
diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp
index 96636463..35d38b3d 100644
--- a/muse2/muse/cliplist/cliplist.cpp
+++ b/muse2/muse/cliplist/cliplist.cpp
@@ -149,7 +149,7 @@ void ClipListEdit::updateList()
 
 void ClipListEdit::closeEvent(QCloseEvent* e)
       {
-      emit deleted((unsigned long)this);
+      emit deleted(static_cast<TopWin*>(this));
       e->accept();
       }
 
diff --git a/muse2/muse/cliplist/cliplist.h b/muse2/muse/cliplist/cliplist.h
index d440aec3..e452478a 100644
--- a/muse2/muse/cliplist/cliplist.h
+++ b/muse2/muse/cliplist/cliplist.h
@@ -54,7 +54,7 @@ class ClipListEdit : public TopWin {
       void clicked(QTreeWidgetItem*, int);
 
    signals:
-      void deleted(unsigned long);
+      void deleted(TopWin*);
 
    public:
       ClipListEdit(QWidget* parent);
diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h
index 6244e876..48653f4b 100644
--- a/muse2/muse/cobject.h
+++ b/muse2/muse/cobject.h
@@ -77,19 +77,16 @@ class Toplevel {
          , M_PATCHBAY
 #endif /* PATCHBAY */
          };
-      Toplevel(ToplevelType t, unsigned long obj, TopWin* cobj) {
+      Toplevel(ToplevelType t, TopWin* obj) {
             _type = t;
             _object = obj;
-            _cobject = cobj;
             }
       ToplevelType type() const { return _type; }
-      unsigned long object()        const { return _object; }
-      TopWin* cobject()   const { return _cobject; }
+      TopWin* object()   const { return _object; }
       
    private:
       ToplevelType _type;
-      unsigned long _object;
-      TopWin* _cobject;
+      TopWin* _object;
       };
 
 typedef std::list <Toplevel> ToplevelList;
diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp
index 5f73a3ba..887fc4f7 100644
--- a/muse2/muse/liste/listedit.cpp
+++ b/muse2/muse/liste/listedit.cpp
@@ -165,7 +165,7 @@ static QString midiMetaComment(const Event& ev)
 
 void ListEdit::closeEvent(QCloseEvent* e)
       {
-      emit deleted((unsigned long)this);
+      emit deleted(static_cast<TopWin*>(this));
       e->accept();
       }
 
diff --git a/muse2/muse/liste/listedit.h b/muse2/muse/liste/listedit.h
index 397a5e08..9e29035e 100644
--- a/muse2/muse/liste/listedit.h
+++ b/muse2/muse/liste/listedit.h
@@ -68,7 +68,7 @@ class ListEdit : public MidiEditor {
       void songChanged(int);
 
    signals:
-      void deleted(unsigned long);
+      void deleted(TopWin*);
 
    public:
       ListEdit(PartList*);
diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp
index d22807b6..8a13e118 100644
--- a/muse2/muse/marker/markerview.cpp
+++ b/muse2/muse/marker/markerview.cpp
@@ -141,7 +141,7 @@ void MarkerItem::setTick(unsigned v)
 
 void MarkerView::closeEvent(QCloseEvent* e)
       {
-      emit deleted((unsigned long)this);
+      emit deleted(static_cast<TopWin*>(this));
       emit closed();
       e->accept();
       }
diff --git a/muse2/muse/marker/markerview.h b/muse2/muse/marker/markerview.h
index 5ad4f4bd..94a6314e 100644
--- a/muse2/muse/marker/markerview.h
+++ b/muse2/muse/marker/markerview.h
@@ -77,7 +77,7 @@ class MarkerView : public TopWin {
       void songChanged(int);
       
    signals:
-      void deleted(unsigned long);
+      void deleted(TopWin*);
       void closed();
 
    public:
diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp
index 9083c024..9d61311e 100644
--- a/muse2/muse/master/lmaster.cpp
+++ b/muse2/muse/master/lmaster.cpp
@@ -95,7 +95,7 @@ QString keyToString(key_enum key) //flo
 
 void LMaster::closeEvent(QCloseEvent* e)
       {
-      emit deleted((unsigned long)this);
+      emit deleted(static_cast<TopWin*>(this));
       e->accept();
       }
 
diff --git a/muse2/muse/master/lmaster.h b/muse2/muse/master/lmaster.h
index b2919b23..a64fd49d 100644
--- a/muse2/muse/master/lmaster.h
+++ b/muse2/muse/master/lmaster.h
@@ -156,7 +156,7 @@ class LMaster : public MidiEditor {
       void configChanged();
 
    signals:
-      void deleted(unsigned long);
+      void deleted(TopWin*);
       void seekTo(int tick);
 
    public:
diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp
index 9053f3a8..8d41e37a 100644
--- a/muse2/muse/master/masteredit.cpp
+++ b/muse2/muse/master/masteredit.cpp
@@ -43,7 +43,7 @@ QByteArray MasterEdit::_toolbarInit;
 
 void MasterEdit::closeEvent(QCloseEvent* e)
       {
-      emit deleted((unsigned long)this);
+      emit deleted(static_cast<TopWin*>(this));
       e->accept();
       }
 
diff --git a/muse2/muse/master/masteredit.h b/muse2/muse/master/masteredit.h
index b2b06291..011ea302 100644
--- a/muse2/muse/master/masteredit.h
+++ b/muse2/muse/master/masteredit.h
@@ -81,7 +81,7 @@ class MasterEdit : public MidiEditor {
 //      void tempoChanged(double);
 
    signals:
-      void deleted(unsigned long);
+      void deleted(TopWin*);
 
    public:
       MasterEdit();
diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp
index e6326cf9..fde698ce 100644
--- a/muse2/muse/midiedit/drumedit.cpp
+++ b/muse2/muse/midiedit/drumedit.cpp
@@ -147,7 +147,7 @@ void DrumEdit::closeEvent(QCloseEvent* e)
       _dlistWidthInit = *it; //There are only 2 values stored in the sizelist, size of dlist widget and dcanvas widget
       it++;
       _dcanvasWidthInit = *it;
-      emit deleted((unsigned long)this);
+      emit deleted(static_cast<TopWin*>(this));
       e->accept();
       }
 
diff --git a/muse2/muse/midiedit/drumedit.h b/muse2/muse/midiedit/drumedit.h
index 64390cd9..a9ec4d06 100644
--- a/muse2/muse/midiedit/drumedit.h
+++ b/muse2/muse/midiedit/drumedit.h
@@ -122,7 +122,7 @@ class DrumEdit : public MidiEditor {
       
       virtual void updateHScrollRange();
    signals:
-      void deleted(unsigned long);
+      void deleted(TopWin*);
 
    public:
       DrumEdit(PartList*, QWidget* parent = 0, const char* name = 0, unsigned initPos = MAXINT);
diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp
index b2fe55ee..46c59f2f 100644
--- a/muse2/muse/midiedit/pianoroll.cpp
+++ b/muse2/muse/midiedit/pianoroll.cpp
@@ -788,7 +788,7 @@ void PianoRoll::closeEvent(QCloseEvent* e)
       //settings.setValue("Pianoroll/geometry", saveGeometry());
       settings.setValue("Pianoroll/windowState", saveState());
 
-      emit deleted((unsigned long)this);
+      emit deleted(static_cast<TopWin*>(this));
       e->accept();
       }
 
diff --git a/muse2/muse/midiedit/pianoroll.h b/muse2/muse/midiedit/pianoroll.h
index 1f53254d..2677d530 100644
--- a/muse2/muse/midiedit/pianoroll.h
+++ b/muse2/muse/midiedit/pianoroll.h
@@ -160,7 +160,7 @@ class PianoRoll : public MidiEditor {
       void updateTrackInfo();
 
    signals:
-      void deleted(unsigned long);
+      void deleted(TopWin*);
    
    public slots:
       virtual void updateHScrollRange();
diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp
index cc581965..99ce2844 100644
--- a/muse2/muse/midiedit/scoreedit.cpp
+++ b/muse2/muse/midiedit/scoreedit.cpp
@@ -636,7 +636,7 @@ void ScoreEdit::closeEvent(QCloseEvent* e)
 	//settings.setValue("ScoreEdit/geometry", saveGeometry());
 	settings.setValue("ScoreEdit/windowState", saveState());
 
-	emit deleted((unsigned long)this);
+	emit deleted(static_cast<TopWin*>(this));
 	e->accept();
 }
 
diff --git a/muse2/muse/midiedit/scoreedit.h b/muse2/muse/midiedit/scoreedit.h
index 6a5dd63a..65990df5 100644
--- a/muse2/muse/midiedit/scoreedit.h
+++ b/muse2/muse/midiedit/scoreedit.h
@@ -168,7 +168,7 @@ class ScoreEdit : public TopWin
 		void clipboard_changed();
 		
 	signals:
-		void deleted(unsigned long);
+		void deleted(TopWin*);
 		void name_changed();
 		void velo_changed(int);
 		void velo_off_changed(int);
diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp
index 72cacfaa..d6c06889 100644
--- a/muse2/muse/songfile.cpp
+++ b/muse2/muse/songfile.cpp
@@ -1011,15 +1011,15 @@ void MusE::readToplevels(Xml& xml)
                               if(!pl->empty())
                               {
                                 startPianoroll(pl);
-                                toplevels.back().cobject()->readStatus(xml);
+                                toplevels.back().object()->readStatus(xml);
                                 pl = new PartList;
                               }  
                               }
                         else if (tag == "scoreedit") {
                                 ScoreEdit* score = new ScoreEdit(this, 0, arranger->cursorValue());
                                 score->show();
-                                toplevels.push_back(Toplevel(Toplevel::SCORE, (unsigned long)(score), score));
-                                connect(score, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long)));
+                                toplevels.push_back(Toplevel(Toplevel::SCORE, score));
+                                connect(score, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
                                 connect(score, SIGNAL(name_changed()), SLOT(scoreNamingChanged()));
                                 score->readStatus(xml);
                               }
@@ -1027,7 +1027,7 @@ void MusE::readToplevels(Xml& xml)
                               if(!pl->empty())
                               {
                                 startDrumEditor(pl);
-                                toplevels.back().cobject()->readStatus(xml);
+                                toplevels.back().object()->readStatus(xml);
                                 pl = new PartList;
                               }  
                               }
@@ -1035,33 +1035,33 @@ void MusE::readToplevels(Xml& xml)
                               if(!pl->empty())
                               {
                                 startListEditor(pl);
-                                toplevels.back().cobject()->readStatus(xml);
+                                toplevels.back().object()->readStatus(xml);
                                 pl = new PartList;
                               }  
                               }
                         else if (tag == "master") {
                               startMasterEditor();
-                              toplevels.back().cobject()->readStatus(xml);
+                              toplevels.back().object()->readStatus(xml);
                               }
                         else if (tag == "lmaster") {
                               startLMasterEditor();
-                              toplevels.back().cobject()->readStatus(xml);
+                              toplevels.back().object()->readStatus(xml);
                               }
                         else if (tag == "marker") {
                               showMarker(true);
-                              toplevels.back().cobject()->readStatus(xml);
+                              toplevels.back().object()->readStatus(xml);
                               }
                         else if (tag == "waveedit") {
                               if(!pl->empty())
                               {
                                 startWaveEditor(pl);
-                                toplevels.back().cobject()->readStatus(xml);
+                                toplevels.back().object()->readStatus(xml);
                                 pl = new PartList;
                               }  
                               }
                         else if (tag == "cliplist") {
                               startClipList(true);
-                              toplevels.back().cobject()->readStatus(xml);
+                              toplevels.back().object()->readStatus(xml);
                               }
                         else
                               xml.unknown("MusE");
@@ -1531,8 +1531,8 @@ void MusE::write(Xml& xml) const
       if (!toplevels.empty()) {
             xml.tag(level++, "toplevels");
             for (ciToplevel i = toplevels.begin(); i != toplevels.end(); ++i) {
-                  if (i->cobject()->isVisible())
-                        i->cobject()->writeStatus(level, xml);
+                  if (i->object()->isVisible())
+                        i->object()->writeStatus(level, xml);
                   }
             xml.tag(level--, "/toplevels");
             }
diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp
index 7a5ad815..cf0d2fc9 100644
--- a/muse2/muse/waveedit/waveedit.cpp
+++ b/muse2/muse/waveedit/waveedit.cpp
@@ -53,7 +53,7 @@ void WaveEdit::closeEvent(QCloseEvent* e)
       QSettings settings("MusE", "MusE-qt");
       //settings.setValue("Waveedit/geometry", saveGeometry());
       settings.setValue("Waveedit/windowState", saveState());
-      emit deleted((unsigned long)this);
+      emit deleted(static_cast<TopWin*>(this));
       e->accept();
       }
 
diff --git a/muse2/muse/waveedit/waveedit.h b/muse2/muse/waveedit/waveedit.h
index 1ff8a65b..2bfffcc1 100644
--- a/muse2/muse/waveedit/waveedit.h
+++ b/muse2/muse/waveedit/waveedit.h
@@ -78,7 +78,7 @@ class WaveEdit : public MidiEditor {
 
 
    signals:
-      void deleted(unsigned long);
+      void deleted(TopWin*);
 
    public:
       WaveEdit(PartList*);
diff --git a/muse2/muse/widgets/midisyncimpl.cpp b/muse2/muse/widgets/midisyncimpl.cpp
index c70cb79f..07527973 100644
--- a/muse2/muse/widgets/midisyncimpl.cpp
+++ b/muse2/muse/widgets/midisyncimpl.cpp
@@ -673,8 +673,6 @@ void MidiSyncConfig::closeEvent(QCloseEvent* e)
           apply();
       }
       
-      //emit deleted((unsigned long)this);
-      
       disconnect(heartBeatTimer, SIGNAL(timeout()), this, SLOT(heartBeat()));
       disconnect(song, SIGNAL(songChanged(int)), this, SLOT(songChanged(int)));
       
diff --git a/muse2/muse/widgets/midisyncimpl.h b/muse2/muse/widgets/midisyncimpl.h
index 3eb33451..9b133af2 100644
--- a/muse2/muse/widgets/midisyncimpl.h
+++ b/muse2/muse/widgets/midisyncimpl.h
@@ -104,9 +104,6 @@ class MidiSyncConfig : public QDialog, public Ui::MidiSyncConfigBase {
       //void renameOk(QListViewItem*, int, const QString&);
       void songChanged(int);
 
-   //signals:
-   //   void deleted(unsigned long);
-
    public:
       MidiSyncConfig(QWidget* parent=0);
       //MidiSyncConfig();
-- 
cgit v1.2.3