[latexila] Have same coding style for logical negation in Vala and C



commit 845bc426aecf7042687a2f40695db722f579f1ad
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Feb 16 18:02:10 2018 +0100

    Have same coding style for logical negation in Vala and C
    
    To make the life easier for contributors (and to myself too). Reduce the
    number of differences between the coding style in Vala and C.
    
    Done with:
    $ sed -i 's/! /!/g' *.vala
    
    I've checked the diff, everything looks fine.

 HACKING                                            |    4 +-
 data/images/generate-symbols/generate_symbols.vala |    4 +-
 src/build_tools_preferences.vala                   |    2 +-
 src/clean_build_files.vala                         |    6 +-
 src/completion.vala                                |   22 +++++-----
 src/dialogs.vala                                   |    4 +-
 src/document.vala                                  |    6 +-
 src/document_structure.vala                        |   46 ++++++++++----------
 src/document_tab.vala                              |   16 +++---
 src/document_view.vala                             |    4 +-
 src/file_browser.vala                              |    8 ++--
 src/finance.vala                                   |    2 +-
 src/latexila_app.vala                              |    2 +-
 src/main_window.vala                               |   10 ++--
 src/main_window_build_tools.vala                   |    6 +-
 src/main_window_documents.vala                     |    2 +-
 src/most_used_symbols.vala                         |   12 +++---
 src/preferences_dialog.vala                        |    4 +-
 src/project_dialogs.vala                           |    4 +-
 src/projects.vala                                  |    4 +-
 src/search.vala                                    |    6 +-
 src/structure.vala                                 |   18 ++++----
 src/structure_model.vala                           |   16 +++---
 src/symbols.vala                                   |    2 +-
 src/symbols_view.vala                              |    2 +-
 src/utils.vala                                     |   10 ++--
 26 files changed, 110 insertions(+), 112 deletions(-)
---
diff --git a/HACKING b/HACKING
index 2f86c91..9b1feae 100644
--- a/HACKING
+++ b/HACKING
@@ -31,7 +31,7 @@ For Vala:
     - Some spaces almost everywhere:
         - function (blah);              // not function(blah);
         - int num = 5;                  // not int num=5;
-        - if (! foo)                    // not if (!foo)
+        - if (!foo)                     // not if(!foo)
         - for (int i = 0; i < max; i++) // not for(int i=0;i<max;i++)
         - etc...
     - Do not use 'var' for declaring variables, unless the type is very long.
@@ -42,8 +42,6 @@ For C:
     - Follow the same coding style as GtkSourceView:
       https://git.gnome.org/browse/gtksourceview/tree/HACKING
     - No maximum line length (but short lines are better).
-    - Spacing differences with Vala:
-       - if (!foo)
     - Note that the GNU coding style was previously used, all the *.c files
       have been converted to the GtkSourceView coding style with the uncrustify
       config file (see the scripts/ directory in the GtkSourceView git
diff --git a/data/images/generate-symbols/generate_symbols.vala 
b/data/images/generate-symbols/generate_symbols.vala
index b4b8c3f..895b23d 100644
--- a/data/images/generate-symbols/generate_symbols.vala
+++ b/data/images/generate-symbols/generate_symbols.vala
@@ -236,14 +236,14 @@ int main (string[] args)
     }
 
     File xml_file = File.new_for_commandline_arg (args[1]);
-    if (! xml_file.query_exists ())
+    if (!xml_file.query_exists ())
     {
         stderr.printf ("'%s' does not exist.\n", args[1]);
         return 1;
     }
 
     File dir = File.new_for_commandline_arg (args[2]);
-    if (! dir.query_exists ())
+    if (!dir.query_exists ())
     {
         stderr.printf ("'%s' does not exist.\n", args[2]);
         return 1;
diff --git a/src/build_tools_preferences.vala b/src/build_tools_preferences.vala
index b480068..894d18c 100644
--- a/src/build_tools_preferences.vala
+++ b/src/build_tools_preferences.vala
@@ -202,7 +202,7 @@ public class BuildToolsPreferences : GLib.Object
             TreeModel model = store as TreeModel;
             model.get (iter, BuildToolColumn.ENABLED, out enabled);
 
-            enabled = ! enabled;
+            enabled = !enabled;
             store.set (iter, BuildToolColumn.ENABLED, enabled);
 
             int num = int.parse (path_string);
diff --git a/src/clean_build_files.vala b/src/clean_build_files.vala
index ab53116..681f3e3 100644
--- a/src/clean_build_files.vala
+++ b/src/clean_build_files.vala
@@ -42,7 +42,7 @@ public class CleanBuildFiles : GLib.Object
 
     public void clean ()
     {
-        if (! _doc.is_main_file_a_tex_file ())
+        if (!_doc.is_main_file_a_tex_file ())
             return;
 
         Gee.ArrayList<File> files_to_delete;
@@ -66,7 +66,7 @@ public class CleanBuildFiles : GLib.Object
 
         if (files_to_delete.size == 0)
         {
-            if (! no_confirm)
+            if (!no_confirm)
                 show_info_no_file ();
             return;
         }
@@ -219,7 +219,7 @@ public class CleanBuildFiles : GLib.Object
             store.get_iter (out iter, path);
             store.get (iter, CleanFileColumn.DELETE, out active);
             // inverse the value
-            store.set (iter, CleanFileColumn.DELETE, ! active);
+            store.set (iter, CleanFileColumn.DELETE, !active);
         });
 
         TreeViewColumn column = new TreeViewColumn.with_attributes ("Delete?",
diff --git a/src/completion.vala b/src/completion.vala
index 866d049..db8f3e7 100644
--- a/src/completion.vala
+++ b/src/completion.vala
@@ -152,7 +152,7 @@ public class CompletionProvider : GLib.Object, SourceCompletionProvider
             return true;
         }
 
