[epiphany/mwleeds/webapp-dbus-api: 8/17] web-app-utils: Get rid of filename conversion




commit fa7210251e7ff574f88258cfc1830ce7c64a1a22
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Tue Jan 25 13:14:03 2022 -0800

    web-app-utils: Get rid of filename conversion
    
    Now that the ID and GApplication ID are just ASCII characters, we don't
    have to worry about the encoding. We're also passing these filenames to
    the portal not using them directly.

 lib/ephy-web-app-utils.c | 24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)
---
diff --git a/lib/ephy-web-app-utils.c b/lib/ephy-web-app-utils.c
index 9abfc26f0..b0cb8af32 100644
--- a/lib/ephy-web-app-utils.c
+++ b/lib/ephy-web-app-utils.c
@@ -63,21 +63,6 @@ ephy_web_application_get_app_id_from_name (const char *name)
   return g_compute_checksum_for_string (G_CHECKSUM_SHA1, name, -1);
 }
 
-static char *
-get_encoded_path (const char *path)
-{
-  g_autofree char *encoded = NULL;
-  g_autoptr (GError) error = NULL;
-
-  encoded = g_filename_from_utf8 (path, -1, NULL, NULL, &error);
-  if (error) {
-    g_warning ("%s", error->message);
-    return NULL;
-  }
-
-  return g_steal_pointer (&encoded);
-}
-
 static const char *
 get_app_id_from_gapplication_id (const char *name)
 {
@@ -105,25 +90,20 @@ get_gapplication_id_from_id (const char *id)
 static char *
 get_app_profile_directory_name (const char *id)
 {
-  g_autofree char *gapplication_id = NULL;
-
-  gapplication_id = get_gapplication_id_from_id (id);
-  return get_encoded_path (gapplication_id);
+  return get_gapplication_id_from_id (id);
 }
 
 static char *
 get_app_desktop_filename (const char *id)
 {
   g_autofree char *gapplication_id = NULL;
-  g_autofree char *filename = NULL;
 
   /* Warning: the GApplication ID must exactly match the desktop file's
    * basename. Don't overthink this or stuff will break, e.g. GNotification.
    */
   gapplication_id = get_gapplication_id_from_id (id);
 
-  filename = g_strconcat (gapplication_id, ".desktop", NULL);
-  return get_encoded_path (filename);
+  return g_strconcat (gapplication_id, ".desktop", NULL);
 }
 
 const char *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]