]> git.lyx.org Git - lyx.git/blobdiff - src/bufferlist.C
Get rid of FileInfo::getNumberofLinks().
[lyx.git] / src / bufferlist.C
index b5d1bc9cc8207d108e0efc4b261d2c8bed7611fc..47c45028774724df68e408dc2fa868f6f082793f 100644 (file)
@@ -27,7 +27,7 @@
 #include "frontends/Alert.h"
 
 #include "support/filetools.h"
-#include "support/lyxfunctional.h"
+#include "support/os.h"
 
 #include <boost/bind.hpp>
 
@@ -47,6 +47,7 @@ using boost::bind;
 
 using std::auto_ptr;
 using std::endl;
+using std::equal_to;
 using std::find;
 using std::find_if;
 using std::for_each;
@@ -55,6 +56,7 @@ using std::vector;
 using std::back_inserter;
 using std::transform;
 
+namespace os = lyx::support::os;
 
 BufferList::BufferList()
 {}
@@ -309,7 +311,7 @@ void BufferList::emergencyWrite(Buffer * buf)
        }
 
        // 2) In HOME directory.
-       string s = AddName(GetEnvPath("HOME"), buf->fileName());
+       string s = AddName(os::homepath(), buf->fileName());
        s += ".emergency";
        lyxerr << ' ' << s << endl;
        if (buf->writeFile(s)) {
@@ -338,7 +340,9 @@ void BufferList::emergencyWrite(Buffer * buf)
 bool BufferList::exists(string const & s) const
 {
        return find_if(bstore.begin(), bstore.end(),
-                      lyx::compare_memfun(&Buffer::fileName, s))
+                      bind(equal_to<string>(),
+                           bind(&Buffer::fileName, _1),
+                           s))
                != bstore.end();
 }
 
@@ -356,7 +360,10 @@ Buffer * BufferList::getBuffer(string const & s)
 {
        BufferStorage::iterator it =
                find_if(bstore.begin(), bstore.end(),
-                       lyx::compare_memfun(&Buffer::fileName, s));
+                       bind(equal_to<string>(),
+                            bind(&Buffer::fileName, _1),
+                            s));
+
        return it != bstore.end() ? (*it) : 0;
 }