mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
Only cache successful run. (Thanks to Koppa nd daemoni)
This commit is contained in:
parent
29360b20aa
commit
9b67838b56
3 changed files with 23 additions and 18 deletions
2
AUTHORS
2
AUTHORS
|
@ -21,3 +21,5 @@ Tilman Blumenbach
|
|||
qedi
|
||||
seanpringle
|
||||
vimeitor
|
||||
koppa
|
||||
daemoni
|
||||
|
|
|
@ -45,8 +45,9 @@
|
|||
|
||||
#define RUN_CACHE_FILE "rofi-2.runcache"
|
||||
|
||||
static inline void execsh ( const char *cmd, int run_in_term )
|
||||
static inline int execsh ( const char *cmd, int run_in_term )
|
||||
{
|
||||
int retv = TRUE;
|
||||
char **args = NULL;
|
||||
int argc = 0;
|
||||
if ( run_in_term ) {
|
||||
|
@ -63,10 +64,12 @@ static inline void execsh ( const char *cmd, int run_in_term )
|
|||
g_free ( msg );
|
||||
// print error.
|
||||
g_error_free ( error );
|
||||
retv = FALSE;
|
||||
}
|
||||
|
||||
// Free the args list.
|
||||
g_strfreev ( args );
|
||||
return retv;
|
||||
}
|
||||
|
||||
// execute sub-process
|
||||
|
@ -76,8 +79,7 @@ static void exec_cmd ( const char *cmd, int run_in_term )
|
|||
return;
|
||||
}
|
||||
|
||||
execsh ( cmd, run_in_term );
|
||||
|
||||
if ( execsh ( cmd, run_in_term ) ) {
|
||||
/**
|
||||
* This happens in non-critical time (After launching app)
|
||||
* It is allowed to be a bit slower.
|
||||
|
@ -87,6 +89,7 @@ static void exec_cmd ( const char *cmd, int run_in_term )
|
|||
history_set ( path, cmd );
|
||||
|
||||
g_free ( path );
|
||||
}
|
||||
}
|
||||
// execute sub-process
|
||||
static void delete_entry ( const char *cmd )
|
||||
|
|
Loading…
Reference in a new issue