Fix SizeCache
Delete cleans up old data when the sandbox is renamed. I hope to delete or refuse to write Size by default when m_TotalSize is 0. This avoids extra cleanup work. Fix https://github.com/sandboxie-plus/Sandboxie/issues/2231
This commit is contained in:
parent
e254b95cb2
commit
04792c218f
|
@ -236,8 +236,11 @@ void CSandBoxPlus::UpdateSize()
|
|||
|
||||
void CSandBoxPlus::SetSize(quint64 Size)
|
||||
{
|
||||
m_TotalSize = Size;
|
||||
theConf->SetValue("SizeCache/" + m_Name, Size);
|
||||
m_TotalSize = Size;
|
||||
if (m_TotalSize == 0)
|
||||
theConf->DelValue("SizeCache/" + m_Name);
|
||||
else
|
||||
theConf->SetValue("SizeCache/" + m_Name, Size);
|
||||
}
|
||||
|
||||
bool CSandBoxPlus::IsSizePending() const
|
||||
|
|
|
@ -1208,6 +1208,7 @@ void CSbieView::OnSandBoxAction(QAction* Action, const QList<CSandBoxPtr>& SandB
|
|||
Results.append((SandBoxes.first()->RenameBox(Value)));
|
||||
|
||||
RenameItem(OldValue, Value);
|
||||
theConf->DelValue("SizeCache/" + OldValue);
|
||||
}
|
||||
else if (Action == m_pMenuRecover)
|
||||
{
|
||||
|
@ -1232,7 +1233,7 @@ void CSbieView::OnSandBoxAction(QAction* Action, const QList<CSandBoxPtr>& SandB
|
|||
if (I.value().removeOne(pBox->GetName()))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Action == m_pMenuCleanUp)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue