]> git.lyx.org Git - features.git/commitdiff
Transfer getcwd() implementation to FileName.
authorAbdelrazak Younes <younes@lyx.org>
Sun, 16 Dec 2007 10:18:00 +0000 (10:18 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 16 Dec 2007 10:18:00 +0000 (10:18 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22164 a592a061-630c-0410-9148-cb99ea01b6c8

development/scons/scons_manifest.py
src/LaTeX.cpp
src/frontends/FileDialog.h
src/support/FileName.cpp
src/support/FileName.h
src/support/Makefile.am
src/support/Path.cpp
src/support/filetools.cpp
src/support/getcwd.cpp [deleted file]
src/support/lyxlib.h

index cb404e4e78bb3a0a3f47c5ac779451480fe09107..1c0ab51ca22aff3340474525a2cf05a8f65453d8 100644 (file)
@@ -344,7 +344,6 @@ src_support_files = Split('''
     environment.cpp
     filetools.cpp
     gzstream.cpp
-    getcwd.cpp
     gettext.cpp
     kill.cpp
     lstrings.cpp
index efa764b18b1ad56c0ca42783549c4a4563de1118..d31e81f41dbd05e9295b6469a1304b563aa3508f 100644 (file)
@@ -159,7 +159,7 @@ int LaTeX::run(TeXErrors & terr)
        bool rerun = false; // rerun requested
 
        // The class LaTeX does not know the temp path.
-       theBufferList().updateIncludedTeXfiles(getcwd().absFilename(),
+       theBufferList().updateIncludedTeXfiles(FileName::getcwd().absFilename(),
                runparams);
 
        // Never write the depfile if an error was encountered.
index 54c2afd4e691216502c6a6cc9ffec46a8a6dfff4..a4e69da2f286cdf31ff1429bc459f317a9d897dd 100644 (file)
@@ -52,7 +52,7 @@ public:
         *
         * Up to two optional extra buttons are allowed for specifying
         * additional directories in the navigation (an empty
-        * directory is interpreted as getcwd())
+        * directory is interpreted as FileName::getcwd())
         */
        FileDialog(docstring const & title, kb_action a = LFUN_SELECT_FILE_SYNC);
 
index f3e73a8bc4dbec8184084be7d9825ae526f058df..29049c2ca7cab74fc4aa2c3f0f631f9f90bfc2cb 100644 (file)
@@ -399,6 +399,12 @@ FileName FileName::tempName(string const & mask)
 }
 
 
+FileName FileName::getcwd()
+{
+       return FileName(".");
+}
+
+
 time_t FileName::lastModified() const
 {
        return d->fi.lastModified().toTime_t();
index 12319160040b7b6941ba2667003edc3dd7cd7a7d..2ded3001c0d8e38c24bb8e80af052b51ee4ceb06 100644 (file)
@@ -154,6 +154,9 @@ public:
        /// temporary directory as given by 'package().temp_dir()'.
        static FileName tempName(std::string const & mask = empty_string());
 
+       /// get the current working directory
+       static FileName getcwd();
+
        /// filename without path
        std::string onlyFileName() const;
        /// path without file name
index e2b8a3737586f94616e3163894fb8fb2be8b8113..565a61bf39e82fee2158cf95e5b2be524baf3e59 100644 (file)
@@ -64,7 +64,6 @@ liblyxsupport_la_SOURCES = \
        ForkedCalls.h \
        gettext.cpp \
        gettext.h \
-       getcwd.cpp \
        gzstream.cpp \
        gzstream.h \
        kill.cpp \
index fbf48d8d1371568e5a8d019d48a5ff1d24bdc391..b8e9f01727e73e866b08d607f29ef7ddb7dcf3c8 100644 (file)
@@ -24,7 +24,7 @@ PathChanger::PathChanger(FileName const & path)
        : popped_(false)
 {
        if (!path.empty()) {
-               pushedDir_ = getcwd();
+               pushedDir_ = FileName::getcwd();
 
                if (pushedDir_.empty() || !path.chdir()) {
                        /* FIXME: throw */
index 52b7bbadbbc678d517d3e0dad024041b42bf5594..fa4970e7576e4152bc35b836bea18365a41e8e21 100644 (file)
@@ -410,7 +410,7 @@ FileName const makeAbsPath(string const & relPath, string const & basePath)
        if (os::is_absolute_path(basePath))
                tempBase = basePath;
        else
-               tempBase = addPath(getcwd().absFilename(), basePath);
+               tempBase = addPath(FileName::getcwd().absFilename(), basePath);
 
        // Handle /./ at the end of the path
        while (suffixIs(tempBase, "/./"))
@@ -508,7 +508,7 @@ string const expandPath(string const & path)
        rTemp = split(rTemp, temp, '/');
 
        if (temp == ".")
-               return getcwd().absFilename() + '/' + rTemp;
+               return FileName::getcwd().absFilename() + '/' + rTemp;
 
        if (temp == "~")
                return package().home_dir().absFilename() + '/' + rTemp;
diff --git a/src/support/getcwd.cpp b/src/support/getcwd.cpp
deleted file mode 100644 (file)
index 7c98a28..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * \file getcwd.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Lars Gullik Bjønnes
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "support/lyxlib.h"
-
-namespace lyx {
-namespace support {
-
-// Returns current working directory
-FileName const getcwd()
-{
-       return FileName(".");
-}
-
-} // namespace support
-} // namespace lyx
index bb8ed4eadba0c6c4c91b237551523fbf8df16863..ba784361963d4991dc9b720151b945bf760507f9 100644 (file)
 #ifndef LYX_LIB_H
 #define LYX_LIB_H
 
-#include "support/FileName.h"
-
 #include <string>
 
 
 namespace lyx {
 namespace support {
 
-/// get the current working directory
-FileName const getcwd();
-
 /// FIXME: some point to this hmm ?
 int kill(int pid, int sig);
 /// FIXME: same here