SF.net SVN: geany: [898] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Mon Oct 16 14:42:06 UTC 2006
Revision: 898
http://svn.sourceforge.net/geany/?rev=898&view=rev
Author: ntrel
Date: 2006-10-16 07:41:57 -0700 (Mon, 16 Oct 2006)
Log Message:
-----------
Move build_info struct to build.c and merge with build_options.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/build.c
trunk/src/build.h
trunk/src/callbacks.c
trunk/src/msgwindow.c
trunk/src/msgwindow.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-10-16 14:15:04 UTC (rev 897)
+++ trunk/ChangeLog 2006-10-16 14:41:57 UTC (rev 898)
@@ -5,8 +5,10 @@
* src/build.c, src/build.h, src/geany.h, src/callbacks.c:
Don't overwrite Make Custom string when using Make Object.
Move app->build_make_custopt to build_options struct in build.c.
+ * src/build.c, src/build.h, src/msgwindow.c, src/callbacks.c,
+ src/msgwindow.h:
+ Move build_info struct to build.c and merge with build_options.
-
2006-10-13 Enrico Tröger <enrico.troeger at uvena.de>
* src/ui_utils.c, src/treeviews.c:
Modified: trunk/src/build.c
===================================================================
--- trunk/src/build.c 2006-10-16 14:15:04 UTC (rev 897)
+++ trunk/src/build.c 2006-10-16 14:41:57 UTC (rev 898)
@@ -44,7 +44,7 @@
#include "main.h"
-BuildOptions build_options = {NULL};
+BuildInfo build_info = {NULL, GEANY_FILETYPES_ALL, NULL};
static gboolean build_iofunc(GIOChannel *ioc, GIOCondition cond, gpointer data);
@@ -53,6 +53,13 @@
+void build_finalize()
+{
+ g_free(build_info.dir);
+ g_free(build_info.custom_target);
+}
+
+
GPid build_compile_tex_file(gint idx, gint mode)
{
gchar **argv;
@@ -184,9 +191,9 @@
argv[1] = get_object_filename(idx);
argv[2] = NULL;
}
- else if (build_opts == GBO_MAKE_CUSTOM && build_options.custom_target)
+ else if (build_opts == GBO_MAKE_CUSTOM && build_info.custom_target)
{ //cust-target
- argv[1] = g_strdup(build_options.custom_target);
+ argv[1] = g_strdup(build_info.custom_target);
argv[2] = NULL;
}
else // GBO_MAKE_ALL
@@ -328,7 +335,10 @@
{
filetype *ft = doc_list[idx].file_type;
guint ft_id = (ft == NULL) ? filetypes[GEANY_FILETYPES_ALL]->id : ft->id;
- msgwin_set_build_info(working_dir, ft_id);
+
+ g_free(build_info.dir);
+ build_info.dir = g_strdup(working_dir);
+ build_info.file_type_id = ft_id;
}
if (! g_spawn_async_with_pipes(working_dir, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
Modified: trunk/src/build.h
===================================================================
--- trunk/src/build.h 2006-10-16 14:15:04 UTC (rev 897)
+++ trunk/src/build.h 2006-10-16 14:41:57 UTC (rev 898)
@@ -33,12 +33,16 @@
typedef struct
{
- gchar *custom_target;
-} BuildOptions;
+ gchar *dir;
+ guint file_type_id;
+ gchar *custom_target;
+} BuildInfo;
-extern BuildOptions build_options;
+extern BuildInfo build_info;
+void build_finalize();
+
GPid build_make_file(gint idx, gint build_opts);
GPid build_compile_file(gint idx);
Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c 2006-10-16 14:15:04 UTC (rev 897)
+++ trunk/src/callbacks.c 2006-10-16 14:41:57 UTC (rev 898)
@@ -93,6 +93,7 @@
templates_free_templates();
msgwin_finalize();
search_finalize();
+ build_finalize();
document_finalize();
tm_workspace_free(TM_WORK_OBJECT(app->tm_workspace));
@@ -1631,7 +1632,7 @@
{
dialogs_show_input(_("Enter custom options for the make tool"),
_("Enter custom options here, all entered text is passed to the make command."),
- build_options.custom_target,
+ build_info.custom_target,
G_CALLBACK(on_make_target_dialog_response),
G_CALLBACK(on_make_target_entry_activate));
break;
@@ -1722,8 +1723,8 @@
if (doc_list[idx].changed) document_save_file(idx, FALSE);
- g_free(build_options.custom_target);
- build_options.custom_target = g_strdup(gtk_entry_get_text(GTK_ENTRY(user_data)));
+ g_free(build_info.custom_target);
+ build_info.custom_target = g_strdup(gtk_entry_get_text(GTK_ENTRY(user_data)));
child_pid = build_make_file(idx, GBO_MAKE_CUSTOM);
if (child_pid != (GPid) 0)
Modified: trunk/src/msgwindow.c
===================================================================
--- trunk/src/msgwindow.c 2006-10-16 14:15:04 UTC (rev 897)
+++ trunk/src/msgwindow.c 2006-10-16 14:41:57 UTC (rev 898)
@@ -31,17 +31,12 @@
#include "ui_utils.h"
#include "utils.h"
#include "document.h"
+#include "build.h"
#include <string.h>
#include <stdlib.h>
-static struct
-{
- gchar *dir;
- guint file_type_id;
-} build_info = {NULL, GEANY_FILETYPES_ALL};
-
// used for parse_file_line
typedef struct
{
@@ -75,18 +70,9 @@
void msgwin_finalize()
{
g_free(msgwindow.find_in_files_dir);
- g_free(build_info.dir);
}
-void msgwin_set_build_info(const gchar *dir, guint file_type_id)
-{
- g_free(build_info.dir);
- build_info.dir = g_strdup(dir);
- build_info.file_type_id = file_type_id;
-}
-
-
/* does some preparing things to the status message list widget */
void msgwin_prepare_status_tree_view(void)
{
Modified: trunk/src/msgwindow.h
===================================================================
--- trunk/src/msgwindow.h 2006-10-16 14:15:04 UTC (rev 897)
+++ trunk/src/msgwindow.h 2006-10-16 14:41:57 UTC (rev 898)
@@ -79,8 +79,6 @@
void msgwin_status_add(gchar const *format, ...);
-void msgwin_set_build_info(const gchar *dir, guint file_type_id);
-
GtkWidget *msgwin_create_message_popup_menu(gint type);
gboolean msgwin_goto_compiler_file_line();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list