code cleanup

This commit is contained in:
Hendrik Schutter 2020-09-16 15:27:25 +02:00
parent 0fc3bc222e
commit 93a741fc6f
2 changed files with 3 additions and 7 deletions

View File

@ -8,9 +8,9 @@
#ifndef REHDD_H_ #ifndef REHDD_H_
#define REHDD_H_ #define REHDD_H_
#define REHDD_VERSION "bV0.1.0" #define REHDD_VERSION "bV0.1.1"
#define DRYRUN //#define DRYRUN
// Drive handling Settings // Drive handling Settings
#define WORSE_HOURS 19200 //mark drive if at this limit or beyond #define WORSE_HOURS 19200 //mark drive if at this limit or beyond

View File

@ -66,7 +66,6 @@ void reHDD::app_logic(void)
read (fdNewDrivesInformPipe[0],&dummy,1); read (fdNewDrivesInformPipe[0],&dummy,1);
filterNewDrives(&listDrives, &listNewDrives); //filter and copy to app logic vector filterNewDrives(&listDrives, &listNewDrives); //filter and copy to app logic vector
printDrives(&listDrives); printDrives(&listDrives);
} }
if (FD_ISSET(fdShredInformPipe[0], &selectSet)) if (FD_ISSET(fdShredInformPipe[0], &selectSet))
@ -88,7 +87,7 @@ Drive* reHDD::getSelectedDrive()
{ {
list<Drive>::iterator it = listDrives.begin(); list<Drive>::iterator it = listDrives.begin();
advance(it, u8SelectedEntry); advance(it, u8SelectedEntry);
return &(*it); return &(*it);
} }
else else
{ {
@ -266,10 +265,7 @@ void reHDD::filterNewDrives(list <Drive>* plistOldDrives, list <Drive>* plistNew
//add new drives to drive list //add new drives to drive list
for (itNew = plistNewDrives->begin(); itNew != plistNewDrives->end(); ++itNew) for (itNew = plistNewDrives->begin(); itNew != plistNewDrives->end(); ++itNew)
{ {
//plistOldDrives->push_back(plistNewDrives->at(itNew - plistNewDrives->begin()));
plistOldDrives->push_back(*itNew); plistOldDrives->push_back(*itNew);
Logger::logThis()->info("Add new drive: " + itNew->getModelName()); Logger::logThis()->info("Add new drive: " + itNew->getModelName());
} }
plistNewDrives->clear(); plistNewDrives->clear();