[latexila/wip/latexila-next: 43/56] Use latexila_utils_get_shortname()



commit 72f617dd170572729852e537233c94c036875a95
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri May 16 23:56:59 2014 +0200

    Use latexila_utils_get_shortname()

 src/clean_build_files.vala       |    2 +-
 src/main_window_build_tools.vala |    2 +-
 src/stock_icons.vala             |    2 +-
 src/synctex.vala                 |    4 ++--
 src/utils.vala                   |    6 ------
 5 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/src/clean_build_files.vala b/src/clean_build_files.vala
index 43eb2b3..55f8f44 100644
--- a/src/clean_build_files.vala
+++ b/src/clean_build_files.vala
@@ -89,7 +89,7 @@ public class CleanBuildFiles : GLib.Object
         string exts = _settings.get_string ("clean-extensions");
         string[] extensions = exts.split (" ");
 
-        string shortname = Utils.get_shortname (location.get_basename ());
+        string shortname = Latexila.utils_get_shortname (location.get_basename ());
 
         Gee.ArrayList<File> files_to_delete = new Gee.ArrayList<File> ();
 
diff --git a/src/main_window_build_tools.vala b/src/main_window_build_tools.vala
index 7468ed0..3b76297 100644
--- a/src/main_window_build_tools.vala
+++ b/src/main_window_build_tools.vala
@@ -431,7 +431,7 @@ public class MainWindowBuildTools
         File mainfile = _main_window.active_document.get_main_file ();
         File directory = mainfile.get_parent ();
 
-        string basename = Utils.get_shortname (mainfile.get_basename ()) + ".log";
+        string basename = Latexila.utils_get_shortname (mainfile.get_basename ()) + ".log";
         File file = directory.get_child (basename);
         DocumentTab? tab = _main_window.open_document (file);
 
diff --git a/src/stock_icons.vala b/src/stock_icons.vala
index f24b5e9..fbf8915 100644
--- a/src/stock_icons.vala
+++ b/src/stock_icons.vala
@@ -83,7 +83,7 @@ public class StockIcons
             icon_source.set_pixbuf (pixbuf);
             icon_set.add_source (icon_source);
 
-            string icon_name = Utils.get_shortname (icon_file);
+            string icon_name = Latexila.utils_get_shortname (icon_file);
             icon_factory.add (icon_name, icon_set);
         }
 
diff --git a/src/synctex.vala b/src/synctex.vala
index 7ed4665..0fa1ede 100644
--- a/src/synctex.vala
+++ b/src/synctex.vala
@@ -92,7 +92,7 @@ public class Synctex : Object
             return;
         }
 
-        string synctex_uri = Utils.get_shortname (pdf_uri) + ".synctex.gz";
+        string synctex_uri = Latexila.utils_get_shortname (pdf_uri) + ".synctex.gz";
         File synctex_file = File.new_for_uri (synctex_uri);
         if (! synctex_file.query_exists ())
         {
@@ -153,7 +153,7 @@ public class Synctex : Object
             return null;
 
         string uri = main_file.get_uri ();
-        return Utils.get_shortname (uri) + ".pdf";
+        return Latexila.utils_get_shortname (uri) + ".pdf";
     }
 
     private EvinceWindow? get_evince_window (string pdf_uri)
diff --git a/src/utils.vala b/src/utils.vala
index b8ac9e3..1b45cf3 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -106,12 +106,6 @@ namespace Utils
         }
     }
 
-    // get filename without extension (without the dot)
-    public string get_shortname (string path)
-    {
-        return path[0:get_extension_pos (path)];
-    }
-
     // get file's extension (with the dot)
     public string get_extension (string path)
     {


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