From cfdc7bf0ac29e2c2d26e8dc43e8db4b45f9dc589 Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Mon, 29 May 2023 14:11:34 +0200 Subject: [PATCH] 1.9.6 --- CHANGELOG.md | 1 + SandboxiePlus/SandMan/SandMan.cpp | 3 -- SandboxiePlus/SandMan/Views/SbieView.cpp | 61 +++++++++++------------- SandboxiePlus/SandMan/Views/SbieView.h | 3 +- 4 files changed, 31 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a13f499..49612682 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - additional feedback for other drag and drop scenarios can be provided in [#856](https://github.com/sandboxie-plus/Sandboxie/issues/856) - fixed Regression: DLL loading problem (Entry Point Not Found) [#2980](https://github.com/sandboxie-plus/Sandboxie/issues/2980) - fixed [1.9.4/5] Sandboxie does not mark deleted files or registry keys while virtualization scheme v2 is active [#2984](https://github.com/sandboxie-plus/Sandboxie/issues/2984) +- fixed SandMan: Timestamp of the Sandboxie.ini [#2985](https://github.com/sandboxie-plus/Sandboxie/issues/2985) ## [1.9.5 / 5.64.5] - 2023-05-26 diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index 4fa34cf1..9ebe4e2b 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -1075,9 +1075,6 @@ void CSandMan::closeEvent(QCloseEvent *e) emit Closed(); - //if(theAPI->IsConnected()) - // m_pBoxView->SaveUserConfig(); - if (IsFullyPortable() && theAPI->IsConnected()) { int PortableStop = theConf->GetInt("Options/PortableStop", -1); diff --git a/SandboxiePlus/SandMan/Views/SbieView.cpp b/SandboxiePlus/SandMan/Views/SbieView.cpp index 69fa7d61..4c2b91bb 100644 --- a/SandboxiePlus/SandMan/Views/SbieView.cpp +++ b/SandboxiePlus/SandMan/Views/SbieView.cpp @@ -25,7 +25,6 @@ CSbieView::CSbieView(QWidget* parent) : CPanelView(parent) m_pMainLayout->setContentsMargins(0,0,0,0); this->setLayout(m_pMainLayout); - m_UserConfigChanged = false; m_HoldExpand = false; m_pSbieModel = new CSbieModel(this); @@ -495,16 +494,19 @@ void CSbieView::Refresh() } if (!Added.isEmpty()) { + bool bChanged = false; foreach(const QVariant& ID, Added) { if (ID.type() == QVariant::String) { QString id = ID.toString(); - if (id.left(1) != "!") + if (id.left(1) != "!") { + bChanged = true; m_Groups[""].append(id); + } } } - m_UserConfigChanged = true; - SaveUserConfig(); + if(bChanged) + SaveBoxGrouping(); } } @@ -940,10 +942,9 @@ void CSbieView::OnGroupAction(QAction* Action) Refresh(); } - m_UserConfigChanged = true; UpdateMoveMenu(); - SaveUserConfig(); + SaveBoxGrouping(); } void CSbieView::SetCustomOrder() @@ -1060,11 +1061,9 @@ QString CSbieView::AddNewGroup() m_Groups[Parent].append(Name); - - m_UserConfigChanged = true; UpdateMoveMenu(); - SaveUserConfig(); + SaveBoxGrouping(); return Name; } @@ -1356,11 +1355,13 @@ void CSbieView::OnSandBoxAction(QAction* Action, const QList& SandB if (QMessageBox("Sandboxie-Plus", tr("Do you really want to remove the selected sandbox(es)?

Warning: The box content will also be deleted!"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton, this).exec() != QMessageBox::Yes) return; + bool bChanged = false; foreach(const CSandBoxPtr& pBox, SandBoxes) { SB_STATUS Status = theGUI->DeleteBoxContent(pBox, CSandMan::eForDelete); if (Status.GetMsgCode() == SB_Canceled) break; + QString Name = pBox->GetName(); if (!Status.IsError()) Status = pBox->RemoveBox(); @@ -1371,11 +1372,16 @@ void CSbieView::OnSandBoxAction(QAction* Action, const QList& SandB m_Collapsed.remove(Name); for (auto I = m_Groups.begin(); I != m_Groups.end(); ++I) { - if (I.value().removeOne(Name)) + if (I.value().removeOne(Name)) { + bChanged = true; break; + } } } } + + if(bChanged) + SaveBoxGrouping(); } else if (Action == m_pMenuCleanUp) { @@ -1469,9 +1475,6 @@ void CSbieView::OnSandBoxAction(QAction* Action, const QList& SandB } CSandMan::CheckResults(Results); - - m_UserConfigChanged = true; - SaveUserConfig(); } bool CSbieView::CreateShortcut(const QString& LinkPath, const QString& BoxName, const QString &IconPath, int IconIndex, const QString &WorkDir) @@ -1964,9 +1967,12 @@ void CSbieView::ChangeExpand(const QModelIndex& index, bool bExpand) else m_Collapsed.insert(Name); - m_UserConfigChanged = true; + //QMap Collapsed; + //Collapsed.insert("", SetToList(m_Collapsed)); + //theAPI->GetUserSettings()->SetTextMap("CollapsedBoxes", Collapsed); - SaveUserConfig(); + QString Collapsed = SetToList(m_Collapsed).join(","); + theConf->SetValue("UIConfig/BoxCollapsedView", Collapsed); } void CSbieView::ReloadUserConfig() @@ -1984,14 +1990,14 @@ void CSbieView::ReloadUserConfig() UpdateMoveMenu(); - QMap Collapsed = theAPI->GetUserSettings()->GetTextMap("CollapsedBoxes"); - m_Collapsed = ListToSet(Collapsed[""]); - if (m_Collapsed.isEmpty()) { // try legacy entries + //QMap Collapsed = theAPI->GetUserSettings()->GetTextMap("CollapsedBoxes"); + //m_Collapsed = ListToSet(Collapsed[""]); + //if (m_Collapsed.isEmpty()) { // try legacy entries QString Collapsed = theConf->GetString("UIConfig/BoxCollapsedView"); - if (Collapsed.isEmpty()) - Collapsed = theAPI->GetUserSettings()->GetText("BoxCollapsedView"); + //if (Collapsed.isEmpty()) + // Collapsed = theAPI->GetUserSettings()->GetText("BoxCollapsedView"); m_Collapsed = ListToSet(SplitStr(Collapsed, ",")); - } + //} ClearUserUIConfig(); } @@ -2022,12 +2028,8 @@ void CSbieView::ClearUserUIConfig(const QMap AllBoxes) m_Collapsed = Temp; } -void CSbieView::SaveUserConfig() +void CSbieView::SaveBoxGrouping() { - if (!m_UserConfigChanged) - return; - m_UserConfigChanged = false; - if (!theAPI->IsConnected()) return; @@ -2043,10 +2045,6 @@ void CSbieView::SaveUserConfig() } theAPI->GetUserSettings()->SetTextMap("BoxGrouping", Groups); - QMap Collapsed; - Collapsed.insert("", SetToList(m_Collapsed)); - theAPI->GetUserSettings()->SetTextMap("CollapsedBoxes", Collapsed); - theAPI->GetUserSettings()->SetRefreshOnChange(true); theAPI->CommitIniChanges(); } @@ -2066,10 +2064,9 @@ void CSbieView::OnMoveItem(const QString& Name, const QString& To, int row) Refresh(); } - m_UserConfigChanged = true; UpdateMoveMenu(); - SaveUserConfig(); + SaveBoxGrouping(); } void CSbieView::OnRemoveItem() diff --git a/SandboxiePlus/SandMan/Views/SbieView.h b/SandboxiePlus/SandMan/Views/SbieView.h index 15998f5e..93866f7d 100644 --- a/SandboxiePlus/SandMan/Views/SbieView.h +++ b/SandboxiePlus/SandMan/Views/SbieView.h @@ -73,7 +73,7 @@ public slots: void Refresh(); void ReloadUserConfig(); void ClearUserUIConfig(const QMap AllBoxes = QMap()); - void SaveUserConfig(); + void SaveBoxGrouping(); private slots: void OnToolTipCallback(const QVariant& ID, QString& ToolTip); @@ -112,7 +112,6 @@ protected: QMap m_Groups; QSet m_Collapsed; - bool m_UserConfigChanged; bool m_HoldExpand; private: