Skip to content

Commit

Permalink
1.12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidXanatos committed Nov 26, 2023
1 parent affaba9 commit 6991284
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
24 changes: 14 additions & 10 deletions SandboxiePlus/SandMan/SbiePlusAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class QFileX : public QFile {
CArchive* m_pArchive;
};

void CSandBoxPlus::ExportBoxAsync(const CSbieProgressPtr& pProgress, const QString& ExportPath, const QString& RootPath, const QString& Section, const QString& Password, struct SCompressParams* Params)
void CSandBoxPlus::ExportBoxAsync(const CSbieProgressPtr& pProgress, const QString& ExportPath, const QString& RootPath, const QString& Section, const QVariantMap& vParams)
{
//CArchive Archive(ExportPath + ".tmp");
CArchive Archive(ExportPath);
Expand Down Expand Up @@ -229,11 +229,15 @@ void CSandBoxPlus::ExportBoxAsync(const CSbieProgressPtr& pProgress, const QStri
// this file is already present in the archive, this should not happen !!!
}

if (!Password.isEmpty())
Archive.SetPassword(Password);
if (vParams.contains("password"))
Archive.SetPassword(vParams["password"].toString());

SCompressParams Params;
Params.iLevel = vParams["level"].toInt();
Params.bSolid = vParams["solid"].toBool();

SB_STATUS Status = SB_OK;
if (!Archive.Update(&Files, true, Params)) // 0, 1 - 9
if (!Archive.Update(&Files, true, &Params))
Status = SB_ERR((ESbieMsgCodes)SBX_7zCreateFailed);

//if(!Status.IsError() && !pProgress->IsCanceled())
Expand All @@ -243,8 +247,6 @@ void CSandBoxPlus::ExportBoxAsync(const CSbieProgressPtr& pProgress, const QStri

File.remove();

delete Params;

pProgress->Finish(Status);
}

Expand All @@ -261,12 +263,14 @@ SB_PROGRESS CSandBoxPlus::ExportBox(const QString& FileName, const QString& Pass

QString Section = theAPI->SbieIniGetEx(m_Name, "");

SCompressParams* Params = new SCompressParams();
Params->iLevel = Level;
Params->bSolid = Solid;
QVariantMap vParams;
if (!Password.isEmpty())
vParams["password"] = Password;
vParams["level"] = Level;
vParams["solid"] = Solid;

CSbieProgressPtr pProgress = CSbieProgressPtr(new CSbieProgress());
QtConcurrent::run(CSandBoxPlus::ExportBoxAsync, pProgress, FileName, m_FilePath, Section, Password, Params);
QtConcurrent::run(CSandBoxPlus::ExportBoxAsync, pProgress, FileName, m_FilePath, Section, vParams);
return SB_PROGRESS(OP_ASYNC, pProgress);
}

Expand Down
4 changes: 2 additions & 2 deletions SandboxiePlus/SandMan/SbiePlusAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ protected slots:
void AddJobToQueue(CBoxJob* pJob);
void StartNextJob();

static void ExportBoxAsync(const CSbieProgressPtr& pProgress, const QString& ExportPath, const QString& RootPath, const QString& Section, const QString& Password = "", struct SCompressParams* Params = NULL);
static void ImportBoxAsync(const CSbieProgressPtr& pProgress, const QString& ImportPath, const QString& RootPath, const QString& BoxName, const QString& Password = "");
static void ExportBoxAsync(const CSbieProgressPtr& pProgress, const QString& ExportPath, const QString& RootPath, const QString& Section, const QVariantMap& Params);
static void ImportBoxAsync(const CSbieProgressPtr& pProgress, const QString& ImportPath, const QString& RootPath, const QString& BoxName, const QString& Password);

bool IsFileDeleted(const QString& RealPath, const QString& Snapshot, const QStringList& SnapshotList, const QMap<QString, QList<QString>>& DeletedPaths);

Expand Down
1 change: 1 addition & 0 deletions SandboxiePlus/SandMan/Views/SbieView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "../Windows/BoxImageWindow.h"
#include "../MiscHelpers/Archive/Archive.h"
#include "../Windows/SettingsWindow.h"
#include "../Windows/CompressDialog.h"

#include "qt_windows.h"
#include "qwindowdefs_win.h"
Expand Down

0 comments on commit 6991284

Please sign in to comment.