[glom] file_utils: Remove unused delete_directory().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] file_utils: Remove unused delete_directory().
- Date: Thu, 17 Mar 2016 14:22:43 +0000 (UTC)
commit 05b88b73a14212a832e6f7877cb6f930b3896cc3
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Mar 17 13:40:38 2016 +0100
file_utils: Remove unused delete_directory().
glom/libglom/file_utils.cc | 46 --------------------------------------------
glom/libglom/file_utils.h | 11 ----------
2 files changed, 0 insertions(+), 57 deletions(-)
---
diff --git a/glom/libglom/file_utils.cc b/glom/libglom/file_utils.cc
index cdcb79c..b4e576d 100644
--- a/glom/libglom/file_utils.cc
+++ b/glom/libglom/file_utils.cc
@@ -57,52 +57,6 @@ bool file_exists(const Glib::RefPtr<Gio::File>& file)
}
}
-bool delete_directory(const Glib::RefPtr<Gio::File>& directory)
-{
- try
- {
- if(!(directory->query_exists()))
- return true;
-
- //(Recursively) Delete any child files and directories,
- //so we can delete this directory.
- auto enumerator = directory->enumerate_children();
-
- auto info = enumerator->next_file();
- while(info)
- {
- auto child = directory->get_child(info->get_name());
- bool removed_child = false;
- if(child->query_file_type() == Gio::FILE_TYPE_DIRECTORY)
- removed_child = delete_directory(child);
- else
- removed_child = child->remove();
-
- if(!removed_child)
- return false;
-
- info = enumerator->next_file();
- }
-
- //Delete the actual directory:
- if(!directory->remove())
- return false;
- }
- catch(const Glib::Error& ex)
- {
- std::cerr << G_STRFUNC << ": Exception from Gio::File: " << ex.what() << std::endl;
- return false;
- }
-
- return true;
-}
-
-bool delete_directory(const std::string& uri)
-{
- auto file = Gio::File::create_for_uri(uri);
- return delete_directory(file);
-}
-
bool delete_file(const std::string& uri)
{
auto file = Gio::File::create_for_uri(uri);
diff --git a/glom/libglom/file_utils.h b/glom/libglom/file_utils.h
index 2f35b28..7894df9 100644
--- a/glom/libglom/file_utils.h
+++ b/glom/libglom/file_utils.h
@@ -37,17 +37,6 @@ bool file_exists(const Glib::RefPtr <Gio::File>& file);
Glib::ustring create_local_image_uri(const Gnome::Gda::Value& value);
-/** Delete a directory, if it exists, and its contents.
- * Unlike g_file_delete(), this does not fail if the directory is not empty.
- */
-bool delete_directory(const Glib::RefPtr<Gio::File>& directory);
-
-/** Delete a directory, if it exists, and its contents.
- * Unlike g_file_delete(), this does not fail if the directory is not empty.
- * See also delete_file().
- */
-bool delete_directory(const std::string& uri);
-
/** Delete a file, if it exists.
* See also delete_directory().
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]