anjuta r3905 - in trunk: . data plugins/run-program
- From: sgranjoux svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r3905 - in trunk: . data plugins/run-program
- Date: Thu, 1 May 2008 10:52:22 +0100 (BST)
Author: sgranjoux
Date: Thu May 1 09:52:21 2008
New Revision: 3905
URL: http://svn.gnome.org/viewvc/anjuta?rev=3905&view=rev
Log:
* data/default.profile:
Put the new run program plugin in the default plugin list
* plugins/run-program/execute.c:
Fix a crash when the program doesn't exist
Modified:
trunk/ChangeLog
trunk/data/default.profile
trunk/plugins/run-program/execute.c
Modified: trunk/data/default.profile
==============================================================================
--- trunk/data/default.profile (original)
+++ trunk/data/default.profile Thu May 1 09:52:21 2008
@@ -44,4 +44,11 @@
attribute="Interfaces"
value="IAnjutaFileManager"/>
</plugin>
+ <plugin name="Run Program"
+ url="http://anjuta.org/plugins/"
+ mandatory="no">
+ <require group="Anjuta Plugin"
+ attribute="Location"
+ value="anjuta-run-program:RunProgramPlugin"/>
+ </plugin>
</anjuta>
Modified: trunk/plugins/run-program/execute.c
==============================================================================
--- trunk/plugins/run-program/execute.c (original)
+++ trunk/plugins/run-program/execute.c Thu May 1 09:52:21 2008
@@ -113,7 +113,7 @@
{
gchar *target = NULL;
gchar *dir_uri = NULL;
- const gchar *err_msg;
+ const gchar *err_msg = NULL;
anjuta_shell_get (ANJUTA_PLUGIN (plugin)->shell,
RUN_PROGRAM_DIR, G_TYPE_STRING, &dir_uri,
@@ -121,9 +121,7 @@
if (target == NULL)
{
- g_free (target);
- g_free (dir_uri);
- return FALSE;
+ err_msg = ""; /* No error message, just do nothing */
}
else if ((*local = gnome_vfs_get_local_path_from_uri (target)) == NULL)
{
@@ -142,8 +140,6 @@
}
else
{
- g_free (target);
- g_free (dir_uri);
target = *local;
if (g_file_test (*local, G_FILE_TEST_EXISTS) == FALSE)
@@ -154,18 +150,16 @@
{
err_msg = _("Program '%s' does not have execution permission");
}
- else
- {
- /* Return local executable */
- return TRUE;
- }
}
-
- anjuta_util_dialog_error (GTK_WINDOW (ANJUTA_PLUGIN (plugin)->shell), err_msg, target);
+
+ if (err_msg && (*err_msg != '\0'))
+ {
+ anjuta_util_dialog_error (GTK_WINDOW (ANJUTA_PLUGIN (plugin)->shell), err_msg, target);
+ }
g_free (target);
g_free (dir_uri);
- return FALSE;
+ return err_msg == NULL;
}
static GPid
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]