1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-23 02:37:30 +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:
Paul Cercueil 2012-06-24 23:19:45 +02:00
parent cf20f3673e
commit 1241523105
3 changed files with 0 additions and 29 deletions

View File

@ -255,9 +255,6 @@ GMenu2X::GMenu2X()
bottomBarIconY = resY-18; bottomBarIconY = resY-18;
bottomBarTextY = resY-10; bottomBarTextY = resY-10;
path = "";
getExePath();
#ifdef UNLOCK_VT #ifdef UNLOCK_VT
unlockVT(); unlockVT();
#endif #endif
@ -839,7 +836,6 @@ void GMenu2X::explorer() {
if (confInt["saveSelection"] && (confInt["section"]!=menu->selSectionIndex() || confInt["link"]!=menu->selLinkIndex())) if (confInt["saveSelection"] && (confInt["section"]!=menu->selSectionIndex() || confInt["link"]!=menu->selLinkIndex()))
writeConfig(); writeConfig();
//string command = cmdclean(fd.path()+"/"+fd.file) + "; sync & cd "+cmdclean(getExePath())+"; exec ./gmenu2x";
string command = cmdclean(fd.getPath()+"/"+fd.getFile()); string command = cmdclean(fd.getPath()+"/"+fd.getFile());
chdir(fd.getPath().c_str()); chdir(fd.getPath().c_str());
quit(); quit();
@ -1483,20 +1479,6 @@ void GMenu2X::setClock(unsigned mhz) {
#endif #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) { string GMenu2X::getDiskFree(const char *path) {
stringstream ss; stringstream ss;
string df = ""; string df = "";

View File

@ -65,7 +65,6 @@ typedef std::tr1::unordered_map<std::string, int, std::tr1::hash<std::string> >
class GMenu2X { class GMenu2X {
private: private:
Touchscreen ts; Touchscreen ts;
std::string path; //!< Contains the working directory of GMenu2X
/*! /*!
Retrieves the free disk space on the sd Retrieves the free disk space on the sd
@ -134,14 +133,6 @@ public:
uint resX, resY, halfX, halfY; uint resX, resY, halfX, halfY;
uint bottomBarIconY, bottomBarTextY, linkColumns, linkRows; 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; InputManager input;
//Configuration hashes //Configuration hashes

View File

@ -464,8 +464,6 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
//try relaunching gmenu2x //try relaunching gmenu2x
gmenu2x->main(); gmenu2x->main();
} }
chdir(gmenu2x->getExePath().c_str());
} }
const string &LinkApp::getExec() { const string &LinkApp::getExec() {