Store recovery file path in configManager
This commit is contained in:
@@ -139,6 +139,11 @@ public:
|
||||
return( m_ladDir );
|
||||
}
|
||||
|
||||
const QString & recoveryFile() const
|
||||
{
|
||||
return m_recoveryFile;
|
||||
}
|
||||
|
||||
#ifdef LMMS_HAVE_STK
|
||||
const QString & stkDir() const
|
||||
{
|
||||
@@ -200,6 +205,7 @@ private:
|
||||
QString m_vstDir;
|
||||
QString m_flDir;
|
||||
QString m_ladDir;
|
||||
QString m_recoveryFile;
|
||||
#ifdef LMMS_HAVE_STK
|
||||
QString m_stkDir;
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,8 @@ configManager::configManager() :
|
||||
m_pluginDir( qApp->applicationDirPath() + '/' + PLUGIN_DIR ),
|
||||
#endif
|
||||
m_vstDir( m_workingDir + "vst" + QDir::separator() ),
|
||||
m_flDir( QDir::home().absolutePath() )
|
||||
m_flDir( QDir::home().absolutePath() ),
|
||||
m_recoveryFile( QDir(m_workingDir).absoluteFilePath("recover.mmp") )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -422,7 +422,7 @@ int main( int argc, char * * argv )
|
||||
srand( getpid() + time( 0 ) );
|
||||
|
||||
// recover a file?
|
||||
QString recoveryFile = QDir(configManager::inst()->workingDir()).absoluteFilePath("recover.dataFile");
|
||||
QString recoveryFile = configManager::inst()->recoveryFile();
|
||||
if( QFileInfo(recoveryFile).exists() &&
|
||||
QMessageBox::question( engine::mainWindow(), MainWindow::tr( "Project recovery" ),
|
||||
MainWindow::tr( "It looks like the last session did not end properly. "
|
||||
|
||||
@@ -1000,8 +1000,7 @@ void MainWindow::closeEvent( QCloseEvent * _ce )
|
||||
if( mayChangeProject() )
|
||||
{
|
||||
// delete recovery file
|
||||
QDir working(configManager::inst()->workingDir());
|
||||
working.remove("recover.mmp");
|
||||
QFile::remove(configManager::inst()->recoveryFile());
|
||||
_ce->accept();
|
||||
}
|
||||
else
|
||||
@@ -1146,8 +1145,7 @@ void MainWindow::autoSave()
|
||||
if( !( engine::getSong()->isPlaying() ||
|
||||
engine::getSong()->isExporting() ) )
|
||||
{
|
||||
QDir work(configManager::inst()->workingDir());
|
||||
engine::getSong()->saveProjectFile(work.absoluteFilePath("recover.mmp"));
|
||||
engine::getSong()->saveProjectFile(configManager::inst()->recoveryFile());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user