1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-05 07:21:33 +02:00

Remove "scan for applications and games" feature

It's been broken for a long time now.
This commit is contained in:
Paul Cercueil 2014-01-16 16:07:06 +01:00
parent e63ad99ba9
commit ad30fae321
3 changed files with 0 additions and 113 deletions

View File

@ -74,9 +74,6 @@ ContextMenu::ContextMenu(GMenu2X &gmenu2x, Menu &menu)
options.push_back(std::make_shared<MenuOption>(
tr["Delete section"],
std::bind(&GMenu2X::deleteSection, &gmenu2x)));
options.push_back(std::make_shared<MenuOption>(
tr["Scan for applications and games"],
std::bind(&GMenu2X::scanner, &gmenu2x)));
// Compute bounding box.
int w = 0;

View File

@ -1036,106 +1036,6 @@ void GMenu2X::deleteSection() {
}
}
void GMenu2X::scanner() {
Surface scanbg(bg);
drawButton(&scanbg, "cancel", tr["Exit"],
drawButton(&scanbg, "accept", "", 5)-10);
scanbg.write(font,tr["Link Scanner"],halfX,7,Font::HAlignCenter,Font::VAlignMiddle);
scanbg.convertToDisplayFormat();
uint lineY = 42;
#ifdef PLATFORM_PANDORA
//char *configpath = pnd_conf_query_searchpath();
#else
#ifdef ENABLE_CPUFREQ
setSafeMaxClock();
#endif
scanbg.write(font,tr["Scanning filesystem..."],5,lineY);
scanbg.blit(s,0,0);
s->flip();
lineY += 26;
vector<string> files;
scanPath(CARD_ROOT, &files);
stringstream ss;
ss << files.size();
string str = "";
ss >> str;
scanbg.write(font,tr.translate("$1 files found.",str.c_str(),NULL),5,lineY);
lineY += 26;
scanbg.write(font,tr["Creating links..."],5,lineY);
scanbg.blit(s,0,0);
s->flip();
lineY += 26;
string path, file;
string::size_type pos;
uint linkCount = 0;
for (uint i = 0; i<files.size(); i++) {
pos = files[i].rfind("/");
if (pos!=string::npos && pos>0) {
path = files[i].substr(0, pos+1);
file = files[i].substr(pos+1, files[i].length());
if (menu->addLink(path,file,"found "+file.substr(file.length()-3,3)))
linkCount++;
}
}
ss.clear();
ss << linkCount;
ss >> str;
scanbg.write(font,tr.translate("$1 links created.",str.c_str(),NULL),5,lineY);
scanbg.blit(s,0,0);
s->flip();
lineY += 26;
#ifdef ENABLE_CPUFREQ
setMenuClock();
#endif
#endif
InputManager::Button button;
do {
button = input.waitForPressedButton();
} while ((button != InputManager::SETTINGS)
&& (button != InputManager::ACCEPT)
&& (button != InputManager::CANCEL));
}
void GMenu2X::scanPath(string path, vector<string> *files) {
DIR *dirp;
struct stat st;
struct dirent *dptr;
string filepath, ext;
if (path[path.length()-1]!='/') path += "/";
if ((dirp = opendir(path.c_str())) == NULL) return;
while ((dptr = readdir(dirp))) {
if (dptr->d_name[0]=='.')
continue;
filepath = path+dptr->d_name;
int statRet = stat(filepath.c_str(), &st);
if (S_ISDIR(st.st_mode))
scanPath(filepath, files);
if (statRet != -1) {
ext = filepath.substr(filepath.length()-4,4);
#if defined(PLATFORM_A320) || defined(PLATFORM_GCW0) || defined(PLATFORM_NANONOTE)
if (ext==".dge")
#else
if (ext==".pxml")
#endif
files->push_back(filepath);
}
}
closedir(dirp);
}
typedef struct {
unsigned short batt;
unsigned short remocon;

View File

@ -100,11 +100,6 @@ private:
void initCPULimits();
#endif
void browsePath(const std::string &path, std::vector<std::string>* directories, std::vector<std::string>* files);
/*!
Performs the actual scan in the given path and populates the files vector with the results. The creation of the links is not performed here.
@see scanner
*/
void scanPath(std::string path, std::vector<std::string> *files);
/*!
Displays a selector and launches the specified executable file
@ -171,11 +166,6 @@ public:
//Status functions
void main();
/**
* Starts the scanning of the nand and sd filesystems, searching for dge
* and gpu files and creating the links in 2 dedicated sections.
*/
void scanner();
void showContextMenu();
void showHelpPopup();
void showManual();