This commit is contained in:
DavidXanatos 2022-09-17 22:16:58 +02:00
parent f0f3001ee7
commit 7fa6e2e035
3 changed files with 17 additions and 23 deletions

View File

@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- fixed issue with default box not being detected on start [#2195](https://github.com/sandboxie-plus/Sandboxie/issues/2195)
- fixed move sandbox menu issue [2225](https://github.com/sandboxie-plus/Sandboxie/issues/2225) (thanks okrc)
- fixed issues with stale data in sandboxie ini [#2234](https://github.com/sandboxie-plus/Sandboxie/pull/2234) (thanks okrc)
### Changed
- NoRenameWinClass now supports WildCards

View File

@ -25,20 +25,8 @@
#include "gui_p.h"
#include "core/svc/GuiWire.h"
#include <stdio.h>
//---------------------------------------------------------------------------
// Structures and Types
//---------------------------------------------------------------------------
typedef struct _GUI_NO_RENAME_WIN_CLASS {
struct _GUI_NO_RENAME_WIN_CLASS *next;
ULONG name_len;
WCHAR name[1];
} GUI_NO_RENAME_WIN_CLASS;
//#include "common\pattern.h"
BOOLEAN Pattern_Match(PATTERN* pat, const WCHAR* string, int string_len);
//---------------------------------------------------------------------------

View File

@ -712,6 +712,10 @@ void CSbieView::RenameGroup(const QString OldName, const QString NewName)
void CSbieView::RenameItem(const QString OldName, const QString NewName)
{
quint64 Size = theConf->GetValue("SizeCache/" + OldName, -1).toLongLong();
theConf->DelValue("SizeCache/" + OldName);
if(Size != -1) theConf->SetValue("SizeCache/" + NewName, Size);
for (auto I = m_Groups.begin(); I != m_Groups.end(); ++I)
{
if (I.value().removeOne(OldName))
@ -1204,8 +1208,8 @@ void CSbieView::OnSandBoxAction(QAction* Action, const QList<CSandBoxPtr>& SandB
}
else if (Action == m_pMenuRename)
{
QString OldValue = SandBoxes.first()->GetName();
QString Value = QInputDialog::getText(this, "Sandboxie-Plus", tr("Please enter a new name for the Sandbox."), QLineEdit::Normal, OldValue).replace(" ", "_");
QString OldValue = SandBoxes.first()->GetName().replace("_", " ");
QString Value = QInputDialog::getText(this, "Sandboxie-Plus", tr("Please enter a new name for the Sandbox."), QLineEdit::Normal, OldValue);
if (Value.isEmpty() || Value == OldValue)
return;
if (!TestNameAndWarn(Value))
@ -1213,9 +1217,7 @@ void CSbieView::OnSandBoxAction(QAction* Action, const QList<CSandBoxPtr>& SandB
SB_STATUS Status = SandBoxes.first()->RenameBox(Value);
if (!Status.IsError())
{
RenameItem(OldValue, Value);
}
RenameItem(OldValue.replace(" ", "_"), Value.replace(" ", "_"));
Results.append(Status);
}
else if (Action == m_pMenuRecover)
@ -1237,10 +1239,13 @@ void CSbieView::OnSandBoxAction(QAction* Action, const QList<CSandBoxPtr>& SandB
Status = pBox->RemoveBox();
Results.append(Status);
for (auto I = m_Groups.begin(); I != m_Groups.end(); ++I)
{
if (I.value().removeOne(Name))
break;
if (!Status.IsError()) {
theConf->DelValue("SizeCache/" + Name);
for (auto I = m_Groups.begin(); I != m_Groups.end(); ++I)
{
if (I.value().removeOne(Name))
break;
}
}
}
}