[easytag/wip/application-window: 111/112] Remove unused function in misc.c



commit 4480edef2fe48504366bfb4580fd1733b4f27154
Author: David King <amigadave amigadave com>
Date:   Wed Aug 27 20:49:09 2014 +0100

    Remove unused function in misc.c
    
    Found with cppcheck.

 src/misc.c |   53 +----------------------------------------------------
 src/misc.h |    1 -
 2 files changed, 1 insertions(+), 53 deletions(-)
---
diff --git a/src/misc.c b/src/misc.c
index bed939d..0879124 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -266,8 +266,7 @@ et_run_program (const gchar *program_name, GList *args_list)
      * poorly when there are spaces in the absolute path to the binary. */
     program_tmp = g_strdup (program_name);
 
-    /* Skip the binary name and a delimiter. Same logic in
-     * Check_If_Executable_Exists()*/
+    /* Skip the binary name and a delimiter. */
 #ifdef G_OS_WIN32
     /* FIXME: Should also consider .com, .bat, .sys. See
      * g_find_program_in_path(). */
@@ -483,56 +482,6 @@ Run_Audio_Player_Using_Directory (void)
 }
 
 /*
- * Check if the executable passed in parameter can be launched
- * Returns the full path of the file (must be freed if not used)
- */
-gchar *Check_If_Executable_Exists (const gchar *program)
-{
-    gchar *program_tmp;
-    gchar *tmp;
-
-    g_return_val_if_fail (program != NULL, NULL);
-
-    program_tmp = g_strdup(program);
-    g_strstrip(program_tmp);
-
-#ifdef G_OS_WIN32
-    // Remove arguments if found, after '.exe'
-    if ( (tmp=strstr(program_tmp,".exe")) )
-        *(tmp + 4) = 0;
-#else /* !G_OS_WIN32 */
-    // Remove arguments if found
-    if ( (tmp=strchr(program_tmp,' ')) )
-        *tmp = 0;
-#endif /* !G_OS_WIN32 */
-
-    if (g_path_is_absolute(program_tmp))
-    {
-        if (access(program_tmp, X_OK) == 0)
-        {
-            return program_tmp;
-        } else
-        {
-            g_free(program_tmp);
-            return NULL;
-        }
-    } else
-    {
-        tmp = g_find_program_in_path(program_tmp);
-        if (tmp)
-        {
-            g_free(program_tmp);
-            return tmp;
-        }else
-        {
-            g_free(program_tmp);
-            return NULL;
-        }
-    }
-
-}
-
-/*
  * Convert a series of seconds into a readable duration
  * Remember to free the string that is returned
  */
diff --git a/src/misc.h b/src/misc.h
index bf664d7..ddb2971 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -41,7 +41,6 @@ gchar   *Get_Active_Combo_Box_Item(GtkComboBox *combo);
  * Other
  */
 void Init_Character_Translation_Table (void);
-gchar *Check_If_Executable_Exists (const gchar *program);
 
 // Mouse cursor
 void Init_Mouse_Cursor    (void);


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