[anjuta] project-wizard: Remove trailing spaces
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] project-wizard: Remove trailing spaces
- Date: Sun, 25 Nov 2012 11:53:17 +0000 (UTC)
commit 6bb8c36ec0c34361ec76370a70eeace4e6a56167
Author: SÃbastien Granjoux <seb sfo free fr>
Date: Sun Nov 25 12:49:03 2012 +0100
project-wizard: Remove trailing spaces
plugins/project-wizard/action.c | 8 ++--
plugins/project-wizard/druid.c | 2 +-
plugins/project-wizard/file.c | 2 +-
plugins/project-wizard/header.c | 20 ++++----
plugins/project-wizard/parser.c | 94 +++++++++++++++++++-------------------
plugins/project-wizard/plugin.c | 24 +++++-----
plugins/project-wizard/tar.c | 44 +++++++++---------
7 files changed, 97 insertions(+), 97 deletions(-)
---
diff --git a/plugins/project-wizard/action.c b/plugins/project-wizard/action.c
index a81ea89..211a249 100644
--- a/plugins/project-wizard/action.c
+++ b/plugins/project-wizard/action.c
@@ -42,8 +42,8 @@ npw_action_new_file (const gchar *file)
{
NPWAction* action;
- g_return_val_if_fail (file != NULL, NULL);
-
+ g_return_val_if_fail (file != NULL, NULL);
+
action = g_slice_new (NPWAction);
action->type = NPW_OPEN_ACTION;
action->command = g_strdup (file);
@@ -56,8 +56,8 @@ npw_action_new_command (const gchar *command)
{
NPWAction* action;
- g_return_val_if_fail (command != NULL, NULL);
-
+ g_return_val_if_fail (command != NULL, NULL);
+
action = g_slice_new (NPWAction);
action->type = NPW_RUN_ACTION;
action->command = g_strdup (command);
diff --git a/plugins/project-wizard/druid.c b/plugins/project-wizard/druid.c
index e062525..e03ec33 100644
--- a/plugins/project-wizard/druid.c
+++ b/plugins/project-wizard/druid.c
@@ -421,7 +421,7 @@ npw_druid_fill_selection_page (NPWDruid* druid, GFile *templates)
* other directories can still be used to get included
* files */
gchar *directory = g_file_get_path (templates);
-
+
npw_header_list_readdir (&druid->header_list, directory);
anjuta_autogen_set_library_path (druid->gen, directory);
g_free (directory);
diff --git a/plugins/project-wizard/file.c b/plugins/project-wizard/file.c
index 2e4beff..35dcd90 100644
--- a/plugins/project-wizard/file.c
+++ b/plugins/project-wizard/file.c
@@ -58,7 +58,7 @@ npw_file_new_file (const gchar *destination, const gchar *source)
file->destination = g_strdup (destination);
file->source = g_strdup (source);
file->attribute = 0;
-
+
return file;
}
diff --git a/plugins/project-wizard/header.c b/plugins/project-wizard/header.c
index a3849cf..c0e8849 100644
--- a/plugins/project-wizard/header.c
+++ b/plugins/project-wizard/header.c
@@ -67,7 +67,7 @@ void
npw_header_free (NPWHeader* self)
{
if (self == NULL) return;
-
+
g_free (self->name);
g_free (self->description);
g_free (self->iconfile);
@@ -169,7 +169,7 @@ npw_header_add_required_program (NPWHeader* self, const gchar* program)
self->required_programs =
g_list_prepend (self->required_programs,
g_strdup (program));
-
+
}
void
@@ -223,7 +223,7 @@ npw_header_list_new (void)
GList* list;
list = NULL;
-
+
return list;
}
@@ -267,13 +267,13 @@ npw_header_list_insert_header (GList *list, NPWHeader *header)
{
GList *node;
GList *template_list;
-
+
for (node = g_list_first (list); node != NULL; node = g_list_next (node))
{
NPWHeader* first;
gint res;
-
- template_list = (GList *)node->data;
+
+ template_list = (GList *)node->data;
first = (NPWHeader *)template_list->data;
res = g_ascii_strcasecmp (npw_header_get_category (first), npw_header_get_category (header));
if (res == 0)
@@ -297,19 +297,19 @@ npw_header_list_find_header (GList *list, NPWHeader *header)
{
GList *node;
GList *template_list;
-
+
for (node = g_list_first (list); node != NULL; node = g_list_next (node))
{
NPWHeader* first;
gint res;
-
- template_list = (GList *)node->data;
+
+ template_list = (GList *)node->data;
first = (NPWHeader *)template_list->data;
res = g_ascii_strcasecmp (npw_header_get_category (first), npw_header_get_category (header));
if (res == 0)
{
GList *find;
-
+
find = g_list_find_custom (template_list, header, (GCompareFunc) compare_header_name);
if (find != NULL)
{
diff --git a/plugins/project-wizard/parser.c b/plugins/project-wizard/parser.c
index b782cf8..2232807 100644
--- a/plugins/project-wizard/parser.c
+++ b/plugins/project-wizard/parser.c
@@ -18,7 +18,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/*
+/*
* All functions for parsing wizard template (.wiz) files
*
*---------------------------------------------------------------------------*/
@@ -218,7 +218,7 @@ parse_tag (const char* name)
return (NPWTag)mapping->id;
}
}
-
+
return NPW_UNKNOW_TAG;
}
@@ -234,7 +234,7 @@ parse_attribute (const char* name)
return (NPWAttribute)mapping->id;
}
}
-
+
return NPW_UNKNOW_ATTRIBUTE;
}
@@ -293,7 +293,7 @@ get_tag_language (const gchar** attributes,
const gchar** values)
{
const gchar *lang = NULL;
-
+
while (*attributes != NULL)
{
if (parse_attribute (*attributes) == NPW_XML_LANG_ATTRIBUTE)
@@ -303,12 +303,12 @@ get_tag_language (const gchar** attributes,
attributes++;
values++;
}
-
+
if (lang != NULL)
{
const gchar* const *local;
gint id = G_MAXINT;
-
+
for (local = g_get_language_names (); *local != NULL; local++)
{
id--;
@@ -317,7 +317,7 @@ get_tag_language (const gchar** attributes,
return id;
}
}
-
+
return -1;
}
else
@@ -366,7 +366,7 @@ parse_header_start (GMarkupParseContext* context,
{
/* Not inside an unknown element */
tag = parse_tag (name);
-
+
switch (*parser->last)
{
case NPW_NO_TAG:
@@ -435,7 +435,7 @@ parse_header_end (GMarkupParseContext* context,
GError** error)
{
NPWHeaderParser* parser = (NPWHeaderParser*)data;
-
+
if (parser->unknown > 0)
{
/* Pop unknown element */
@@ -461,8 +461,8 @@ parse_header_end (GMarkupParseContext* context,
/* error should be available to stop parsing */
g_return_if_fail (error != NULL);
-
- /* Send an error */
+
+ /* Send an error */
*error = g_error_new_literal (parser_error_quark (), NPW_STOP_PARSING, "");
}
}
@@ -606,7 +606,7 @@ npw_header_list_read (GList** list, const gchar* filename)
npw_header_parser_parse (parser, content, len, &err);
header = parser->header;
/* Parse only a part of the file, so need to call parser_end_parse */
-
+
npw_header_parser_free (parser);
g_free (content);
@@ -616,7 +616,7 @@ npw_header_list_read (GList** list, const gchar* filename)
* generated at the end of the project wizard block */
g_warning ("Missing project wizard block in %s", filename);
npw_header_free (header);
-
+
return NULL;
}
if (g_error_matches (err, parser_error_quark (), NPW_STOP_PARSING) == FALSE)
@@ -629,7 +629,7 @@ npw_header_list_read (GList** list, const gchar* filename)
return NULL;
}
g_error_free (err);
-
+
/* Add header to list if template does not already exist*/
found = npw_header_list_find_header (*list, header);
if (found == NULL)
@@ -641,8 +641,8 @@ npw_header_list_read (GList** list, const gchar* filename)
npw_header_free (header);
header = found;
}
-
- return header;
+
+ return header;
}
@@ -689,12 +689,12 @@ get_page_name (const gchar** attributes,
}
static gboolean
-parse_page (NPWPageParser* parser,
+parse_page (NPWPageParser* parser,
const gchar** attributes,
const gchar** values)
{
const gchar *name;
-
+
/* Check page name to avoid duplicated page due to translated version */
name = get_page_name (attributes, values);
if (name == NULL) return FALSE;
@@ -711,7 +711,7 @@ parse_page (NPWPageParser* parser,
if (parser->count == -1)
{
gint lang;
-
+
lang = get_tag_language (attributes, values);
if (npw_page_set_language (parser->page, lang))
@@ -740,7 +740,7 @@ parse_page (NPWPageParser* parser,
values++;
}
}
-
+
return TRUE;
}
else
@@ -800,7 +800,7 @@ parse_property (NPWPageParser* parser,
break;
case NPW_SUMMARY_ATTRIBUTE:
npw_property_set_summary_option (parser->property, parse_boolean_string (*values));
- break;
+ break;
case NPW_MANDATORY_ATTRIBUTE:
npw_property_set_mandatory_option (parser->property, parse_boolean_string (*values));
break;
@@ -818,7 +818,7 @@ parse_property (NPWPageParser* parser,
}
attributes++;
values++;
- }
+ }
parser->property = npw_page_add_property (parser->page, parser->property);
return TRUE;
@@ -832,9 +832,9 @@ parse_item (NPWPageParser* parser,
const gchar* label = NULL;
const gchar* name = NULL;
gint lang;
-
+
lang = get_tag_language (attributes, values);
-
+
while (*attributes != NULL)
{
switch (parse_attribute (*attributes))
@@ -884,7 +884,7 @@ parse_page_start (GMarkupParseContext* context,
{
/* Not inside an unknown element */
tag = parse_tag (name);
-
+
switch (*parser->last)
{
case NPW_NO_TAG:
@@ -934,7 +934,7 @@ parse_page_start (GMarkupParseContext* context,
break;
}
}
-
+
/* Push element */
if (known)
{
@@ -956,7 +956,7 @@ parse_page_end (GMarkupParseContext* context,
GError** error)
{
NPWPageParser* parser = (NPWPageParser*)data;
-
+
if (parser->unknown > 0)
{
/* Pop unknown element */
@@ -1002,7 +1002,7 @@ npw_page_parser_new (NPWPage* page, const gchar* filename, gint count)
parser->previous = NULL;
parser->page = page;
parser->property = NULL;
-
+
parser->ctx = g_markup_parse_context_new (&page_markup_parser, 0, parser, NULL);
g_assert (parser->ctx != NULL);
@@ -1069,7 +1069,7 @@ npw_page_read (NPWPage* page, const gchar* filename, gint count)
return FALSE;
}
- return TRUE;
+ return TRUE;
}
@@ -1127,7 +1127,7 @@ concat_directory (const gchar* path1, const gchar* path2)
if ((ptr[1] == G_DIR_SEPARATOR) || (ptr[1] == '\0')) return NULL;
}
ptr = ptr + 1;
- }
+ }
if ((*path1 == '\0') || (strcmp (path1, ".") == 0) || g_path_is_absolute (path2))
{
@@ -1198,7 +1198,7 @@ parse_directory (NPWFileListParser* parser, NPWFileTag* child, const gchar** att
return;
}
-
+
path = concat_directory (child->source, source);
if (path == NULL)
{
@@ -1212,12 +1212,12 @@ parse_directory (NPWFileListParser* parser, NPWFileTag* child, const gchar** att
g_free (child->source);
child->source = g_strdup (path);
}
- else if (path != child->source)
+ else if (path != child->source)
{
g_free (child->source);
child->source = path;
}
-
+
path = concat_directory (child->destination, destination);
if (path == NULL)
@@ -1232,12 +1232,12 @@ parse_directory (NPWFileListParser* parser, NPWFileTag* child, const gchar** att
g_free (child->destination);
child->destination = g_strdup (path);
}
- else if (path != child->destination)
+ else if (path != child->destination)
{
g_free (child->destination);
child->destination = path;
}
-}
+}
static void
parse_file (NPWFileListParser* parser, NPWFileTag* child, const gchar** attributes, const gchar** values)
@@ -1483,7 +1483,7 @@ npw_file_list_parser_new (const gchar* filename)
/* Use .wiz file path as base source directory */
root->source = g_path_get_dirname (filename);
g_queue_push_head (parser->tag, root);
-
+
parser->list = NULL;
parser->ctx = g_markup_parse_context_new (&file_markup_parser, 0, parser, NULL);
@@ -1496,7 +1496,7 @@ void
npw_file_list_parser_free (NPWFileListParser* parser)
{
g_return_if_fail (parser != NULL);
-
+
g_markup_parse_context_free (parser->ctx);
DEBUG_PRINT("parser free");
g_queue_foreach (parser->tag, (GFunc)npw_file_tag_free, NULL);
@@ -1515,15 +1515,15 @@ GList *
npw_file_list_parser_end_parse (NPWFileListParser* parser, GError** error)
{
GList *list = NULL;
-
+
if (g_markup_parse_context_end_parse (parser->ctx, error))
{
/* Reverse file list */
parser->list = g_list_reverse (parser->list);
-
+
list = parser->list;
}
-
+
return list;
}
@@ -1670,7 +1670,7 @@ parse_action_start (GMarkupParseContext* context, const gchar* name, const gchar
break;
}
}
-
+
/* Push element */
if (known)
{
@@ -1689,7 +1689,7 @@ static void
parse_action_end (GMarkupParseContext* context, const gchar* name, gpointer data, GError** error)
{
NPWActionListParser* parser = (NPWActionListParser*)data;
-
+
if (parser->unknown > 0)
{
/* Pop unknown element */
@@ -1719,7 +1719,7 @@ NPWActionListParser*
npw_action_list_parser_new (void)
{
NPWActionListParser* parser;
-
+
parser = g_new (NPWActionListParser, 1);
parser->type = NPW_ACTION_PARSER;
@@ -1749,7 +1749,7 @@ gboolean
npw_action_list_parser_parse (NPWActionListParser* parser, const gchar* text, gssize len, GError** error)
{
GError* err = NULL;
-
+
g_markup_parse_context_parse (parser->ctx, text, len, &err);
if (err != NULL)
{
@@ -1763,14 +1763,14 @@ GList*
npw_action_list_parser_end_parse (NPWActionListParser* parser, GError** error)
{
GList *list = NULL;
-
+
if (g_markup_parse_context_end_parse (parser->ctx, error))
{
/* Reverse file list */
parser->list = g_list_reverse (parser->list);
-
+
list = parser->list;
}
-
+
return list;
}
diff --git a/plugins/project-wizard/plugin.c b/plugins/project-wizard/plugin.c
index 9b18d0d..7884f61 100644
--- a/plugins/project-wizard/plugin.c
+++ b/plugins/project-wizard/plugin.c
@@ -42,11 +42,11 @@ static void
npw_open_project_template (GFile *destination, GFile *tarfile, gpointer data, GError *error)
{
NPWPlugin *plugin = (NPWPlugin *)data;
-
+
if (error != NULL)
{
gchar *tarname = g_file_get_path (tarfile);
-
+
anjuta_util_dialog_error (GTK_WINDOW (ANJUTA_PLUGIN (plugin)->shell),_("Unable to extract project template %s: %s"), tarname, error->message);
}
else
@@ -66,7 +66,7 @@ npw_install_project_template_with_callback (NPWPlugin *plugin, GFile *file, NPWT
GFile *dest;
gboolean ok;
GError *err = NULL;
-
+
/* Check if tarfile exist */
stream = g_file_read (file, NULL, error);
if (stream == NULL)
@@ -74,12 +74,12 @@ npw_install_project_template_with_callback (NPWPlugin *plugin, GFile *file, NPWT
return FALSE;
}
g_input_stream_close (G_INPUT_STREAM (stream), NULL, NULL);
-
+
/* Get name without extension */
name = g_file_get_basename (file);
ext = strchr (name, '.');
if (ext != NULL) *ext = '\0';
-
+
/* Create a directory for template */
path = g_build_filename (g_get_user_data_dir (), "anjuta", "project", name, NULL);
g_free (name);
@@ -97,21 +97,21 @@ npw_install_project_template_with_callback (NPWPlugin *plugin, GFile *file, NPWT
else
{
g_object_unref (dest);
-
+
return FALSE;
}
}
-
+
ok = npw_tar_extract (dest, file, callback, plugin, error);
g_object_unref (dest);
-
+
return ok;
}
/* Public functions
*---------------------------------------------------------------------------*/
-/* Display the project wizard selection dialog using only templates in the
+/* Display the project wizard selection dialog using only templates in the
* specified directory if non NULL */
gboolean
npw_plugin_show_wizard (NPWPlugin *plugin, GFile *project)
@@ -192,7 +192,7 @@ npw_plugin_deactivate (AnjutaPlugin *plugin)
}
static void
-npw_plugin_class_init (GObjectClass *klass)
+npw_plugin_class_init (GObjectClass *klass)
{
AnjutaPluginClass *plugin_class = ANJUTA_PLUGIN_CLASS (klass);
@@ -255,7 +255,7 @@ ifile_iface_init(IAnjutaFileIface *iface)
iface->open = ifile_open;
iface->get_file = ifile_get_file;
}
-
+
ANJUTA_PLUGIN_BEGIN (NPWPlugin, npw_plugin);
ANJUTA_PLUGIN_ADD_INTERFACE (ifile, IANJUTA_TYPE_FILE);
ANJUTA_PLUGIN_ADD_INTERFACE (iwizard, IANJUTA_TYPE_WIZARD);
@@ -273,7 +273,7 @@ on_message_buffer_flush (IAnjutaMessageView *view, const gchar *line,
npw_plugin_print_view (plugin, IANJUTA_MESSAGE_VIEW_TYPE_NORMAL, line, "");
}
-IAnjutaMessageView*
+IAnjutaMessageView*
npw_plugin_create_view (NPWPlugin* plugin)
{
if (plugin->view == NULL)
diff --git a/plugins/project-wizard/tar.c b/plugins/project-wizard/tar.c
index 148bd88..3602834 100644
--- a/plugins/project-wizard/tar.c
+++ b/plugins/project-wizard/tar.c
@@ -45,7 +45,7 @@ struct _NPWTarPacket
GFile *tarfile;
GFile *destination;
};
-
+
/* Helper functions
*---------------------------------------------------------------------------*/
@@ -59,7 +59,7 @@ npw_tar_packet_free (NPWTarPacket *pack)
if (pack->destination) g_object_unref (pack->destination);
g_free (pack);
}
-
+
/* Public functions
*---------------------------------------------------------------------------*/
@@ -76,19 +76,19 @@ on_tar_listed (GPid pid,
GList *list;
GString *line;
GIOStatus status;
-
+
list = NULL;
line = g_string_new (NULL);
output = g_io_channel_unix_new (pack->stdout);
do
{
gsize terminator;
-
+
status = g_io_channel_read_line_string (output, line, &terminator, NULL);
if (status == G_IO_STATUS_NORMAL)
{
g_string_truncate (line, terminator);
-
+
list = g_list_prepend (list, g_strdup (line->str));
continue;
}
@@ -97,16 +97,16 @@ on_tar_listed (GPid pid,
g_io_channel_shutdown (output, TRUE, NULL);
g_io_channel_unref (output);
g_string_free (line, TRUE);
-
+
list = g_list_reverse (list);
((NPWTarListFunc)pack->callback) (pack->tarfile, list, pack->data, NULL);
-
+
g_list_foreach (list, (GFunc)g_free, NULL);
g_list_free (list);
}
g_spawn_close_pid(pid);
-}
+}
static void
on_tar_completed (GPid pid,
@@ -123,7 +123,7 @@ on_tar_completed (GPid pid,
GIOChannel *stderr;
gchar *message;
gsize length;
-
+
stderr = g_io_channel_unix_new (pack->stderr);
g_io_channel_read_to_end (stderr, &message, &length, &error);
if (error != NULL)
@@ -133,14 +133,14 @@ on_tar_completed (GPid pid,
g_io_channel_shutdown (stderr, TRUE, NULL);
g_io_channel_unref (stderr);
}
-
+
((NPWTarCompleteFunc)pack->callback) (pack->destination, pack->tarfile, pack->data, error);
g_clear_error (&error);
}
g_spawn_close_pid(pid);
}
-
+
/* Public functions
*---------------------------------------------------------------------------*/
@@ -153,7 +153,7 @@ npw_tar_list (GFile *tarfile, NPWTarListFunc list, gpointer data, GError **error
GPid pid;
gboolean ok;
NPWTarPacket *pack;
-
+
/* Use gtar if available */
prog = g_find_program_in_path ("gtar");
filename = g_file_get_path (tarfile);
@@ -164,7 +164,7 @@ npw_tar_list (GFile *tarfile, NPWTarListFunc list, gpointer data, GError **error
pack->callback = (gpointer)list;
pack->data = data;
pack->tarfile = g_object_ref (tarfile);
- ok = g_spawn_async_with_pipes (NULL, argv, NULL,
+ ok = g_spawn_async_with_pipes (NULL, argv, NULL,
G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL,
NULL, NULL,
&pid,
@@ -172,18 +172,18 @@ npw_tar_list (GFile *tarfile, NPWTarListFunc list, gpointer data, GError **error
&pack->stdout,
NULL,
error);
-
+
if (ok)
{
g_child_watch_add_full (G_PRIORITY_HIGH_IDLE, pid, on_tar_listed, pack, (GDestroyNotify)npw_tar_packet_free);
}
-
+
g_free (filename);
g_free (prog);
-
+
return ok;
}
-
+
gboolean
npw_tar_extract (GFile *destination, GFile *tarfile, NPWTarCompleteFunc complete, gpointer data, GError **error)
{
@@ -194,7 +194,7 @@ npw_tar_extract (GFile *destination, GFile *tarfile, NPWTarCompleteFunc complete
GPid pid;
gboolean ok;
NPWTarPacket *pack;
-
+
/* Use gtar if available */
prog = g_find_program_in_path ("gtar");
dirname = g_file_get_path (destination);
@@ -208,7 +208,7 @@ npw_tar_extract (GFile *destination, GFile *tarfile, NPWTarCompleteFunc complete
pack->data = data;
pack->tarfile = g_object_ref (tarfile);
pack->destination = g_object_ref (destination);
- ok = g_spawn_async_with_pipes (NULL, argv, NULL,
+ ok = g_spawn_async_with_pipes (NULL, argv, NULL,
G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH,
NULL, NULL,
&pid,
@@ -216,16 +216,16 @@ npw_tar_extract (GFile *destination, GFile *tarfile, NPWTarCompleteFunc complete
NULL,
&pack->stderr,
error);
-
+
if (ok)
{
g_child_watch_add_full (G_PRIORITY_HIGH_IDLE, pid, on_tar_completed, pack, (GDestroyNotify)npw_tar_packet_free);
}
-
+
g_free (filename);
g_free (dirname);
g_free (prog);
-
+
return ok;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]