Move some window title updates from Song into MainWindow
Move the window title updates which are triggered due to a changed modify state from Song to MainWindow. Implementation details: Add a new signal modified to Song and connect the new slot method MainWindow::onSongModified to it. Currently only the window title is updated in the slot. It is only updated if the code is executed from the GUI main thread. This implementation was taken over from the original implementation of Song::setModified. The assumption here seems to be that the Song might also be set as modified from other threads (which is a bad design). Add a new private method Song::setModified(bool) and replace all direct manipulations of m_modified in Song by calls to this method. This is done to ensure that the signal can be emitted in all these cases. Make Song::setModified() delegates to Song::setModified(bool) for the same reason. Other changes: Slightly refactor MainWindow::resetWindowTitle to get rid of an unnecessary if statement.
This commit is contained in:
@@ -253,6 +253,7 @@ private slots:
|
||||
void onExportProjectTracks();
|
||||
void onImportProject();
|
||||
void onSongStopped();
|
||||
void onSongModified();
|
||||
|
||||
signals:
|
||||
void periodicUpdate();
|
||||
|
||||
@@ -370,6 +370,8 @@ private:
|
||||
|
||||
void processAutomations(const TrackList& tracks, MidiTime timeStart, fpp_t frames);
|
||||
|
||||
void setModified(bool value);
|
||||
|
||||
AutomationTrack * m_globalAutomationTrack;
|
||||
|
||||
IntModel m_tempoModel;
|
||||
@@ -429,6 +431,7 @@ signals:
|
||||
void controllerRemoved( Controller * );
|
||||
void updateSampleTracks();
|
||||
void stopped();
|
||||
void modified();
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user