Do not open file twice after we restore him.
--HG-- branch : develop
This commit is contained in:
parent
1d8a0054ac
commit
8407f714a5
|
@ -187,12 +187,12 @@ int main(int argc, char *argv[])
|
|||
parser.addVersionOption();
|
||||
parser.addPositionalArgument("filename", QCoreApplication::translate("main", "Pattern file."));
|
||||
parser.process(app);
|
||||
const QStringList args = parser.positionalArguments();
|
||||
QStringList args = parser.positionalArguments();
|
||||
|
||||
//Before we load pattern show window.
|
||||
w.show();
|
||||
|
||||
w.ReopenFilesAfterCrash();
|
||||
w.ReopenFilesAfterCrash(args);
|
||||
|
||||
for (int i=0;i<args.size();++i)
|
||||
{
|
||||
|
|
|
@ -2274,7 +2274,7 @@ void MainWindow::LoadPattern(const QString &fileName)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ReopenFilesAfterCrash()
|
||||
void MainWindow::ReopenFilesAfterCrash(QStringList &args)
|
||||
{
|
||||
QStringList files = qApp->getSettings()->value("restoreFileList").toStringList();
|
||||
if (files.size() > 0)
|
||||
|
@ -2308,6 +2308,7 @@ void MainWindow::ReopenFilesAfterCrash()
|
|||
QFile autoFile(restoreFiles.at(i) +".autosave");
|
||||
autoFile.remove();
|
||||
LoadPattern(restoreFiles.at(i));
|
||||
args.removeAll(restoreFiles.at(i));// Do not open file twice after we restore him.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
explicit MainWindow(QWidget *parent = nullptr);
|
||||
virtual ~MainWindow();
|
||||
void LoadPattern(const QString &curFile);
|
||||
void ReopenFilesAfterCrash();
|
||||
void ReopenFilesAfterCrash(QStringList &args);
|
||||
public slots:
|
||||
void mouseMove(const QPointF &scenePos);
|
||||
void ArrowTool();
|
||||
|
|
Loading…
Reference in New Issue
Block a user