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
|
@ -237,7 +237,10 @@ void CSandBoxPlus::UpdateSize()
|
|||
void CSandBoxPlus::SetSize(quint64 Size)
|
||||
{
|
||||
m_TotalSize = Size;
|
||||
theConf->SetValue("SizeCache/" + m_Name, 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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue