mirror of
https://github.com/leozide/leocad.git
synced 2026-07-28 04:07:11 +00:00
Fixed selection marking files modified.
This commit is contained in:
@@ -2010,6 +2010,30 @@ void lcModel::RevertActionSequence()
|
|||||||
mActionSequence.clear();
|
mActionSequence.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool lcModel::IsModified() const
|
||||||
|
{
|
||||||
|
const lcModelHistoryEntry* FirstModifyAction = GetFirstUndoChange();
|
||||||
|
|
||||||
|
if (!FirstModifyAction)
|
||||||
|
return mSavedHistory != nullptr;
|
||||||
|
else
|
||||||
|
return mSavedHistory != FirstModifyAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
void lcModel::SetSaved()
|
||||||
|
{
|
||||||
|
mSavedHistory = GetFirstUndoChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
const lcModelHistoryEntry* lcModel::GetFirstUndoChange() const
|
||||||
|
{
|
||||||
|
for (const std::unique_ptr<lcModelHistoryEntry>& UndoEntry : mUndoHistory)
|
||||||
|
if (UndoEntry->ModelActions.size() != 1 || !dynamic_cast<lcModelActionSelection*>(UndoEntry->ModelActions.front().get()))
|
||||||
|
return UndoEntry.get();
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void lcModel::SaveCheckpoint(const QString& )
|
void lcModel::SaveCheckpoint(const QString& )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|||||||
+7
-16
@@ -131,19 +131,14 @@ public:
|
|||||||
return mProject;
|
return mProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsModified() const
|
|
||||||
{
|
|
||||||
if (mUndoHistory.empty())
|
|
||||||
return mSavedHistory != nullptr;
|
|
||||||
else
|
|
||||||
return mSavedHistory != mUndoHistory.front().get();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsActive() const
|
bool IsActive() const
|
||||||
{
|
{
|
||||||
return mActive;
|
return mActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsModified() const;
|
||||||
|
void SetSaved();
|
||||||
|
|
||||||
bool GetPieceWorldMatrix(lcPiece* Piece, lcMatrix44& ParentWorldMatrix) const;
|
bool GetPieceWorldMatrix(lcPiece* Piece, lcMatrix44& ParentWorldMatrix) const;
|
||||||
bool IncludesModel(const lcModel* Model) const;
|
bool IncludesModel(const lcModel* Model) const;
|
||||||
void CreatePieceInfo(Project* Project);
|
void CreatePieceInfo(Project* Project);
|
||||||
@@ -271,12 +266,7 @@ public:
|
|||||||
bool LoadInventory(const QByteArray& Inventory);
|
bool LoadInventory(const QByteArray& Inventory);
|
||||||
int SplitMPD(QIODevice& Device);
|
int SplitMPD(QIODevice& Device);
|
||||||
void Merge(std::unique_ptr<lcModel> Other);
|
void Merge(std::unique_ptr<lcModel> Other);
|
||||||
|
|
||||||
void SetSaved()
|
|
||||||
{
|
|
||||||
mSavedHistory = mUndoHistory.empty() ? nullptr : mUndoHistory.front().get();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetMinifig(const lcMinifig& Minifig);
|
void SetMinifig(const lcMinifig& Minifig);
|
||||||
void SetPreviewPieceInfo(PieceInfo* Info, int ColorIndex);
|
void SetPreviewPieceInfo(PieceInfo* Info, int ColorIndex);
|
||||||
|
|
||||||
@@ -422,6 +412,7 @@ protected:
|
|||||||
void EndActionSequence(const QString& Description);
|
void EndActionSequence(const QString& Description);
|
||||||
void DiscardActionSequence();
|
void DiscardActionSequence();
|
||||||
void RevertActionSequence();
|
void RevertActionSequence();
|
||||||
|
const lcModelHistoryEntry* GetFirstUndoChange() const;
|
||||||
|
|
||||||
void SaveCheckpoint(const QString& Description);
|
void SaveCheckpoint(const QString& Description);
|
||||||
void LoadCheckPoint(lcModelHistoryEntry* CheckPoint, bool Apply);
|
void LoadCheckPoint(lcModelHistoryEntry* CheckPoint, bool Apply);
|
||||||
@@ -457,7 +448,7 @@ protected:
|
|||||||
QStringList mFileLines;
|
QStringList mFileLines;
|
||||||
|
|
||||||
std::vector<std::unique_ptr<lcModelAction>> mActionSequence;
|
std::vector<std::unique_ptr<lcModelAction>> mActionSequence;
|
||||||
lcModelHistoryEntry* mSavedHistory;
|
const lcModelHistoryEntry* mSavedHistory = nullptr;
|
||||||
std::vector<std::unique_ptr<lcModelHistoryEntry>> mUndoHistory;
|
std::vector<std::unique_ptr<lcModelHistoryEntry>> mUndoHistory;
|
||||||
std::vector<std::unique_ptr<lcModelHistoryEntry>> mRedoHistory;
|
std::vector<std::unique_ptr<lcModelHistoryEntry>> mRedoHistory;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user