rename USE_XDG to USE_GLIB_XDG
This commit is contained in:
parent
8e1c8718ae
commit
ee2560d57f
12
data/gmrunrc
12
data/gmrunrc
|
@ -28,9 +28,6 @@ ShowDotFiles = 0
|
|||
# Set this to NULL if don't like this feature.
|
||||
TabTimeout = 0
|
||||
|
||||
# use GLib XDG handling? (freedesktop specification)
|
||||
USE_XDG = 0
|
||||
|
||||
# Use libc's system(3) to run commands, this includes any shell command
|
||||
# and special stuff that only a shell interpreter can understand
|
||||
# Set to 0 if you want a more conservative approach where the file to run
|
||||
|
@ -38,15 +35,18 @@ USE_XDG = 0
|
|||
SHELL_RUN = 1
|
||||
|
||||
|
||||
# use GLib XDG handling? (freedesktop specification)
|
||||
USE_GLIB_XDG = 0
|
||||
|
||||
#=======================================================================
|
||||
# if not using XDG, you can specify URL and extension Handlers...
|
||||
# USE_GLIB_XDG = 0, you can specify URL and extension Handlers...
|
||||
#=======================================================================
|
||||
|
||||
# URL handlers
|
||||
# If the entered text is "http://www.google.com" then:
|
||||
# - %u gets replaced with the whole URL ("http://www.google.com")
|
||||
# - %s gets replaced with "//www.google.com". This is useful for URL-s
|
||||
# like "man:printf" --> %s will get replaced with "printf"
|
||||
# - %s gets replaced with "//www.google.com".
|
||||
# useful for URL's like "man:printf" --> %s becomes printf
|
||||
URL_http = xdg-open '%u'
|
||||
URL_mailto = xdg-email '%u'
|
||||
URL_file = xdg-open '%s'
|
||||
|
|
12
src/main.c
12
src/main.c
|
@ -52,7 +52,7 @@ GtkWidget * wlabel;
|
|||
GtkWidget * wlabel_search;
|
||||
|
||||
/* preferences */
|
||||
int USE_XDG = 0;
|
||||
int USE_GLIB_XDG = 0;
|
||||
int SHELL_RUN = 1;
|
||||
|
||||
/// BEGIN: TIMEOUT MANAGEMENT
|
||||
|
@ -150,7 +150,7 @@ static void run_the_command (char * cmd)
|
|||
static void
|
||||
on_ext_handler (GtkCompletionLine *cl, const char * filename)
|
||||
{
|
||||
if (USE_XDG) // GLib XDG handling (freedesktop specification)
|
||||
if (USE_GLIB_XDG) // GLib XDG handling (freedesktop specification)
|
||||
{
|
||||
gchar * content_type, * mime_type, * msg;
|
||||
const gchar * handler;
|
||||
|
@ -308,7 +308,7 @@ static void xdg_app_run_command (GAppInfo *app, const gchar *args)
|
|||
/* Handler for URLs */
|
||||
static gboolean url_check (GtkCompletionLine *cl, char * entry_text)
|
||||
{
|
||||
if (USE_XDG) // GLib XDG handling (freedesktop specification)
|
||||
if (USE_GLIB_XDG) // GLib XDG handling (freedesktop specification)
|
||||
{
|
||||
char * delim;
|
||||
const char * url, * protocol;
|
||||
|
@ -418,7 +418,7 @@ static char * escape_spaces (char * entry_text)
|
|||
/* Handler for extensions */
|
||||
static gboolean ext_check (GtkCompletionLine *cl, char * entry_text)
|
||||
{
|
||||
if (USE_XDG) // GLib XDG handling (freedesktop specification)
|
||||
if (USE_GLIB_XDG) // GLib XDG handling (freedesktop specification)
|
||||
{
|
||||
char *quoted, *content_type, *mime_type;
|
||||
GAppInfo *app_info;
|
||||
|
@ -581,8 +581,8 @@ static void gmrun_activate(void)
|
|||
if (!config_get_int ("TabTimeout", &tmp)) {
|
||||
((GtkCompletionLine*)compline)->tabtimeout = tmp;
|
||||
}
|
||||
if (!config_get_int ("USE_XDG", &USE_XDG)) {
|
||||
USE_XDG = 0;
|
||||
if (!config_get_int ("USE_GLIB_XDG", &USE_GLIB_XDG)) {
|
||||
USE_GLIB_XDG = 0;
|
||||
}
|
||||
|
||||
g_signal_connect(G_OBJECT(compline), "cancel",
|
||||
|
|
Loading…
Reference in New Issue