mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-26 00:20:38 +02:00
Memorize the selector's directory as the default one for later use
When a app is launched with a file selected with the built-in file selector, we memorize the directory on which the file was found, so that a future launch of that application will directly open that directory.
This commit is contained in:
parent
a04b9e3ab3
commit
c94968f533
@ -313,6 +313,8 @@ bool LinkApp::targetExists()
|
||||
bool LinkApp::save() {
|
||||
if (!edited) return false;
|
||||
|
||||
DEBUG("Saving file: %s\n", file.c_str());
|
||||
|
||||
ofstream f(file.c_str());
|
||||
if (f.is_open()) {
|
||||
#ifdef HAVE_LIBOPK
|
||||
@ -501,6 +503,11 @@ void LinkApp::selector(int startSelection, const string &selectorDir) {
|
||||
|
||||
void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
|
||||
drawRun();
|
||||
|
||||
if (selectedDir == "")
|
||||
selectordir = getSelectorDir();
|
||||
else
|
||||
selectordir = selectedDir;
|
||||
save();
|
||||
|
||||
#ifdef HAVE_LIBOPK
|
||||
@ -535,13 +542,7 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
|
||||
#endif
|
||||
|
||||
if (selectedFile != "") {
|
||||
string path;
|
||||
|
||||
if (selectedDir == "")
|
||||
path = getSelectorDir();
|
||||
else
|
||||
path = selectedDir;
|
||||
path = cmdclean(path + selectedFile);
|
||||
string path = cmdclean(selectordir + selectedFile);
|
||||
|
||||
if (params == "") {
|
||||
params = path;
|
||||
|
Loading…
Reference in New Issue
Block a user