]> git.itanic.dy.fi Git - maemo-mapper/commitdiff
Fixed flite invocation bug.
authorgnuite <gnuite@gmail.com>
Thu, 16 Oct 2008 07:50:29 +0000 (07:50 +0000)
committergnuite <gnuite@gmail.com>
Thu, 16 Oct 2008 07:50:29 +0000 (07:50 +0000)
git-svn-id: svn+ssh://garage/var/lib/gforge/svnroot/maemo-mapper/trunk@217 6c538b50-5814-0410-93ad-8bdf4c0149d1

src/defines.h
src/path.c
src/settings.c

index 6f209aee39fbf1a36379a3f6becc534402f4c224..c156afb3af4e37332d29e121569f01d34a47a7c1 100644 (file)
     g_free(my_macro_buffer); \
 }
 
+#define _voice_synth_path "/usr/bin/flite"
+
 #endif /* ifndef MAEMO_MAPPER_DEFINES */
index 2fbf94f7c347f57f60c61a5c7df708483a8386ac..50bf3caa368cc5766a30de876b446eda1952f6e2 100644 (file)
@@ -939,11 +939,14 @@ track_add(time_t time, gboolean newly_fixed)
                         hildon_play_system_sound(
                             "/usr/share/sounds/ui-information_note.wav");
                         sleep(1);
-#               define _voice_synth_path "/usr/bin/flite"
                         printf("%s %s\n", _voice_synth_path,
                                 _last_spoken_phrase);
-                        execl("/bin/sh", _voice_synth_path, _voice_synth_path,
+                        execl(_voice_synth_path, basename(_voice_synth_path),
                                 "-t", _last_spoken_phrase, (char *)NULL);
+                        /* No good?  Try to launch it with /bin/sh */
+                        execl("/bin/sh", "sh", "-c", _voice_synth_path,
+                                "-t", _last_spoken_phrase, (char *)NULL);
+                        /* Still no good? Oh well... */
                         exit(0);
                     }
                 }
index e1ef2dd12950572aca1a0f130a11cbf1b74e4899..ba46750127c82cc26023f020ea08bc0a91722308 100644 (file)
@@ -2100,6 +2100,16 @@ settings_init()
     else
         _enable_voice = TRUE;
 
+    if(_enable_voice)
+    {
+        /* Make sure we actually have voice capabilities. */
+        GnomeVFSFileInfo file_info;
+        _enable_voice = ((GNOME_VFS_OK == gnome_vfs_get_file_info(
+                    _voice_synth_path, &file_info,
+                    GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS))
+            && (file_info.permissions & GNOME_VFS_PERM_ACCESS_EXECUTABLE));
+    }
+
     /* Get Fullscreen flag. Default is FALSE. */
     _fullscreen = gconf_client_get_bool(gconf_client,
             GCONF_KEY_FULLSCREEN, NULL);