]> git.lyx.org Git - lyx.git/blobdiff - src/support/path.h
the freespacing patch from Kayvan, draw the math empty delim with onoffdash, asure...
[lyx.git] / src / support / path.h
index ad5a905b4008aa0989d14c68835a515fad08de20..122e86fa202c15abf30430466a0bc54b324fe2a0 100644 (file)
@@ -7,6 +7,7 @@
 #include "gettext.h"
 #include "support/filetools.h"
 #include "lyx_gui_misc.h"
+#include "lyxlib.h"
 
 class Path {
 public:
@@ -16,7 +17,7 @@ public:
        {
                if (!path.empty()) { 
                        pushedDir_ = GetCWD();
-                       if (pushedDir_.empty() || chdir(path.c_str())) {
+                       if (pushedDir_.empty() || lyx::chdir(path.c_str())) {
                                WriteFSAlert(_("Error: Could not change to directory: "), 
                                             path);
                        }
@@ -37,7 +38,7 @@ public:
                                     pushedDir_);
                        return 0;
                }
-               if (chdir(pushedDir_.c_str())) {
+               if (lyx::chdir(pushedDir_.c_str())) {
                        WriteFSAlert(
                                _("Error: Could not change to directory: "), 
                                pushedDir_);
@@ -52,4 +53,11 @@ private:
        string pushedDir_;
 };
 
+// To avoid the wrong usage:
+// Path("/tmp");   // wrong
+// Path p("/tmp");  // right
+// we add this macro:
+#define Path(x) unnamed_Path;
+// Tip gotten from Bobby Schmidt's column in C/C++ Users Journal
+
 #endif