Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Sun, 14 Oct 2018 18:32:36 UTC Commit: 63f9808599c9203b38062c6af894a3cd3c21a04b https://github.com/geany/geany-plugins/commit/63f9808599c9203b38062c6af894a3...
Log Message: ----------- Eliminate begin/end braces around 1-line blocks to match used code style
Modified Paths: -------------- projectorganizer/src/prjorg-sidebar.c projectorganizer/src/prjorg-utils.c
Modified: projectorganizer/src/prjorg-sidebar.c 24 lines changed, 0 insertions(+), 24 deletions(-) =================================================================== @@ -373,9 +373,7 @@ static gchar* parent_dir_for_create() g_free(path); path = NULL; if (gtk_tree_model_iter_parent(model, &parent, &iter)) - { path = build_path(&parent); - } } } return path; @@ -388,9 +386,7 @@ static void on_create_file(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gp
dir = parent_dir_for_create(); if (dir == NULL) - { return; - }
g_print("Creating file in %s\n", dir);
@@ -411,9 +407,7 @@ static void on_create_file(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gp project_write_config(); } else - { dialogs_show_msgbox(GTK_MESSAGE_ERROR, _("Cannot create new file %s"), path); - } g_free(path); } g_free(dir); @@ -426,9 +420,7 @@ static void on_create_dir(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpo
dir = parent_dir_for_create(); if (dir == NULL) - { return; - }
g_print("Creating dir in %s\n", dir);
@@ -448,9 +440,7 @@ static void on_create_dir(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpo project_write_config(); } else - { dialogs_show_msgbox(GTK_MESSAGE_ERROR, _("Cannot create directory %s"), path); - } g_free(path); } g_free(dir); @@ -468,18 +458,12 @@ static void on_rename(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointe
treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(s_file_view)); if (!gtk_tree_selection_get_selected(treesel, &model, &iter)) - { return; - } if (!gtk_tree_model_iter_parent(model, &parent, &iter)) - { return; - } dir = build_path(&parent); if (dir == NULL) - { return; - }
gtk_tree_model_get(model, &iter, FILEVIEW_COLUMN_NAME, &name, -1); if (name != NULL) @@ -498,10 +482,8 @@ static void on_rename(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointe project_write_config(); } else - { dialogs_show_msgbox(GTK_MESSAGE_ERROR, _("Cannot rename %s to %s"), oldpath, newpath); - } g_free(oldpath); g_free(newpath); g_free(newname); @@ -522,9 +504,7 @@ static void on_delete(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointe
treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(s_file_view)); if (!gtk_tree_selection_get_selected(treesel, &model, &iter)) - { return; - }
gtk_tree_model_get(model, &iter, FILEVIEW_COLUMN_NAME, &name, -1);
@@ -536,13 +516,9 @@ static void on_delete(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointe //TODO: recurse into directories
if (remove_file_or_dir(path)) - { close_file(path); - } else - { dialogs_show_msgbox(GTK_MESSAGE_ERROR, _("Cannot delete file %s"), path); - }
g_free(path);
Modified: projectorganizer/src/prjorg-utils.c 5 lines changed, 0 insertions(+), 5 deletions(-) =================================================================== @@ -129,9 +129,7 @@ gboolean create_file(gchar *utf8_name)
fd = g_open(utf8_name, O_CREAT|O_EXCL, 0660); // rw-rw---- if (fd == -1) // not created? - { return FALSE; - } g_close(fd, &err); return TRUE; } @@ -149,7 +147,6 @@ gboolean remove_file_or_dir(char *utf8_name) }
- static gboolean document_rename(GeanyDocument *document, gchar *utf8_name) { // IMHO: this is wrong. If save as fails Geany's state becomes inconsistent. @@ -167,9 +164,7 @@ gboolean rename_file_or_dir(gchar *utf8_oldname, gchar *utf8_newname)
doc = document_find_by_filename(utf8_oldname); if (doc) - { return document_rename(doc, utf8_newname); - } else { oldname = utils_get_locale_from_utf8(utf8_oldname);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).