-        if (! iter.starts_word ())
+        if (!iter.starts_word ())
             iter.backward_visible_word_start ();
 
         prev = iter;
@@ -203,7 +203,7 @@ public class CompletionProvider : GLib.Object, SourceCompletionProvider
 
     private void populate_command (SourceCompletionContext context, string cmd)
     {
-        if (! is_user_request (context))
+        if (!is_user_request (context))
         {
             uint min_nb_chars;
             _settings.get ("interactive-completion-num", "u", out min_nb_chars);
@@ -227,7 +227,7 @@ public class CompletionProvider : GLib.Object, SourceCompletionProvider
     private void populate_argument (SourceCompletionContext context, ArgumentContext info)
     {
         // invalid argument's command
-        if (! _commands.has_key (info.cmd_name))
+        if (!_commands.has_key (info.cmd_name))
         {
             show_no_proposals (context);
             return;
@@ -537,7 +537,7 @@ public class CompletionProvider : GLib.Object, SourceCompletionProvider
         while (text.get_prev_char (ref index, out cur_char))
         {
             if ((cur_char == '[' || cur_char == '{')
-                && ! Utils.char_is_escaped (text, index))
+                && !Utils.char_is_escaped (text, index))
             {
                 break;
             }
@@ -578,7 +578,7 @@ public class CompletionProvider : GLib.Object, SourceCompletionProvider
             }
 
             // A LaTeX command contains only normal letters and '*'.
-            if (! cur_char.isalpha () && cur_char != '*')
+            if (!cur_char.isalpha () && cur_char != '*')
                 break;
         }
 
@@ -600,12 +600,12 @@ public class CompletionProvider : GLib.Object, SourceCompletionProvider
         while (true)
         {
             unichar cur_char;
-            if (! text.get_prev_char (ref cur_index, out cur_char))
+            if (!text.get_prev_char (ref cur_index, out cur_char))
                 return false;
 
             // End of the argument's contents.
             bool opening_bracket = cur_char == '{' || cur_char == '[';
-            if (opening_bracket && ! Utils.char_is_escaped (text, cur_index))
+            if (opening_bracket && !Utils.char_is_escaped (text, cur_index))
             {
                 info.args_types.insert (0, cur_char == '[');
                 info.arg_contents = text[cur_index + 1 : last_index];
@@ -620,7 +620,7 @@ public class CompletionProvider : GLib.Object, SourceCompletionProvider
         while (true)
         {
             unichar cur_char;
-            if (! text.get_prev_char (ref cur_index, out cur_char))
+            if (!text.get_prev_char (ref cur_index, out cur_char))
                 return false;
 
             // In the contents of a previous argument.
@@ -650,7 +650,7 @@ public class CompletionProvider : GLib.Object, SourceCompletionProvider
             }
 
             // Spaces are allowed between arguments.
-            else if (! cur_char.isspace ())
+            else if (!cur_char.isspace ())
                 return false;
         }
     }
@@ -734,7 +734,7 @@ public class CompletionProvider : GLib.Object, SourceCompletionProvider
                     break;
 
                 // missing non-optional argument
-                else if (! all_args[num].optional)
+                else if (!all_args[num].optional)
                     return -1;
 
                 num++;
@@ -751,7 +751,7 @@ public class CompletionProvider : GLib.Object, SourceCompletionProvider
         string text_to_insert = cmd.name;
         foreach (CompletionArgument arg in cmd.args)
         {
-            if (! arg.optional)
+            if (!arg.optional)
                 text_to_insert += "{}";
         }
         return text_to_insert;
diff --git a/src/dialogs.vala b/src/dialogs.vala
index e9b26bb..f01e14f 100644
--- a/src/dialogs.vala
+++ b/src/dialogs.vala
@@ -106,7 +106,7 @@ namespace Dialogs
             store.get_iter (out iter, path);
             store.get (iter, UnsavedDocColumn.SAVE, out active, -1);
             // inverse the value
-            store.set (iter, UnsavedDocColumn.SAVE, ! active, -1);
+            store.set (iter, UnsavedDocColumn.SAVE, !active, -1);
         });
 
         TreeViewColumn column = new TreeViewColumn.with_attributes ("Save?", renderer1,
@@ -146,7 +146,7 @@ namespace Dialogs
             // close all saved documents
             foreach (Document doc in window.get_documents ())
             {
-                if (! doc.get_modified ())
+                if (!doc.get_modified ())
                     window.close_tab (doc.tab);
             }
 
diff --git a/src/document.vala b/src/document.vala
index b2d8a56..848737f 100644
--- a/src/document.vala
+++ b/src/document.vala
@@ -159,7 +159,7 @@ public class Document : Tepl.Buffer
         return_if_fail (location != null);
 
         // if not modified, don't save
-        if (! force && ! new_file && ! get_modified ())
+        if (!force && !new_file && !get_modified ())
             return;
 
         // we use get_text () to exclude undisplayed text
@@ -175,7 +175,7 @@ public class Document : Tepl.Buffer
         {
             GLib.Settings settings =
                 new GLib.Settings ("org.gnome.gnome-latex.preferences.editor");
-            bool make_backup = ! backup_made
+            bool make_backup = !backup_made
                 && settings.get_boolean ("create-backup-copy");
 
             string? etag = check_file_changed_on_disk ? _etag : null;
@@ -190,7 +190,7 @@ public class Document : Tepl.Buffer
 
             // check if parent directories exist, if not, create it
             File parent = location.get_parent ();
-            if (parent != null && ! parent.query_exists ())
+            if (parent != null && !parent.query_exists ())
                 parent.make_directory_with_parents ();
 
             location.replace_contents (text.data, etag, make_backup,
diff --git a/src/document_structure.vala b/src/document_structure.vala
index 5ea1ac7..63e2dc8 100644
--- a/src/document_structure.vala
+++ b/src/document_structure.vala
@@ -159,7 +159,7 @@ public class DocumentStructure : GLib.Object
                 bool item_found = search_low_level_item (line_text, start_index, out type,
                     out contents, out start_match_index, out end_match_index);
 
-                if (! item_found)
+                if (!item_found)
                     break;
 
                 TextIter iter = line_iter;
@@ -215,13 +215,13 @@ public class DocumentStructure : GLib.Object
         while (match_info.matches ())
         {
             int after_char_index;
-            if (! match_info.fetch_pos (0, out start_match_index, out after_char_index))
+            if (!match_info.fetch_pos (0, out start_match_index, out after_char_index))
             {
                 warning ("Structure parsing: position can not be fetched");
                 return false;
             }
 
-            if (! Utils.char_is_escaped (line, start_match_index))
+            if (!Utils.char_is_escaped (line, start_match_index))
             {
                 string char_matched = match_info.fetch (0);
 
@@ -323,7 +323,7 @@ public class DocumentStructure : GLib.Object
             return true;
         }
 
-        if (contents == "document" && ! is_begin_env)
+        if (contents == "document" && !is_begin_env)
         {
             type = StructType.END_DOCUMENT;
             return true;
@@ -342,7 +342,7 @@ public class DocumentStructure : GLib.Object
         string after_backslash_text = line.substring (after_backslash_index);
 
         MatchInfo match_info;
-        if (! _command_name_regex.match (after_backslash_text, 0, out match_info))
+        if (!_command_name_regex.match (after_backslash_text, 0, out match_info))
             return null;
 
         int pos;
@@ -375,14 +375,14 @@ public class DocumentStructure : GLib.Object
         {
             int next_index = cur_index;
             unichar cur_char;
-            bool end = ! line.get_next_char (ref next_index, out cur_char);
+            bool end = !line.get_next_char (ref next_index, out cur_char);
 
             if (in_optional_arg)
             {
                 switch (cur_char)
                 {
                     case ']':
-                        if (! Utils.char_is_escaped (line, cur_index))
+                        if (!Utils.char_is_escaped (line, cur_index))
                         {
                             if (0 < additional_bracket_level)
                                 additional_bracket_level--;
@@ -392,7 +392,7 @@ public class DocumentStructure : GLib.Object
                         break;
 
                     case '[':
-                        if (! Utils.char_is_escaped (line, cur_index))
+                        if (!Utils.char_is_escaped (line, cur_index))
                             additional_bracket_level++;
                         break;
                 }
@@ -440,12 +440,12 @@ public class DocumentStructure : GLib.Object
         {
             int next_index = cur_index;
             unichar cur_char;
-            bool end = ! line.get_next_char (ref next_index, out cur_char);
+            bool end = !line.get_next_char (ref next_index, out cur_char);
 
-            if (cur_char == '{' && ! Utils.char_is_escaped (line, cur_index))
+            if (cur_char == '{' && !Utils.char_is_escaped (line, cur_index))
                 brace_level++;
 
-            else if (cur_char == '}' && ! Utils.char_is_escaped (line, cur_index))
+            else if (cur_char == '}' && !Utils.char_is_escaped (line, cur_index))
             {
                 if (brace_level > 0)
                     brace_level--;
@@ -482,7 +482,7 @@ public class DocumentStructure : GLib.Object
         string text_after = line.substring (after_percent_index).strip ();
 
         MatchInfo match_info;
-        if (! _comment_regex.match (text_after, 0, out match_info))
+        if (!_comment_regex.match (text_after, 0, out match_info))
             return false;
 
         string type_str = match_info.fetch_named ("type");
@@ -683,7 +683,7 @@ public class DocumentStructure : GLib.Object
         begin_line.set_line_offset (0);
 
         TextIter end_line = iter;
-        if (! iter.ends_line ())
+        if (!iter.ends_line ())
             end_line.forward_to_line_end ();
 
         TextBuffer buffer = iter.get_buffer ();
@@ -702,7 +702,7 @@ public class DocumentStructure : GLib.Object
 
         if (action_type == StructAction.COMMENT)
         {
-            if (! comment_item (tree_iter))
+            if (!comment_item (tree_iter))
                 throw new StructError.DATA_OUTDATED ("");
 
             _model.delete (tree_iter);
@@ -724,7 +724,7 @@ public class DocumentStructure : GLib.Object
             bool success = shift_item (tree_iter, shift_right, out doc_modified);
             _doc.end_user_action ();
 
-            if (! success)
+            if (!success)
             {
                 if (doc_modified)
                     _doc.undo ();
@@ -745,7 +745,7 @@ public class DocumentStructure : GLib.Object
         TextIter end_iter;
         bool found = get_exact_item_bounds (tree_iter, out start_iter, out end_iter);
 
-        if (! found)
+        if (!found)
             throw new StructError.DATA_OUTDATED ("");
 
         if (start_iter.get_line () != end_iter.get_line ())
@@ -804,7 +804,7 @@ public class DocumentStructure : GLib.Object
         }
 
         /* comment a simple item */
-        if (! Structure.is_section (type))
+        if (!Structure.is_section (type))
         {
             _doc.comment_between (start_iter, end_iter, end_iter_set);
             return true;
@@ -832,7 +832,7 @@ public class DocumentStructure : GLib.Object
             bool end_of_file;
             end_iter = get_end_document_iter (out end_of_file);
             end_iter_set = true;
-            go_one_line_backward = ! end_of_file;
+            go_one_line_backward = !end_of_file;
         }
 
         else
@@ -847,7 +847,7 @@ public class DocumentStructure : GLib.Object
 
         if (go_one_line_backward)
         {
-            if (! end_iter.backward_line ())
+            if (!end_iter.backward_line ())
                 end_iter_set = false;
         }
 
@@ -880,7 +880,7 @@ public class DocumentStructure : GLib.Object
         bool found = get_low_level_item_bounds (item_type, item_contents, start_iter,
             true, out end_iter);
 
-        if (! found)
+        if (!found)
             return false;
 
         /* search 'end_iter' */
@@ -951,7 +951,7 @@ public class DocumentStructure : GLib.Object
             out contents, out start_match_index, out end_match_index);
 
         // If an item is found, it should be located at exactly the same place.
-        if (! found || start_index != start_match_index)
+        if (!found || start_index != start_match_index)
             return false;
 
         if (contents == null)
@@ -1050,7 +1050,7 @@ public class DocumentStructure : GLib.Object
         else
             return_val_if_fail (type != StructType.PART, false);
 
-        if (! Structure.is_section (type))
+        if (!Structure.is_section (type))
             return true;
 
         /* Get the markup name, do some checks, etc. */
@@ -1113,7 +1113,7 @@ public class DocumentStructure : GLib.Object
                 child_num);
             return_val_if_fail (child_iter_set, false);
 
-            if (! shift_item (child_iter, shift_right))
+            if (!shift_item (child_iter, shift_right))
                 return false;
         }
 
diff --git a/src/document_tab.vala b/src/document_tab.vala
index d16f2ab..f37ef3c 100644
--- a/src/document_tab.vala
+++ b/src/document_tab.vala
@@ -52,13 +52,13 @@ public class DocumentTab : Tepl.Tab
 
             _auto_save_interval = value;
 
-            if (! _auto_save)
+            if (!_auto_save)
                 return;
 
             if (auto_save_timeout > 0)
             {
                 return_if_fail (document.location != null);
-                return_if_fail (! document.readonly);
+                return_if_fail (!document.readonly);
                 remove_auto_save_timeout ();
                 install_auto_save_timeout ();
             }
@@ -81,19 +81,19 @@ public class DocumentTab : Tepl.Tab
             _auto_save = value;
 
             if (_auto_save && auto_save_timeout <= 0 && document.location != null
-                && ! document.readonly)
+                && !document.readonly)
             {
                 install_auto_save_timeout ();
                 return;
             }
 
-            if (! _auto_save && auto_save_timeout > 0)
+            if (!_auto_save && auto_save_timeout > 0)
             {
                 remove_auto_save_timeout ();
                 return;
             }
 
-            return_if_fail ((! _auto_save && auto_save_timeout <= 0)
+            return_if_fail ((!_auto_save && auto_save_timeout <= 0)
                 || document.location == null || document.readonly);
         }
     }
@@ -156,7 +156,7 @@ public class DocumentTab : Tepl.Tab
             return false;
 
         // if file was never saved or is remote we do not check
-        if (! get_buffer ().get_file ().is_local ())
+        if (!get_buffer ().get_file ().is_local ())
             return false;
 
         if (document.is_externally_modified ())
@@ -208,7 +208,7 @@ public class DocumentTab : Tepl.Tab
     {
         return_val_if_fail (auto_save_timeout <= 0, false);
 
-        if (auto_save && document.location != null && ! document.readonly)
+        if (auto_save && document.location != null && !document.readonly)
         {
             install_auto_save_timeout ();
             return true;
@@ -228,7 +228,7 @@ public class DocumentTab : Tepl.Tab
     private bool on_auto_save ()
     {
         return_val_if_fail (document.location != null, false);
-        return_val_if_fail (! document.readonly, false);
+        return_val_if_fail (!document.readonly, false);
         return_val_if_fail (auto_save_timeout > 0, false);
         return_val_if_fail (auto_save, false);
         return_val_if_fail (auto_save_interval > 0, false);
diff --git a/src/document_view.vala b/src/document_view.vala
index 466ea36..f640527 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -39,7 +39,7 @@ public class DocumentView : Tepl.View
 
         doc.notify["readonly"].connect ((d, p) =>
         {
-            this.editable = ! ((Document) d).readonly;
+            this.editable = !((Document) d).readonly;
         });
 
         wrap_mode = WrapMode.WORD;
@@ -289,7 +289,7 @@ public class DocumentView : Tepl.View
     {
         Gspell.TextView gspell_view =
             Gspell.TextView.get_from_gtk_text_view (this as TextView);
-        if (! gspell_view.inline_spell_checking)
+        if (!gspell_view.inline_spell_checking)
             return;
 
         Gspell.Checker? spell_checker = get_spell_checker ();
diff --git a/src/file_browser.vala b/src/file_browser.vala
index 82896e6..9faabb2 100644
--- a/src/file_browser.vala
+++ b/src/file_browser.vala
@@ -158,7 +158,7 @@ public class FileBrowser : Grid
         {
             TreeModel model = _list_store as TreeModel;
             TreeIter iter;
-            if (! model.get_iter (out iter, path))
+            if (!model.get_iter (out iter, path))
                 return;
 
             string basename;
@@ -477,7 +477,7 @@ public class FileBrowser : Grid
                 break;
 
             string basename = info.get_display_name ();
-            if (basename[0] == '.' && ! show_hidden_files)
+            if (basename[0] == '.' && !show_hidden_files)
                 continue;
 
             FileType type = info.get_file_type ();
@@ -487,7 +487,7 @@ public class FileBrowser : Grid
                 continue;
             }
 
-            if (! show_build_files)
+            if (!show_build_files)
             {
                 bool is_build_file = false;
 
@@ -603,7 +603,7 @@ public class FileBrowser : Grid
 
     private void set_directory (File directory, bool force = false)
     {
-        if (! force && _current_directory == directory)
+        if (!force && _current_directory == directory)
             return;
 
         _current_directory = directory;
diff --git a/src/finance.vala b/src/finance.vala
index 1884e0e..03bd9d7 100644
--- a/src/finance.vala
+++ b/src/finance.vala
@@ -23,7 +23,7 @@ namespace Finance
 {
     public void show_dialog (Window parent_window, bool startup)
     {
-        if (startup && ! should_show_dialog_on_startup ())
+        if (startup && !should_show_dialog_on_startup ())
             return;
 
         string title;
diff --git a/src/latexila_app.vala b/src/latexila_app.vala
index 5812db5..3ad2d6d 100644
--- a/src/latexila_app.vala
+++ b/src/latexila_app.vala
@@ -374,7 +374,7 @@ public class LatexilaApp : Gtk.Application
         synctex.backward_search.connect ((tex_uri, line, timestamp) =>
         {
             File tex_file = File.new_for_uri (tex_uri);
-            if (! tex_file.query_exists ())
+            if (!tex_file.query_exists ())
             {
                 warning (@"Backward search: the file \"$tex_uri\" doesn't exist.");
                 return;
diff --git a/src/main_window.vala b/src/main_window.vala
index 5ee1777..c010510 100644
--- a/src/main_window.vala
+++ b/src/main_window.vala
@@ -628,14 +628,14 @@ public class MainWindow : ApplicationWindow
         /* check if the document is already opened */
         foreach (Window window in LatexilaApp.get_instance ().get_windows ())
         {
-            if (! (window is MainWindow))
+            if (!(window is MainWindow))
                 continue;
 
             MainWindow w = window as MainWindow;
 
             foreach (Document doc in w.get_documents ())
             {
-                if (doc.location == null || ! location.equal (doc.location))
+                if (doc.location == null || !location.equal (doc.location))
                     continue;
 
                 /* the document is already opened in this window */
@@ -735,7 +735,7 @@ public class MainWindow : ApplicationWindow
         _main_window_edit.update_sensitivity ();
         _main_window_tools.update_sensitivity ();
 
-        if (! this.get_visible ())
+        if (!this.get_visible ())
             this.present ();
 
         return tab;
@@ -747,7 +747,7 @@ public class MainWindow : ApplicationWindow
         /* If document not saved
          * Ask the user if he wants to save the file, or close without saving, or cancel
          */
-        if (! force_close && tab.get_buffer ().get_modified ())
+        if (!force_close && tab.get_buffer ().get_modified ())
         {
             Dialog dialog = new MessageDialog (this,
                 DialogFlags.DESTROY_WITH_PARENT,
@@ -802,7 +802,7 @@ public class MainWindow : ApplicationWindow
     // return true if the document has been saved
     public bool save_document (Document doc, bool force_save_as)
     {
-        if (! force_save_as && doc.location != null)
+        if (!force_save_as && doc.location != null)
         {
             doc.save ();
 
diff --git a/src/main_window_build_tools.vala b/src/main_window_build_tools.vala
index 1bd7920..c723b00 100644
--- a/src/main_window_build_tools.vala
+++ b/src/main_window_build_tools.vala
@@ -133,7 +133,7 @@ public class MainWindowBuildTools
             as GLib.SimpleAction;
 
         // a build tool can not be modified when it is running
-        preferences_action.set_enabled (! build_tool_is_running);
+        preferences_action.set_enabled (!build_tool_is_running);
 
         Gtk.Action clean_action = _static_action_group.get_action ("BuildClean");
         Gtk.Action view_log_action = _static_action_group.get_action ("BuildViewLog");
@@ -214,7 +214,7 @@ public class MainWindowBuildTools
     private void update_build_tool_sensitivity (Latexila.BuildTool tool,
         string action_name)
     {
-        if (! tool.enabled)
+        if (!tool.enabled)
             return;
 
         Gtk.Action action = _dynamic_action_group.get_action (action_name);
@@ -315,7 +315,7 @@ public class MainWindowBuildTools
     private void add_dynamic_action (Latexila.BuildTool build_tool, string action_name,
         ref int accel_num)
     {
-        if (! build_tool.enabled)
+        if (!build_tool.enabled)
             return;
 
         Gtk.Action action = new Gtk.Action (action_name, build_tool.label,
diff --git a/src/main_window_documents.vala b/src/main_window_documents.vala
index 686e06c..5f38a98 100644
--- a/src/main_window_documents.vala
+++ b/src/main_window_documents.vala
@@ -193,7 +193,7 @@ public class MainWindowDocuments
         return_if_fail (_documents_panel != null);
 
         RadioAction radio_action = action as RadioAction;
-        if (! radio_action.get_active ())
+        if (!radio_action.get_active ())
             return;
 
         _documents_panel.set_current_page (radio_action.get_current_value ());
diff --git a/src/most_used_symbols.vala b/src/most_used_symbols.vala
index 16b932c..48c5081 100644
--- a/src/most_used_symbols.vala
+++ b/src/most_used_symbols.vala
@@ -72,7 +72,7 @@ public class MostUsedSymbols : GLib.Object
     {
         TreeIter iter;
 
-        if (! get_iter_at_symbol_id (id, out iter))
+        if (!get_iter_at_symbol_id (id, out iter))
             add_symbol (id, 1);
         else
         {
@@ -88,7 +88,7 @@ public class MostUsedSymbols : GLib.Object
 
     private bool get_iter_at_symbol_id (string id, out TreeIter iter)
     {
-        if (! _store.get_iter_first (out iter))
+        if (!_store.get_iter_first (out iter))
             return false;
 
         do
@@ -113,7 +113,7 @@ public class MostUsedSymbols : GLib.Object
 
         string command;
         string tooltip;
-        if (! Symbols.get_default ().get_symbol_info (id, out command, out tooltip))
+        if (!Symbols.get_default ().get_symbol_info (id, out command, out tooltip))
             return;
 
         TreeIter iter;
@@ -138,7 +138,7 @@ public class MostUsedSymbols : GLib.Object
     private void load_data ()
     {
         File file = get_xml_file ();
-        if (! file.query_exists ())
+        if (!file.query_exists ())
             return;
 
         string? contents = Utils.load_file (file);
@@ -203,7 +203,7 @@ public class MostUsedSymbols : GLib.Object
 
     public void save ()
     {
-        if (! _modified)
+        if (!_modified)
             return;
 
         _modified = false;
@@ -211,7 +211,7 @@ public class MostUsedSymbols : GLib.Object
         File file = get_xml_file ();
 
         TreeIter iter;
-        bool is_empty = ! _store.get_iter_first (out iter);
+        bool is_empty = !_store.get_iter_first (out iter);
 
         if (is_empty)
         {
diff --git a/src/preferences_dialog.vala b/src/preferences_dialog.vala
index b80cc25..da2ff7e 100644
--- a/src/preferences_dialog.vala
+++ b/src/preferences_dialog.vala
@@ -329,12 +329,12 @@ public class PreferencesDialog : Dialog
         bool must_be_enabled = true)
     {
         bool val = settings.get_boolean (key);
-        widget.set_sensitive (must_be_enabled ? val : ! val);
+        widget.set_sensitive (must_be_enabled ? val : !val);
 
         settings.changed[key].connect ((setting, k) =>
         {
             bool v = setting.get_boolean (k);
-            widget.set_sensitive (must_be_enabled ? v : ! v);
+            widget.set_sensitive (must_be_enabled ? v : !v);
         });
     }
 
diff --git a/src/project_dialogs.vala b/src/project_dialogs.vala
index 3d4f531..eefcdbb 100644
--- a/src/project_dialogs.vala
+++ b/src/project_dialogs.vala
@@ -82,7 +82,7 @@ namespace ProjectDialogs
                 continue;
 
             // main file not in directory
-            if (! main_file_is_in_directory (dialog, main_file, directory))
+            if (!main_file_is_in_directory (dialog, main_file, directory))
                 continue;
 
             // try to add the project
@@ -162,7 +162,7 @@ namespace ProjectDialogs
                 continue;
 
             // main file not in directory
-            if (! main_file_is_in_directory (dialog, main_file, project.directory))
+            if (!main_file_is_in_directory (dialog, main_file, project.directory))
                 continue;
 
             ret = Projects.get_default ().change_main_file (project_id, main_file);
diff --git a/src/projects.vala b/src/projects.vala
index 541c271..b1010b3 100644
--- a/src/projects.vala
+++ b/src/projects.vala
@@ -38,7 +38,7 @@ public class Projects
 
         /* load projects from the XML file */
         File file = get_xml_file ();
-        if (! file.query_exists ())
+        if (!file.query_exists ())
             return;
 
         string? contents = Utils.load_file (file);
@@ -240,7 +240,7 @@ public class Projects
 
     public void save ()
     {
-        if (! modified)
+        if (!modified)
             return;
 
         File file = get_xml_file ();
diff --git a/src/search.vala b/src/search.vala
index 8b29852..ab346d4 100644
--- a/src/search.vala
+++ b/src/search.vala
@@ -75,7 +75,7 @@ public class GotoLine : Grid
         for (int i = 0; i < text.length; i++)
         {
             unichar c = text[i];
-            if (! c.isdigit ())
+            if (!c.isdigit ())
             {
                 ErrorEntry.add_error (entry);
                 return;
@@ -435,7 +435,7 @@ public class SearchAndReplace : GLib.Object
         });
 
         bool readonly = _main_window.active_document.readonly;
-        _replace_grid.set_sensitive (! readonly);
+        _replace_grid.set_sensitive (!readonly);
 
         doc.mark_set.connect (mark_set_cb);
     }
@@ -526,7 +526,7 @@ public class SearchAndReplace : GLib.Object
 
         try
         {
-            if (! _search_context.replace (match_start, match_end,
+            if (!_search_context.replace (match_start, match_end,
                 _entry_replace.text, -1))
                 search_forward ();
         }
diff --git a/src/structure.vala b/src/structure.vala
index 3ba00ec..b81dc18 100644
--- a/src/structure.vala
+++ b/src/structure.vala
@@ -209,9 +209,9 @@ public class Structure : Grid
 
         button.clicked.connect (() =>
         {
-            if (! button.get_active ())
+            if (!button.get_active ())
             {
-                if (! _list_is_hidden && type == _current_list_type)
+                if (!_list_is_hidden && type == _current_list_type)
                 {
                     _list_is_hidden = true;
                     _list_view_sw.hide ();
@@ -256,7 +256,7 @@ public class Structure : Grid
 
         TreePath tree_path = selected_rows.nth_data (0);
         TreeIter tree_iter;
-        if (! _model.get_iter (out tree_iter, tree_path))
+        if (!_model.get_iter (out tree_iter, tree_path))
             return_if_reached ();
 
         select_simple_list_item (tree_iter);
@@ -390,7 +390,7 @@ public class Structure : Grid
 
     private bool select_list_row (TreePath list_path)
     {
-        if (! _first_select)
+        if (!_first_select)
         {
             _first_select = true;
             return true;
@@ -428,7 +428,7 @@ public class Structure : Grid
         _first_select = true;
 
         TreeIter tree_iter;
-        if (! _model.get_iter (out tree_iter, tree_path))
+        if (!_model.get_iter (out tree_iter, tree_path))
             return_val_if_reached (false);
 
         TextMark mark;
@@ -453,7 +453,7 @@ public class Structure : Grid
         item_selected (type);
 
         /* select the corresponding item in the simple list */
-        if (! first_select)
+        if (!first_select)
             return true;
 
         select_simple_list_item (tree_iter);
@@ -478,7 +478,7 @@ public class Structure : Grid
         Gee.ArrayList<StructType> current_list_types =
             get_simple_list_types (_current_list_type);
 
-        if (! current_list_types.contains (type))
+        if (!current_list_types.contains (type))
             return;
 
         int row_num = _model.get_list_num_from_tree_iter (tree_iter);
@@ -498,7 +498,7 @@ public class Structure : Grid
     // For example, the list of TODOs and FIXMEs.
     private Gee.ArrayList<StructType> get_simple_list_types (StructType type)
     {
-        return_val_if_fail (! is_section (type), null);
+        return_val_if_fail (!is_section (type), null);
 
         Gee.ArrayList<StructType> types = new Gee.ArrayList<StructType> ();
 
@@ -698,7 +698,7 @@ public class Structure : Grid
             string uri = referenced_file.get_uri ();
             file_to_open = File.new_for_uri (uri + ".tex");
 
-            if (! file_to_open.query_exists ())
+            if (!file_to_open.query_exists ())
             {
                 warning ("Structure: the file '%s' doesn't exist.",
                     file_to_open.get_parse_name ());
diff --git a/src/structure_model.vala b/src/structure_model.vala
index 035be66..790894f 100644
--- a/src/structure_model.vala
+++ b/src/structure_model.vala
@@ -186,7 +186,7 @@ public class StructureModel : TreeModel, GLib.Object
         return_val_if_fail (iter_is_valid (iter), false);
 
         unowned Node<StructData?> node = get_node_from_iter (iter);
-        return ! node.is_leaf ();
+        return !node.is_leaf ();
     }
 
     public int iter_n_children (TreeIter? iter)
@@ -348,7 +348,7 @@ public class StructureModel : TreeModel, GLib.Object
         TreePath path = new TreePath ();
         unowned Node<StructData?> node = get_node_from_iter (iter);
 
-        while (! node.is_root ())
+        while (!node.is_root ())
         {
             int pos = node.parent.child_position (node);
             path.prepend_index (pos);
@@ -411,12 +411,12 @@ public class StructureModel : TreeModel, GLib.Object
     // the section. If null is returned, the end of the section is the end of the doc.
     public TreeIter? get_next_sibling_or_parent (TreeIter section_iter) throws StructError
     {
-        if (! iter_is_valid (section_iter))
+        if (!iter_is_valid (section_iter))
             throw new StructError.GENERAL ("iter is not valid.");
 
         unowned Node<StructData?> cur_node = get_node_from_iter (section_iter);
 
-        if (! Structure.is_section (cur_node.data.type))
+        if (!Structure.is_section (cur_node.data.type))
             throw new StructError.GENERAL ("iter is not a section.");
 
         while (cur_node != null && cur_node != _tree)
@@ -562,7 +562,7 @@ public class StructureModel : TreeModel, GLib.Object
         if (type == StructType.SUBPARAGRAPH)
             return true;
 
-        if (! Structure.is_section (type))
+        if (!Structure.is_section (type))
             return false;
 
         unowned Node<StructData?>? child = node.first_child ();
@@ -581,7 +581,7 @@ public class StructureModel : TreeModel, GLib.Object
         new_stamp ();
         _nb_nodes++;
 
-        if (! emit_signals)
+        if (!emit_signals)
             return;
 
         TreeIter item_iter = create_iter_at_node (node);
@@ -635,7 +635,7 @@ public class StructureModel : TreeModel, GLib.Object
 
     private void shift_node (Node<StructData?> node, bool shift_right)
     {
-        if (! Structure.is_section (node.data.type))
+        if (!Structure.is_section (node.data.type))
             return;
 
         if (shift_right)
@@ -715,7 +715,7 @@ public class StructureModel : TreeModel, GLib.Object
     private void search_end_node ()
     {
         _end_node = _tree;
-        while (! _end_node.is_leaf ())
+        while (!_end_node.is_leaf ())
             _end_node = _end_node.last_child ();
     }
 
diff --git a/src/symbols.vala b/src/symbols.vala
index 35344d8..437b40f 100644
--- a/src/symbols.vala
+++ b/src/symbols.vala
@@ -226,7 +226,7 @@ private class NormalSymbols : Gtk.ListStore
         command = null;
         package = null;
 
-        if (! _data.has_key (icon_file))
+        if (!_data.has_key (icon_file))
             return false;
 
         SymbolInfo info = _data[icon_file];
diff --git a/src/symbols_view.vala b/src/symbols_view.vala
index 532148f..111a7c1 100644
--- a/src/symbols_view.vala
+++ b/src/symbols_view.vala
@@ -80,7 +80,7 @@ public class SymbolsView : Grid
         {
             TreeIter iter = {};
 
-            if (! _combo_box.get_active_iter (out iter))
+            if (!_combo_box.get_active_iter (out iter))
                 return;
 
             Gtk.ListStore store;
diff --git a/src/utils.vala b/src/utils.vala
index aec19e4..67a842b 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -46,7 +46,7 @@ namespace Utils
             if (cur_char != '\\')
                 break;
 
-            escaped = ! escaped;
+            escaped = !escaped;
         }
 
         return escaped;
@@ -108,7 +108,7 @@ namespace Utils
 
     public void delete_file (File file)
     {
-        if (! file.query_exists ())
+        if (!file.query_exists ())
             return;
 
         try
@@ -179,13 +179,13 @@ namespace Utils
         List<File> target_dirs = new List<File> ();
         List<File> origin_dirs = new List<File> ();
 
-        while (target_parent != null && ! target_parent.equal (common_dir))
+        while (target_parent != null && !target_parent.equal (common_dir))
         {
             target_dirs.prepend (target_parent);
             target_parent = target_parent.get_parent ();
         }
 
-        while (origin_dir != null && ! origin_dir.equal (common_dir))
+        while (origin_dir != null && !origin_dir.equal (common_dir))
         {
             origin_dirs.prepend (origin_dir);
             origin_dir = origin_dir.get_parent ();
@@ -197,7 +197,7 @@ namespace Utils
         {
             File cur_target_dir = target_dirs.nth_data (dir_index);
             File cur_origin_dir = origin_dirs.nth_data (dir_index);
-            if (! cur_target_dir.equal (cur_origin_dir))
+            if (!cur_target_dir.equal (cur_origin_dir))
                 break;
 
             dir_index++;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]