mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-29 15:00:37 +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() {
|
bool LinkApp::save() {
|
||||||
if (!edited) return false;
|
if (!edited) return false;
|
||||||
|
|
||||||
|
DEBUG("Saving file: %s\n", file.c_str());
|
||||||
|
|
||||||
ofstream f(file.c_str());
|
ofstream f(file.c_str());
|
||||||
if (f.is_open()) {
|
if (f.is_open()) {
|
||||||
#ifdef HAVE_LIBOPK
|
#ifdef HAVE_LIBOPK
|
||||||
@ -501,6 +503,11 @@ void LinkApp::selector(int startSelection, const string &selectorDir) {
|
|||||||
|
|
||||||
void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
|
void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
|
||||||
drawRun();
|
drawRun();
|
||||||
|
|
||||||
|
if (selectedDir == "")
|
||||||
|
selectordir = getSelectorDir();
|
||||||
|
else
|
||||||
|
selectordir = selectedDir;
|
||||||
save();
|
save();
|
||||||
|
|
||||||
#ifdef HAVE_LIBOPK
|
#ifdef HAVE_LIBOPK
|
||||||
@ -535,13 +542,7 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (selectedFile != "") {
|
if (selectedFile != "") {
|
||||||
string path;
|
string path = cmdclean(selectordir + selectedFile);
|
||||||
|
|
||||||
if (selectedDir == "")
|
|
||||||
path = getSelectorDir();
|
|
||||||
else
|
|
||||||
path = selectedDir;
|
|
||||||
path = cmdclean(path + selectedFile);
|
|
||||||
|
|
||||||
if (params == "") {
|
if (params == "") {
|
||||||
params = path;
|
params = path;
|
||||||
|
Loading…
Reference in New Issue
Block a user