summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-André Jacquod <pjacquod@alumni.ethz.ch>2011-09-09 21:52:22 +0200
committerTor Lillqvist <tlillqvist@suse.com>2011-09-12 10:21:18 +0300
commit2b44c6ee402ae2b96e87772a6a7bb11ddf79c136 (patch)
treebf68daef64b0fde2f5eff46edcff5c5dfbbfaf99
parent332dbe0df2ac8d746ac3ce621dd947c379dde776 (diff)
unneded var deleted and code simplified. in setup_native
After deleting the different assignment that were not used, some part of the code could be simiplified, since there is no need any more for the logic.
-rw-r--r--setup_native/source/win32/customactions/shellextensions/registerextensions.cxx34
1 files changed, 3 insertions, 31 deletions
diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
index 28ea3998e76f..94351180c8af 100644
--- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
@@ -117,7 +117,6 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
{
bool bDirectoryRemoved = true;
- std::_tstring mystr;
std::_tstring sPattern = sPath + TEXT("\\") + TEXT("*.*");
WIN32_FIND_DATA aFindData;
@@ -135,8 +134,6 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
std::_tstring sCurrentDir = TEXT(".");
std::_tstring sParentDir = TEXT("..");
- mystr = "Current short file: " + sFileName;
-
if (( strcmp(sFileName.c_str(),sCurrentDir.c_str()) != 0 ) &&
( strcmp(sFileName.c_str(),sParentDir.c_str()) != 0 ))
{
@@ -144,27 +141,11 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
if ( aFindData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY )
{
- bool fSuccess = RemoveCompleteDirectory(sCompleteFileName);
- if ( fSuccess )
- {
- mystr = "Successfully removed content of dir " + sCompleteFileName;
- }
- else
- {
- mystr = "An error occurred during removing content of " + sCompleteFileName;
- }
+ RemoveCompleteDirectory(sCompleteFileName);
}
else
{
- bool fSuccess = DeleteFile( sCompleteFileName.c_str() );
- if ( fSuccess )
- {
- mystr = "Successfully removed file " + sCompleteFileName;
- }
- else
- {
- mystr = "An error occurred during removal of file " + sCompleteFileName;
- }
+ DeleteFile( sCompleteFileName.c_str() );
}
}
@@ -178,17 +159,8 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
// RemoveDirectory is only successful, if the last handle to the directory is closed
// -> first removing content -> closing handle -> remove empty directory
- bool fRemoveDirSuccess = RemoveDirectory(sPath.c_str());
-
- if ( fRemoveDirSuccess )
- {
- mystr = "Successfully removed dir " + sPath;
- // MessageBox(NULL, mystr.c_str(), "Removed Directory", MB_OK);
- }
- else
+ if ( ! ( RemoveDirectory(sPath.c_str()) ) )
{
- mystr = "An error occurred during removal of empty directory " + sPath;
- // MessageBox(NULL, mystr.c_str(), "Error removing directory", MB_OK);
bDirectoryRemoved = false;
}
}