Fixed sorting inside subdirectories, removed dead code
This commit is contained in:
parent
07c0413f43
commit
f53426b639
|
|
@ -58,27 +58,6 @@ char *createFilename(char *buffer,const dir_t &p) //buffer>12characters
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CardReader::lsDive_pointer(const char *prepend, SdFile parent, const char * const match) {
|
|
||||||
dir_t p;
|
|
||||||
|
|
||||||
//parent.seekSet =
|
|
||||||
// Read the next entry from a directory
|
|
||||||
//SERIAL_ECHOPGM("Cur pos before.: ");
|
|
||||||
//uint32_t pom = parent.curPosition();
|
|
||||||
//MYSERIAL.println(pom, 10);
|
|
||||||
parent.readDir(p, longFilename);
|
|
||||||
//SERIAL_ECHOPGM("Cur pos.: ");
|
|
||||||
//pom = parent.curPosition();
|
|
||||||
//MYSERIAL.println(pom, 10);
|
|
||||||
|
|
||||||
filenameIsDir = DIR_IS_SUBDIR(&p);
|
|
||||||
|
|
||||||
createFilename(filename, p);
|
|
||||||
creationDate = p.creationDate;
|
|
||||||
creationTime = p.creationTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dive into a folder and recurse depth-first to perform a pre-set operation lsAction:
|
* Dive into a folder and recurse depth-first to perform a pre-set operation lsAction:
|
||||||
* LS_Count - Add +1 to nrFiles for every file within the parent
|
* LS_Count - Add +1 to nrFiles for every file within the parent
|
||||||
|
|
@ -698,6 +677,9 @@ void CardReader::chdir(const char * relpath)
|
||||||
workDirParents[0]=*parent;
|
workDirParents[0]=*parent;
|
||||||
}
|
}
|
||||||
workDir=newfile;
|
workDir=newfile;
|
||||||
|
#ifdef SDCARD_SORT_ALPHA
|
||||||
|
presort();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -709,6 +691,9 @@ void CardReader::updir()
|
||||||
workDir = workDirParents[0];
|
workDir = workDirParents[0];
|
||||||
for (uint8_t d = 0; d < workDirDepth; d++)
|
for (uint8_t d = 0; d < workDirDepth; d++)
|
||||||
workDirParents[d] = workDirParents[d+1];
|
workDirParents[d] = workDirParents[d+1];
|
||||||
|
#ifdef SDCARD_SORT_ALPHA
|
||||||
|
presort();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1009,6 +994,7 @@ void CardReader::presort() {
|
||||||
lcd_implementation_clear();
|
lcd_implementation_clear();
|
||||||
lcd_update(2);
|
lcd_update(2);
|
||||||
#endif
|
#endif
|
||||||
|
lcd_update(2);
|
||||||
KEEPALIVE_STATE(NOT_BUSY);
|
KEEPALIVE_STATE(NOT_BUSY);
|
||||||
lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,6 @@ private:
|
||||||
int16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
|
int16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
|
||||||
char* diveDirName;
|
char* diveDirName;
|
||||||
void lsDive(const char *prepend, SdFile parent, const char * const match=NULL);
|
void lsDive(const char *prepend, SdFile parent, const char * const match=NULL);
|
||||||
void lsDive_pointer(const char *prepend, SdFile parent, const char * const match = NULL);
|
|
||||||
#ifdef SDCARD_SORT_ALPHA
|
#ifdef SDCARD_SORT_ALPHA
|
||||||
void flush_presort();
|
void flush_presort();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue