[gnote] Remove boost filesystem from notemanager.cpp



commit bfd13b0237d01c49cc76dae8bc1447115e38035c
Author: Aurimas Ä?ernius <aurisc4 gmail com>
Date:   Sun Apr 17 17:12:02 2011 +0300

    Remove boost filesystem from notemanager.cpp
    
    Remove boost::filesystem from notemanager.cpp by using replacements.

 src/notemanager.cpp |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)
---
diff --git a/src/notemanager.cpp b/src/notemanager.cpp
index 4518ee9..d8c6ec9 100644
--- a/src/notemanager.cpp
+++ b/src/notemanager.cpp
@@ -29,8 +29,6 @@
 
 #include <boost/bind.hpp>
 #include <boost/format.hpp>
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
 
 #include <glib.h>
 #include <glibmm/i18n.h>
@@ -198,8 +196,7 @@ namespace gnote {
   // For overriding in test methods.
   bool NoteManager::directory_exists(const std::string & directory) const
   {
-    boost::filesystem::path p(directory);
-    return exists(p) && is_directory(p);
+    return sharp::directory_exists(directory);
   }
 
   // For overriding in test methods.
@@ -438,21 +435,21 @@ namespace gnote {
 
   void NoteManager::delete_note(const Note::Ptr & note)
   {
-    if (boost::filesystem::exists(note->file_path())) {
+    if (sharp::file_exists(note->file_path())) {
       if (!m_backup_dir.empty()) {
-        if (!boost::filesystem::exists(m_backup_dir)) {
-          boost::filesystem::create_directory(m_backup_dir);
+        if (!sharp::directory_exists(m_backup_dir)) {
+          sharp::directory_create(m_backup_dir);
         }
         std::string backup_path 
           = Glib::build_filename(m_backup_dir, sharp::file_filename(note->file_path()));
-          
-        if (boost::filesystem::exists(backup_path))
-          boost::filesystem::remove(backup_path);
 
-        boost::filesystem::rename(note->file_path(), backup_path);
+        if (sharp::file_exists(backup_path))
+          sharp::file_delete(backup_path);
+
+        sharp::file_move(note->file_path(), backup_path);
       } 
       else {
-        boost::filesystem::remove(note->file_path());
+        sharp::file_delete(note->file_path());
       }
     }
 



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