save new file bugfix

master
Denes Matetelki 14 years ago
parent 6f4af90e13
commit 88aed416e6

@ -31,7 +31,7 @@ public slots:
// filemenu actions // filemenu actions
void newFile(); void newFile();
void openFile(const QString &fileName = ""); void openFile(const QString &fileName = "");
void saveFile(); void saveFile(const bool &checkIfReadonly = true);
bool saveFileAs(); bool saveFileAs();
bool closeFile(); bool closeFile();
void exportScene(); void exportScene();

@ -136,10 +136,10 @@ void MainWindow::openFile(const QString &fileName)
showMainToolbar(); showMainToolbar();
} }
void MainWindow::saveFile() void MainWindow::saveFile(const bool &checkIfReadonly)
{ {
QFileInfo fileInfo(m_fileName); QFileInfo fileInfo(m_fileName);
if (!fileInfo.isWritable()) if (checkIfReadonly && !fileInfo.isWritable())
{ {
statusBarMsg(tr("Read-only file!")); statusBarMsg(tr("Read-only file!"));
return; return;
@ -162,8 +162,8 @@ bool MainWindow::saveFileAs()
return false; return false;
m_fileName = dialog.selectedFiles().first(); m_fileName = dialog.selectedFiles().first();
saveFile(false);
setTitle(m_fileName); setTitle(m_fileName);
saveFile();
return true; return true;
} }

Loading…
Cancel
Save