Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
horsicq committed Jan 4, 2020
1 parent 38dcb29 commit a519e41
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Formats
Submodule Formats updated 2 files
+2 −2 xbinary.cpp
+1 −1 xbinary.h
27 changes: 22 additions & 5 deletions removemoduleprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ void RemoveModuleProcess::process()
{
currentStats.sModule=QString("%1: %2").arg(tr("Remove module")).arg(listModuleNames.at(i));

emit infoMessage(currentStats.sModule);

QString sFileName=Utils::getInstalledJsonFileName(pOptions,listModuleNames.at(i));

if(XBinary::isFileExists(sFileName))
Expand All @@ -77,7 +75,11 @@ void RemoveModuleProcess::process()
{
XBinary::removeFile(record.sFullPath);

if(XBinary::isFileExists(record.sFullPath))
if(!XBinary::isFileExists(record.sFullPath))
{
emit infoMessage(currentStats.sModule);
}
else
{
emit errorMessage(tr("%1: %2").arg(tr("Cannot remove file")).arg(record.sFullPath));
bIsStop=true;
Expand All @@ -89,7 +91,11 @@ void RemoveModuleProcess::process()
{
XBinary::removeDirectory(record.sFullPath);

if(XBinary::isDirectoryExists(record.sFullPath))
if(!XBinary::isDirectoryExists(record.sFullPath))
{
emit infoMessage(currentStats.sModule);
}
else
{
emit errorMessage(tr("%1: %2").arg(tr("Cannot remove directory")).arg(record.sFullPath));
bIsStop=true;
Expand All @@ -103,8 +109,19 @@ void RemoveModuleProcess::process()
if(!bIsStop)
{
XBinary::removeFile(sFileName);

if(!XBinary::isFileExists(sFileName))
{
emit infoMessage(QString("%1: %2").arg(tr("Remove file")).arg(sFileName));
}
else
{
emit errorMessage(tr("%1: %2").arg(tr("Cannot remove file")).arg(sFileName));
bIsStop=true;
}
}
else

if(bIsStop)
{
emit errorMessage(tr("Please, close all applications and try again."));
}
Expand Down

0 comments on commit a519e41

Please sign in to comment.