[gnote] Use file_read_all_text in FileSystemSyncServer



commit 462cc9e6d2da0b3e0cd6dcda94abea43f5a69b9f
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Thu Feb 16 12:03:19 2017 +0200

    Use file_read_all_text in FileSystemSyncServer

 src/synchronization/filesystemsyncserver.cpp |   15 +--------------
 1 files changed, 1 insertions(+), 14 deletions(-)
---
diff --git a/src/synchronization/filesystemsyncserver.cpp b/src/synchronization/filesystemsyncserver.cpp
index b60b144..504ef56 100644
--- a/src/synchronization/filesystemsyncserver.cpp
+++ b/src/synchronization/filesystemsyncserver.cpp
@@ -19,7 +19,6 @@
 
 
 #include <algorithm>
-#include <fstream>
 #include <stdexcept>
 
 #include <glibmm/i18n.h>
@@ -168,19 +167,7 @@ std::map<Glib::ustring, NoteUpdate> FileSystemSyncServer::get_note_updates_since
 
         // Get the title, contents, etc.
         Glib::ustring noteTitle;
-        Glib::ustring noteXml;
-        std::ifstream fin(noteTempPath.c_str());
-        if(fin.is_open()) {
-          do {
-            std::string line;
-            std::getline(fin, line);
-            if(!fin.eof()) {
-              noteXml += line + "\n";
-            }
-          }
-          while(!fin.eof());
-          fin.close();
-        }
+        Glib::ustring noteXml = sharp::file_read_all_text(noteTempPath);
         NoteUpdate update(noteXml, noteTitle, note_id, rev);
         noteUpdates.insert(std::make_pair(note_id, update));
       }


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