mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 21:29:43 +02:00
Removed variable/function to get the directory of the executable.
The application shouldn't care from which directory it is being executed.
This commit is contained in:
parent
cf20f3673e
commit
1241523105
@ -255,9 +255,6 @@ GMenu2X::GMenu2X()
|
||||
bottomBarIconY = resY-18;
|
||||
bottomBarTextY = resY-10;
|
||||
|
||||
path = "";
|
||||
getExePath();
|
||||
|
||||
#ifdef UNLOCK_VT
|
||||
unlockVT();
|
||||
#endif
|
||||
@ -839,7 +836,6 @@ void GMenu2X::explorer() {
|
||||
if (confInt["saveSelection"] && (confInt["section"]!=menu->selSectionIndex() || confInt["link"]!=menu->selLinkIndex()))
|
||||
writeConfig();
|
||||
|
||||
//string command = cmdclean(fd.path()+"/"+fd.file) + "; sync & cd "+cmdclean(getExePath())+"; exec ./gmenu2x";
|
||||
string command = cmdclean(fd.getPath()+"/"+fd.getFile());
|
||||
chdir(fd.getPath().c_str());
|
||||
quit();
|
||||
@ -1483,20 +1479,6 @@ void GMenu2X::setClock(unsigned mhz) {
|
||||
#endif
|
||||
}
|
||||
|
||||
const string &GMenu2X::getExePath() {
|
||||
if (path.empty()) {
|
||||
char buf[255];
|
||||
memset(buf, 0, 255);
|
||||
int l = readlink("/proc/self/exe", buf, 255);
|
||||
|
||||
path = buf;
|
||||
path = path.substr(0,l);
|
||||
l = path.rfind("/");
|
||||
path = path.substr(0,l+1);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
string GMenu2X::getDiskFree(const char *path) {
|
||||
stringstream ss;
|
||||
string df = "";
|
||||
|
@ -65,7 +65,6 @@ typedef std::tr1::unordered_map<std::string, int, std::tr1::hash<std::string> >
|
||||
class GMenu2X {
|
||||
private:
|
||||
Touchscreen ts;
|
||||
std::string path; //!< Contains the working directory of GMenu2X
|
||||
|
||||
/*!
|
||||
Retrieves the free disk space on the sd
|
||||
@ -134,14 +133,6 @@ public:
|
||||
uint resX, resY, halfX, halfY;
|
||||
uint bottomBarIconY, bottomBarTextY, linkColumns, linkRows;
|
||||
|
||||
/*!
|
||||
Retrieves the parent directory of GMenu2X.
|
||||
This functions is used to initialize the "path" variable.
|
||||
@see path
|
||||
@return String containing the parent directory
|
||||
*/
|
||||
const std::string &getExePath();
|
||||
|
||||
InputManager input;
|
||||
|
||||
//Configuration hashes
|
||||
|
@ -464,8 +464,6 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
|
||||
//try relaunching gmenu2x
|
||||
gmenu2x->main();
|
||||
}
|
||||
|
||||
chdir(gmenu2x->getExePath().c_str());
|
||||
}
|
||||
|
||||
const string &LinkApp::getExec() {
|
||||
|
Loading…
Reference in New Issue
Block a user