mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-25 00:14:15 +02:00
Merge master into feat/project-lock
Conflicts: the lock dialog and the recovery dialog both kept in qetdiagrameditor.cpp; the lock and previous-versions settings both kept. The spacer in the General settings page moves to row 9, below the lock checkbox, which the merge had left on the same row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgPFANhWgD66V3v9KVKV58
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
#include "qetinformation.h"
|
||||
#include "qetversion.h"
|
||||
#include "undocommand/adddiagramcommand.h"
|
||||
#include "utils/previousversions.h"
|
||||
|
||||
#include <QCryptographicHash>
|
||||
#include <QElapsedTimer>
|
||||
@@ -514,6 +515,7 @@ QETProject::ProjectState QETProject::openFile(QFile *file)
|
||||
if (!read)
|
||||
{
|
||||
qWarning().noquote() << "Unable to read" << fi.fileName() << ":" << read_error;
|
||||
m_open_error = read_error;
|
||||
m_container_pictures.clear();
|
||||
m_folio_parts.clear();
|
||||
if(opened_here) {
|
||||
@@ -602,6 +604,16 @@ QETProject::ProjectState QETProject::state() const
|
||||
return(m_state);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief QETProject::openError
|
||||
@return why the file could not be read, when state() is
|
||||
XmlParsingFailed: "picture ... is missing", say; empty otherwise
|
||||
*/
|
||||
QString QETProject::openError() const
|
||||
{
|
||||
return m_open_error;
|
||||
}
|
||||
|
||||
/**
|
||||
@return la liste des schemas de ce projet
|
||||
*/
|
||||
@@ -2763,6 +2775,13 @@ QETResult QETProject::write()
|
||||
return(QString("the file %1 was opened read-only and thus will not be written").arg(m_file_path));
|
||||
}
|
||||
|
||||
//The file as it was goes among its previous versions first
|
||||
//(Settings > General > Projects); a copy that fails does not stop
|
||||
//the save
|
||||
QString backup_error;
|
||||
if (!PreviousVersions::keep(m_file_path, PreviousVersions::count(), &backup_error))
|
||||
qWarning().noquote() << "Previous version of" << m_file_path << "not kept:" << backup_error;
|
||||
|
||||
QString error_message;
|
||||
if (isContainerPath(m_file_path))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user