Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
horsicq committed Jan 3, 2020
1 parent 5460c5c commit 514add8
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Formats
Submodule Formats updated 2 files
+5 −0 xbinary.cpp
+1 −0 xbinary.h
2 changes: 1 addition & 1 deletion global.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define X_ORGANIZATIONNAME "NTInfo"
#define X_ORGANIZATIONDOMAIN "ntinfo.biz"
#define X_HOMEPAGE "https://github.com/horsicq/x64dbg-Plugin-Manager"
#define X_SEVERVERSION "https://raw.githubusercontent.com/horsicq/x64dbg-Plugin-Manager/master/release_version.txt"
#define X_SERVERVERSION "https://raw.githubusercontent.com/horsicq/x64dbg-Plugin-Manager/master/release_version.txt"

#define X_JSON_DEFAULT "https://raw.githubusercontent.com/x64dbg/PluginManager/master/list.json"

Expand Down
2 changes: 1 addition & 1 deletion gui_source/dialoginstallmodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class DialogInstallModule : public QDialog
Q_OBJECT

public:
explicit DialogInstallModule(QWidget *parent, XPLUGINMANAGER::OPTIONS *pOptions, QString sModuleFileName);
explicit DialogInstallModule(QWidget *parent, XPLUGINMANAGER::OPTIONS *pOptions,QString sModuleFileName);
~DialogInstallModule();

private slots:
Expand Down
2 changes: 1 addition & 1 deletion gui_source/guimainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ void GuiMainWindow::updateAllInstalledPlugins()
void GuiMainWindow::checkForUpdates()
{
QNetworkAccessManager manager(this);
QNetworkRequest request(QUrl(X_SEVERVERSION));
QNetworkRequest request(QUrl(X_SERVERVERSION));
QNetworkReply *pReply=manager.get(request);
QEventLoop loop;
QObject::connect(pReply, SIGNAL(finished()), &loop, SLOT(quit()));
Expand Down
30 changes: 26 additions & 4 deletions removemoduleprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,41 @@ void RemoveModuleProcess::process()

emit infoMessage(currentStats.sFile);

if(record.bIsFile)
if(record.action==Utils::RRA_REMOVEFILE)
{
XBinary::removeFile(record.sFullPath);

if(XBinary::isFileExists(record.sFullPath))
{
emit errorMessage(tr("%1: %2").arg(tr("Cannot remove file")).arg(record.sFullPath));
bIsStop=true;
}
}
else
else if(record.action==Utils::RRA_REMOVEDIRECTORYIFEMPTY)
{
XBinary::removeDirectory(record.sFullPath);
if(XBinary::isDirectoryEmpty(record.sFullPath))
{
XBinary::removeDirectory(record.sFullPath);

if(XBinary::isDirectoryExists(record.sFullPath))
{
emit errorMessage(tr("%1: %2").arg(tr("Cannot remove directory")).arg(record.sFullPath));
bIsStop=true;
}
}
}

currentStats.nCurrentFile=j+1;
}

XBinary::removeFile(sFileName);
if(!bIsStop)
{
XBinary::removeFile(sFileName);
}
else
{
emit errorMessage(tr("Please, close all applications and try again."));
}
}

currentStats.nCurrentModule=i+1;
Expand Down
8 changes: 6 additions & 2 deletions utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ QByteArray Utils::createPluginInfo(Utils::MDATA *pMData, QList<Utils::FILE_RECOR
removeArray.append(record);
}

for(int i=0;i<nDirectoriesCount;i++)
for(int i=nDirectoriesCount-1;i>=0;i--)
{
QJsonObject record;

Expand Down Expand Up @@ -291,7 +291,11 @@ Utils::MDATA Utils::getMDataFromData(QByteArray baData, QString sRootPath)

if(sAction=="remove_file")
{
record.bIsFile=true;
record.action=RRA_REMOVEFILE;
}
else if(sAction=="remove_directory_if_empty")
{
record.action=RRA_REMOVEDIRECTORYIFEMPTY;
}

result.listRemoveRecords.append(record);
Expand Down
9 changes: 8 additions & 1 deletion utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,18 @@ class Utils : public QObject
QString sSHA1;
};

enum RRA
{
RRA_UNKNOWN=0,
RRA_REMOVEFILE,
RRA_REMOVEDIRECTORYIFEMPTY
};

struct REMOVE_RECORD
{
QString sFullPath;
QString sPath;
bool bIsFile;
RRA action;
};

struct MDATA
Expand Down

0 comments on commit 514add8

Please sign in to comment.