X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyx_cb.C;h=ffe3ce6ab6f16211857172a1d1f42a95ed2e77cf;hb=c4320d24cd2d29c2e77958b4a8fd44f2bd587ca7;hp=3fcccaec4f72fe7a4dbe8996556d518eb98c4102;hpb=6c300f72a217722652dc27db9108e1050028979c;p=lyx.git diff --git a/src/lyx_cb.C b/src/lyx_cb.C index 3fcccaec4f..ffe3ce6ab6 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -34,6 +34,7 @@ #include "frontends/Alert.h" #include "frontends/Application.h" #include "frontends/FileDialog.h" +#include "frontends/LyXView.h" #include "support/filefilterlist.h" #include "support/filetools.h" @@ -61,6 +62,7 @@ namespace lyx { using support::addName; using support::bformat; using support::FileFilterList; +using support::FileName; using support::ForkedProcess; using support::isLyXFilename; using support::libFileSearch; @@ -101,7 +103,7 @@ bool quitting; // flag, that we are quitting the program bool menuWrite(Buffer * buffer) { if (buffer->save()) { - LyX::ref().session().addLastFile(buffer->fileName()); + LyX::ref().session().lastFiles().add(FileName(buffer->fileName())); return true; } @@ -192,7 +194,7 @@ namespace { class AutoSaveBuffer : public ForkedProcess { public: /// - AutoSaveBuffer(BufferView & bv, string const & fname) + AutoSaveBuffer(BufferView & bv, FileName const & fname) : bv_(bv), fname_(fname) {} /// virtual shared_ptr clone() const @@ -206,13 +208,13 @@ private: virtual int generateChild(); /// BufferView & bv_; - string fname_; + FileName fname_; }; int AutoSaveBuffer::start() { - command_ = to_utf8(bformat(_("Auto-saving %1$s"), from_utf8(fname_))); + command_ = to_utf8(bformat(_("Auto-saving %1$s"), from_utf8(fname_.absFilename()))); return run(DontWait); } @@ -230,7 +232,7 @@ int AutoSaveBuffer::generateChild() // anyway. bool failed = false; - string const tmp_ret = tempName(string(), "lyxauto"); + FileName const tmp_ret(tempName(string(), "lyxauto")); if (!tmp_ret.empty()) { bv_.buffer()->writeFile(tmp_ret); // assume successful write of tmp_ret @@ -287,7 +289,7 @@ void autoSave(BufferView * bv) fname += onlyFilename(bv->buffer()->fileName()); fname += '#'; - AutoSaveBuffer autosave(*bv, fname); + AutoSaveBuffer autosave(*bv, FileName(fname)); autosave.start(); bv->buffer()->markBakClean(); @@ -404,10 +406,10 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap // This function runs "configure" and then rereads lyx.defaults to // reconfigure the automatic settings. -void reconfigure(BufferView * bv) +void reconfigure(LyXView & lv) { // emit message signal. - bv->buffer()->message(_("Running configure...")); + lv.message(_("Running configure...")); // Run configure in user lyx directory support::Path p(package().user_support()); @@ -416,7 +418,7 @@ void reconfigure(BufferView * bv) one.startscript(Systemcall::Wait, configure_command); p.pop(); // emit message signal. - bv->buffer()->message(_("Reloading configuration...")); + lv.message(_("Reloading configuration...")); lyxrc.read(libFileSearch(string(), "lyxrc.defaults")); // Re-read packages.lst LaTeXFeatures::getAvailable();