[qet] qet/qet: [5813] Fix : unable to save a new project. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 5813
Author: blacksun
Date: 2019-03-29 21:51:24 +0100 (Fri, 29 Mar 2019)
Log Message:
-----------
Fix : unable to save a new project.
The fix is weird, need more information about QFileInfo
Modified Paths:
--------------
trunk/sources/qetproject.cpp
Modified: trunk/sources/qetproject.cpp
===================================================================
--- trunk/sources/qetproject.cpp 2019-03-28 22:02:24 UTC (rev 5812)
+++ trunk/sources/qetproject.cpp 2019-03-29 20:51:24 UTC (rev 5813)
@@ -272,7 +272,9 @@
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 @@
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 @@
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();