Commit d60edce3 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

ProjectManager: Assume a project file will be loaded for most actions.

parent 5cecf1d2
......@@ -108,12 +108,8 @@ ProjectManager::saveProject( const QString& fileName )
void
ProjectManager::emergencyBackup()
{
QString name;
if ( m_projectFile != NULL )
name = m_projectFile->fileName() + ProjectManager::backupSuffix;
else
name = QDir::currentPath() + "/unsavedproject" + ProjectManager::backupSuffix;
Q_ASSERT( m_projectFile != NULL );
const QString& name = m_projectFile->fileName() + ProjectManager::backupSuffix;
saveProject( name );
Core::getInstance()->settings()->setValue( "private/EmergencyBackup", name );
}
......@@ -328,8 +324,7 @@ ProjectManager::autoSaveRequired()
bool
ProjectManager::closeProject()
{
if ( m_projectFile == NULL )
return true;
Q_ASSERT( m_projectFile != NULL );
if ( m_projectManagerUi != NULL )
{
IProjectManagerUiCb::SaveMode mode = m_projectManagerUi->shouldSaveBeforeClose();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment