Fix : unable to save a new project.

The fix is weird, need more information about QFileInfo


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5813 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2019-03-29 20:51:24 +00:00
parent dcfa9dcf01
commit a912bfb380

View File

@@ -272,7 +272,9 @@ void QETProject::setFilePath(const QString &filepath)
m_file_path = filepath;
QFileInfo fi(m_file_path);
setReadOnly(!fi.isWritable());
if (fi.isWritable()) {
setReadOnly(false);
}
//title block variables should be updated after file save as dialog is confirmed, before file is saved.
m_project_properties.addValue("saveddate", QDate::currentDate().toString("yyyy-MM-dd"));
@@ -887,7 +889,6 @@ QETResult QETProject::write()
if (isReadOnly() && !QFileInfo(m_file_path).isWritable())
return(QString("the file %1 was opened read-only and thus will not be written").arg(m_file_path));
//Get the project in xml
QDomDocument xml_project;
xml_project.appendChild(xml_project.importNode(toXml().documentElement(), true));
@@ -900,9 +901,6 @@ QETResult QETProject::write()
m_project_properties.addValue("savedtime", QDateTime::currentDateTime().toString("HH:mm"));
m_project_properties.addValue("savedfilename", QFileInfo(filePath()).baseName());
m_project_properties.addValue("savedfilepath", filePath());
emit(projectInformationsChanged(this));
updateDiagramsFolioData();