]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_cb.C
- Link against qt-mt333.lib which is what the current qt3 cvs produces
[lyx.git] / src / lyx_cb.C
index 24dbdb8afc88189c3f25bd7f8bb3381c858a21bf..add78e0693ef0b431e0b156781d89e56964a1fd9 100644 (file)
@@ -23,6 +23,7 @@
 #include "debug.h"
 #include "gettext.h"
 #include "lastfiles.h"
+#include "LaTeXFeatures.h"
 #include "lyx_main.h"
 #include "lyxlayout.h"
 #include "lyxrc.h"
 #include "frontends/LyXView.h"
 
 #include "support/filefilterlist.h"
-#include "support/FileInfo.h"
 #include "support/filetools.h"
 #include "support/forkedcall.h"
+#include "support/fs_extras.h"
 #include "support/lyxlib.h"
 #include "support/package.h"
 #include "support/path.h"
 #include "support/systemcall.h"
 
 #include <boost/shared_ptr.hpp>
+#include <boost/filesystem/operations.hpp>
 
 #include <cerrno>
 #include <fstream>
@@ -52,7 +54,6 @@ using lyx::support::AddName;
 using lyx::support::bformat;
 using lyx::support::destroyDir;
 using lyx::support::FileFilterList;
-using lyx::support::FileInfo;
 using lyx::support::ForkedProcess;
 using lyx::support::IsLyXFilename;
 using lyx::support::LibFileSearch;
@@ -72,6 +73,8 @@ using lyx::support::unlink;
 
 using boost::shared_ptr;
 
+namespace fs = boost::filesystem;
+
 using std::back_inserter;
 using std::copy;
 using std::endl;
@@ -153,8 +156,7 @@ bool WriteAs(Buffer * buffer, string const & filename)
        } else
                fname = filename;
 
-       FileInfo const myfile(fname);
-       if (myfile.isOK()) {
+       if (fs::exists(fname)) {
                string const file = MakeDisplayPath(fname, 30);
                string text = bformat(_("The document %1$s already exists.\n\n"
                        "Do you want to over-write that document?"), file);
@@ -203,10 +205,11 @@ void QuitLyX()
        // do any other cleanup procedures now
        lyxerr[Debug::INFO] << "Deleting tmp dir " << package().temp_dir() << endl;
 
-       if (destroyDir(package().temp_dir()) != 0) {
-               string msg = bformat(_("Could not remove the temporary directory %1$s"),
+       if (!destroyDir(package().temp_dir())) {
+               string const msg =
+                       bformat(_("Unable to remove the temporary directory %1$s"),
                        package().temp_dir());
-               Alert::warning(_("Could not remove temporary directory"), msg);
+               Alert::warning(_("Unable to remove temporary directory"), msg);
        }
 
        lyx_gui::exit();
@@ -391,9 +394,7 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap
                        return string();
        }
 
-       FileInfo fi(fname);
-
-       if (!fi.readable()) {
+       if (!fs::is_readable(fname)) {
                string const error = strerror(errno);
                string const file = MakeDisplayPath(fname, 50);
                string const text = bformat(_("Could not read the specified document\n"
@@ -449,6 +450,8 @@ void Reconfigure(BufferView * bv)
        p.pop();
        bv->owner()->message(_("Reloading configuration..."));
        lyxrc.read(LibFileSearch(string(), "lyxrc.defaults"));
+       // Re-read packages.lst
+       LaTeXFeatures::getAvailable();
 
        Alert::information(_("System reconfigured"),
                _("The system has been reconfigured.\n"