[glom] FileUtils: Remove unused get_directory_child_with_suffix().



commit cd535259e08fbb295a32875a324754ce9346f8eb
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Apr 15 22:00:16 2016 +0200

    FileUtils: Remove unused get_directory_child_with_suffix().

 glom/libglom/file_utils.cc |   34 ----------------------------------
 1 files changed, 0 insertions(+), 34 deletions(-)
---
diff --git a/glom/libglom/file_utils.cc b/glom/libglom/file_utils.cc
index a05bb71..7417a07 100644
--- a/glom/libglom/file_utils.cc
+++ b/glom/libglom/file_utils.cc
@@ -80,40 +80,6 @@ bool delete_file(const std::string& uri)
   return true;
 }
 
-/** For instance, to find the first file in the directory with a .glom extension.
- */
-static Glib::ustring get_directory_child_with_suffix(const Glib::ustring& uri_directory, const std::string& 
suffix, bool recursive)
-{
-  auto directory = Gio::File::create_for_uri(uri_directory);
-  auto enumerator = directory->enumerate_children();
-
-  auto info = enumerator->next_file();
-  while(info)
-  {
-    Glib::RefPtr<const Gio::File> child = directory->get_child(info->get_name());
-
-    const Gio::FileType file_type = child->query_file_type();
-    if(file_type == Gio::FILE_TYPE_REGULAR)
-    {
-      //Check the filename:
-      const auto basename = child->get_basename();
-      if(Utils::string_remove_suffix(basename, suffix) != basename)
-        return child->get_uri();
-    }
-    else if(recursive && file_type == Gio::FILE_TYPE_DIRECTORY)
-    {
-      //Look in sub-directories too:
-      const Glib::ustring result = get_directory_child_with_suffix(child->get_uri(), suffix, recursive);
-      if(!result.empty())
-        return result;
-    }
-
-    info = enumerator->next_file();
-  }
-
-  return Glib::ustring();
-}
-
 Glib::ustring get_file_uri_without_extension(const Glib::ustring& uri)
 {
   if(uri.empty())


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