[qet] qet/qet: [5468] '%saveddate' and '%savedtime' title block variables should be updated

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 5468
Author:   scorpio810
Date:     2018-08-06 18:12:00 +0200 (Mon, 06 Aug 2018)
Log Message:
-----------
'%saveddate' and '%savedtime' title block variables should be updated
after file save or save as dialog is confirmed, before file is saved.

Modified Paths:
--------------
    trunk/sources/qetproject.cpp

Modified: trunk/sources/qetproject.cpp
===================================================================
--- trunk/sources/qetproject.cpp	2018-08-06 15:32:19 UTC (rev 5467)
+++ trunk/sources/qetproject.cpp	2018-08-06 16:12:00 UTC (rev 5468)
@@ -254,11 +254,12 @@
 	if (file_path_info.isWritable()) {
 		setReadOnly(false);
 	}
-	
+	//'%saveddate' and '%savedtime' title block variables should be updated after file save as dialog is confirmed, before file is saved.
 	project_properties_.addValue("saveddate", QDate::currentDate().toString("yyyy-MM-dd"));
 	project_properties_.addValue("savedtime", QDateTime::currentDateTime().toString("HH:mm"));
 	
 	
+	
 	emit(projectFilePathChanged(this, m_file_path));
 	emit(projectInformationsChanged(this));
 	updateDiagramsFolioData();
@@ -871,7 +872,16 @@
 
 	QString error_message;
 	if (!QET::writeXmlFile(xml_project, m_file_path, &error_message)) return(error_message);
-
+	
+	//'%saveddate' and '%savedtime' title block variables should be updated after file save dialog is confirmed, before file is saved.
+	project_properties_.addValue("saveddate", QDate::currentDate().toString("yyyy-MM-dd"));
+	project_properties_.addValue("savedtime", QDateTime::currentDateTime().toString("HH:mm"));
+	
+	
+ 	
+ 	emit(projectInformationsChanged(this));
+ 	updateDiagramsFolioData();
+ 	
 	setModified(false);
 	return(QETResult());
 }
@@ -1735,7 +1745,7 @@
 	DiagramContext project_wide_properties = project_properties_;
 	project_wide_properties.addValue("projecttitle", title());
 	project_wide_properties.addValue("projectpath", filePath());
-	project_wide_properties.addValue("projectfilename", QFileInfo( filePath()).baseName());
+	project_wide_properties.addValue("projectfilename", QFileInfo(filePath()).baseName());
 	
 	for (int i = 0 ; i < total_folio ; ++ i) {
 		QString title = m_diagrams_list[i] -> title();


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/