save new file bugfix

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

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

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

Loading…
Cancel
Save