mirror of
https://github.com/leozide/leocad.git
synced 2026-10-26 22:10:32 +00:00
Remove obsolete library cleanup and capability APIs
UnloadUnusedParts selects identities with zero references and calls the release path, which immediately returns without changing them. Remove the no-op scan and its model, project and preview callers, including the now-unused LoadLDD library local. Actual last-reference unload and temporary identity cleanup remain in their existing lifetime paths. SupportsStudStyle always returns true. Remove the method and the unreachable preferences branch that disables the stud-style selector. Validation: warning-free macOS Qt 6.10 Debug build, all 45 offscreen lifecycle checks and diff whitespace checks pass. No remaining references to either API.
This commit is contained in:
1 parent
664cec006f
commit
137c645ce6
6 files changed
-30
No files matched your search
@@ -2080,15 +2080,6 @@ lcMesh* lcPiecesLibrary::GetLoadingMesh() const
|
||||
return mLoadingMesh.get();
|
||||
}
|
||||
|
||||
void lcPiecesLibrary::UnloadUnusedParts()
|
||||
{
|
||||
for (lcPieceData* PieceData : mPieceManager->GetLibraryPieceData())
|
||||
{
|
||||
if (PieceData->GetRefCount() == 0 && PieceData->mState != lcAssetState::Unloaded)
|
||||
ReleasePieceData(PieceData);
|
||||
}
|
||||
}
|
||||
|
||||
void lcPiecesLibrary::AddTextureReference(lcTexture* Texture)
|
||||
{
|
||||
mTextureManager->AddTextureReference(Texture);
|
||||
@@ -2099,11 +2090,6 @@ void lcPiecesLibrary::ReleaseTexture(lcTexture* Texture)
|
||||
mTextureManager->ReleaseTexture(Texture);
|
||||
}
|
||||
|
||||
bool lcPiecesLibrary::SupportsStudStyle() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void lcPiecesLibrary::UpdateStudStyleAndColors(lcStudStyle StudStyle, bool StudCylinderColorEnabled)
|
||||
{
|
||||
Q_ASSERT(QThread::currentThread() == thread());
|
||||
|
||||
@@ -160,8 +160,6 @@ public:
|
||||
// Reloads the configured colors and updates the loading mesh.
|
||||
void LoadColors();
|
||||
|
||||
bool SupportsStudStyle() const;
|
||||
|
||||
lcStudStyle GetStudStyle() const
|
||||
{
|
||||
return mStudStyle;
|
||||
@@ -304,9 +302,6 @@ public:
|
||||
return { mVertexBuffer, mIndexBuffer };
|
||||
}
|
||||
|
||||
// Checks unused library parts under the existing zero-reference release policy.
|
||||
void UnloadUnusedParts();
|
||||
|
||||
// Returns the borrowed placeholder mesh for pending or failed piece geometry.
|
||||
lcMesh* GetLoadingMesh() const;
|
||||
|
||||
|
||||
@@ -2595,7 +2595,6 @@ void lcMainWindow::NewProject()
|
||||
|
||||
Project* NewProject = new Project();
|
||||
gApplication->SetProject(NewProject);
|
||||
lcGetPiecesLibrary()->UnloadUnusedParts();
|
||||
}
|
||||
|
||||
bool lcMainWindow::OpenProject(const QString& FileName)
|
||||
|
||||
@@ -1052,7 +1052,6 @@ void lcModel::LoadLDraw(QIODevice& Device, Project* Project)
|
||||
|
||||
mCurrentStep = CurrentStep;
|
||||
CalculateStep(mCurrentStep);
|
||||
Library->UnloadUnusedParts();
|
||||
|
||||
delete Piece;
|
||||
delete Camera;
|
||||
@@ -1299,7 +1298,6 @@ bool lcModel::LoadBinary(lcFile* file)
|
||||
}
|
||||
|
||||
CalculateStep(mCurrentStep);
|
||||
lcGetPiecesLibrary()->UnloadUnusedParts();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1322,9 +1320,7 @@ bool lcModel::LoadLDD(const QString& FileData)
|
||||
Piece->SetGroup(NewGroup);
|
||||
}
|
||||
|
||||
lcPiecesLibrary* Library = lcGetPiecesLibrary();
|
||||
CalculateStep(mCurrentStep);
|
||||
Library->UnloadUnusedParts();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1361,8 +1357,6 @@ bool lcModel::LoadInventory(const std::vector<lcSetInventoryItem>& SetInventory)
|
||||
if (!Library->WaitForPieceData(RequiredPieceData))
|
||||
return false;
|
||||
|
||||
Library->UnloadUnusedParts();
|
||||
|
||||
auto RoundBounds = [](float& Value)
|
||||
{
|
||||
Value = ((Value < 0.0f) ? floor((Value - 5.0f) / 10.0f) : ceil((Value + 5.0f) / 10.0f)) * 10.0f;
|
||||
|
||||
@@ -336,7 +336,6 @@ void lcPreview::ClearPreview()
|
||||
lcPiecesLibrary* Library = lcGetPiecesLibrary();
|
||||
|
||||
Library->RemoveTemporaryPieceData();
|
||||
Library->UnloadUnusedParts();
|
||||
Redraw();
|
||||
}
|
||||
|
||||
|
||||
@@ -236,9 +236,6 @@ lcPreferencesDialog::lcPreferencesDialog(QWidget* Parent, lcPreferencesDialogOpt
|
||||
else
|
||||
ui->PreviewViewSphereSizeCombo->setCurrentIndex(0);
|
||||
|
||||
if (!lcGetPiecesLibrary()->SupportsStudStyle())
|
||||
ui->studStyleCombo->setEnabled(false);
|
||||
|
||||
ui->studStyleCombo->setCurrentIndex(static_cast<int>(mOptions->StudStyle));
|
||||
|
||||
ui->ShadingMode->setCurrentIndex(static_cast<int>(mOptions->Preferences.mShadingMode));
|
||||
|
||||
Reference in new issue
Block a user