Remove Song's dependency to MainWindow
Finally remove Song's dependency to MainWindow by moving the window title update which is triggered due to a changed project file name from the class Song into MainWindow. Implementation details: Add a new signal projectFileNameChanged to Song and connect the new slot method MainWindow::onProjectFileNameChanged to it. Update the window title whenever the slot is triggered. Add a new private method Song::setProjectFileName which sets the project file name and emits the signal (only if the file name really changes). Call setProjectFileName everywhere where m_fileName was manipulated directly. This is done to ensure that the signal can be potentially emitted in all relevant situations. Remove the calls to gui->mainWindow from Song::createNewProjectFromTemplate. These changes finally remove the include to "MainWindow.h". The include for "ConfigManager.h" was previously done implicitly through the include of "MainWindow.h" and therefore had to be added explicitly after the latter is removed.
This commit is contained in:
@@ -254,6 +254,7 @@ private slots:
|
||||
void onImportProject();
|
||||
void onSongStopped();
|
||||
void onSongModified();
|
||||
void onProjectFileNameChanged();
|
||||
|
||||
signals:
|
||||
void periodicUpdate();
|
||||
|
||||
@@ -372,6 +372,8 @@ private:
|
||||
|
||||
void setModified(bool value);
|
||||
|
||||
void setProjectFileName(QString const & projectFileName);
|
||||
|
||||
AutomationTrack * m_globalAutomationTrack;
|
||||
|
||||
IntModel m_tempoModel;
|
||||
@@ -432,6 +434,7 @@ signals:
|
||||
void updateSampleTracks();
|
||||
void stopped();
|
||||
void modified();
|
||||
void projectFileNameChanged();
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user