summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMShrimp4 <mshrimp@sogang.ac.kr>2022-02-18 12:35:50 +0900
committerMShrimp4 <mshrimp@sogang.ac.kr>2022-02-22 07:05:50 +0900
commitf0b35ba796905b4d07d782fc5918fa1db22ef6d3 (patch)
tree49d151ef4eb5199e4bb2029602615dbe6dc93708
parent41499d63a835fd5e4f3c435489d03962bfae8ea5 (diff)
downloadxfce4-settings-f0b35ba796905b4d07d782fc5918fa1db22ef6d3.tar.gz
Remove dependence on exo-string
Related: exo#82, libxfce4util!24
-rw-r--r--dialogs/mime-settings/xfce-mime-helper-utils.h1
-rw-r--r--dialogs/mime-settings/xfce-mime-helper.c28
-rw-r--r--xfce4-settings-manager/xfce-settings-manager-dialog.c2
3 files changed, 16 insertions, 15 deletions
diff --git a/dialogs/mime-settings/xfce-mime-helper-utils.h b/dialogs/mime-settings/xfce-mime-helper-utils.h
index d7342e65..4dda2306 100644
--- a/dialogs/mime-settings/xfce-mime-helper-utils.h
+++ b/dialogs/mime-settings/xfce-mime-helper-utils.h
@@ -20,6 +20,7 @@
#define __XFCE_MIME_HELPER_UTILS_H__
#include <libxfce4ui/libxfce4ui.h>
+#include <libxfce4util/libxfce4util.h>
#include "xfce-mime-helper.h"
G_BEGIN_DECLS
diff --git a/dialogs/mime-settings/xfce-mime-helper.c b/dialogs/mime-settings/xfce-mime-helper.c
index 47aeeb43..1de11a16 100644
--- a/dialogs/mime-settings/xfce-mime-helper.c
+++ b/dialogs/mime-settings/xfce-mime-helper.c
@@ -140,7 +140,7 @@ substitute_binary (const gchar *commands,
}
else if (binary != NULL)
{
- tmp = exo_str_replace (*s, "%B", binary);
+ tmp = xfce_str_replace (*s, "%B", binary);
g_free (*s);
*t++ = tmp;
}
@@ -181,7 +181,7 @@ xfce_mime_helper_new (const gchar *id,
/* verify the type of the desktop file */
str = xfce_rc_read_entry_untranslated (rc, "Type", NULL);
- if (G_UNLIKELY (!exo_str_is_equal (str, "X-XFCE-Helper")))
+ if (G_UNLIKELY (g_strcmp0 (str, "X-XFCE-Helper") != 0))
goto failed;
/* determine the category of the helper */
@@ -191,13 +191,13 @@ xfce_mime_helper_new (const gchar *id,
/* determine the name of the helper */
str = xfce_rc_read_entry (rc, "Name", NULL);
- if (G_UNLIKELY (exo_str_is_empty (str)))
+ if (G_UNLIKELY (xfce_str_is_empty (str)))
goto failed;
helper->name = g_strdup (str);
/* determine the icon of the helper */
str = xfce_rc_read_entry_untranslated (rc, "Icon", NULL);
- if (G_LIKELY (!exo_str_is_empty (str)))
+ if (G_LIKELY (!xfce_str_is_empty (str)))
helper->icon = g_strdup (str);
/* determine the commands */
@@ -205,7 +205,7 @@ xfce_mime_helper_new (const gchar *id,
if (G_UNLIKELY (commands == NULL))
goto failed;
- commands_with_flag = exo_str_replace (commands, ";", " %s;");
+ commands_with_flag = xfce_str_replace (commands, ";", " %s;");
/* determine the commands (with parameter) */
commands_with_parameter = xfce_rc_read_entry_untranslated (rc, "X-XFCE-CommandsWithParameter", NULL);
@@ -392,9 +392,9 @@ xfce_mime_helper_execute (XfceMimeHelper *helper,
real_parameter = parameter + 7;
/* determine the command set to use */
- if (exo_str_is_flag (real_parameter)) {
+ if (real_parameter != NULL && g_str_has_prefix (real_parameter, "-")) {
commands = helper->commands_with_flag;
- } else if (exo_str_is_empty (real_parameter)) {
+ } else if (xfce_str_is_empty (real_parameter)) {
commands = helper->commands;
} else {
commands = helper->commands_with_parameter;
@@ -414,7 +414,7 @@ xfce_mime_helper_execute (XfceMimeHelper *helper,
g_clear_error (&err);
/* parse the command */
- command = !exo_str_is_empty (real_parameter) ? exo_str_replace (commands[n], "%s", real_parameter) : g_strdup (commands[n]);
+ command = !xfce_str_is_empty (real_parameter) ? xfce_str_replace (commands[n], "%s", real_parameter) : g_strdup (commands[n]);
succeed = g_shell_parse_argv (command, NULL, &argv, &err);
g_free (command);
@@ -805,13 +805,13 @@ xfce_mime_helper_database_set_default (XfceMimeHelperDatabase *database,
xfce_rc_set_group (rc, "Default Applications");
for (i = 0; mimetypes[i] != NULL; i++)
- if (!exo_str_is_empty (mimetypes[i]))
+ if (!xfce_str_is_empty (mimetypes[i]))
xfce_rc_write_entry (rc, mimetypes[i], filename);
xfce_rc_set_group (rc, "Added Associations");
for (i = 0; mimetypes[i] != NULL; i++)
- if (!exo_str_is_empty (mimetypes[i]))
+ if (!xfce_str_is_empty (mimetypes[i]))
{
entry = g_strconcat (filename, ";", NULL);
xfce_rc_write_entry (rc, mimetypes[i], entry);
@@ -937,13 +937,13 @@ xfce_mime_helper_database_clear_default (XfceMimeHelperDatabase *database,
xfce_rc_set_group (rc, "Default Applications");
for (i = 0; mimetypes[i] != NULL; i++)
- if (!exo_str_is_empty (mimetypes[i]))
+ if (!xfce_str_is_empty (mimetypes[i]))
xfce_rc_delete_entry (rc, mimetypes[i], FALSE);
xfce_rc_set_group (rc, "Added Associations");
for (i = 0; mimetypes[i] != NULL; i++)
- if (!exo_str_is_empty (mimetypes[i]))
+ if (!xfce_str_is_empty (mimetypes[i]))
xfce_rc_delete_entry (rc, mimetypes[i], FALSE);
g_strfreev (mimetypes);
@@ -978,7 +978,7 @@ clear_bad_entry (XfceRc *rc,
for (i = 0; values[i] != NULL; i++)
{
- if (!exo_str_is_empty(values[i]) && g_strcmp0(values[i], filename) != 0)
+ if (!xfce_str_is_empty(values[i]) && g_strcmp0(values[i], filename) != 0)
{
list = g_slist_append (list, g_strdup(values[i]));
}
@@ -1145,7 +1145,7 @@ xfce_mime_helper_database_set_custom (XfceMimeHelperDatabase *database,
g_return_if_fail (XFCE_MIME_IS_HELPER_DATABASE (database));
g_return_if_fail (category < XFCE_MIME_HELPER_N_CATEGORIES);
- g_return_if_fail (!exo_str_is_empty (command));
+ g_return_if_fail (!xfce_str_is_empty (command));
/* determine the spec for the custom helper */
category_string = xfce_mime_helper_category_to_string (category);
diff --git a/xfce4-settings-manager/xfce-settings-manager-dialog.c b/xfce4-settings-manager/xfce-settings-manager-dialog.c
index 999b37d2..e39cddf5 100644
--- a/xfce4-settings-manager/xfce-settings-manager-dialog.c
+++ b/xfce4-settings-manager/xfce-settings-manager-dialog.c
@@ -571,7 +571,7 @@ xfce_settings_manager_dialog_query_tooltip (GtkWidget *iconview,
g_assert (GARCON_IS_MENU_ITEM (item));
comment = garcon_menu_item_get_comment (item);
- if (!exo_str_is_empty (comment))
+ if (!xfce_str_is_empty (comment))
gtk_tooltip_set_text (tooltip, comment);
g_value_unset (&value);