]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
Updates from Bennett and myself.
[lyx.git] / src / lyxfunc.C
index dbda91f6c8d513a28b6d636f8e9c8cf4dddacc09..728116849b7873b212bdb54da6ca8c28455141c7 100644 (file)
@@ -113,6 +113,7 @@ using support::bformat;
 using support::changeExtension;
 using support::contains;
 using support::FileFilterList;
+using support::FileName;
 using support::fileSearch;
 using support::ForkedcallsController;
 using support::i18nLibFileSearch;
@@ -376,11 +377,9 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
           Note that this code is not perfect, as bug 1941 attests:
           http://bugzilla.lyx.org/show_bug.cgi?id=1941#c4
        */
-       Buffer * buf;
-       if (cmd.origin == FuncRequest::MENU && !lyx_view_->hasFocus())
+       Buffer * buf = lyx_view_? lyx_view_->buffer() : 0;
+       if (lyx_view_ && cmd.origin == FuncRequest::MENU && !lyx_view_->hasFocus())
                buf = 0;
-       else
-               buf = lyx_view_->buffer();
 
        if (cmd.action == LFUN_NOACTION) {
                flag.message(from_utf8(N_("Nothing to do")));
@@ -542,7 +541,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                else if (name == "character" || name == "mathpanel")
                        enable = cur.inset().lyxCode() != InsetBase::ERT_CODE;
                else if (name == "latexlog")
-                       enable = isFileReadable(buf->getLogName().second);
+                       enable = isFileReadable(FileName(buf->getLogName().second));
 #if !defined (USE_ASPELL) && !defined (USE_ISPELL) && !defined (USE_PSPELL)
                else if (name == "spellchecker")
                        enable = false;
@@ -1035,7 +1034,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        break;
 
                case LFUN_LYX_QUIT:
-                       if (argument != "force") {
+                       if (argument == "closeOnly") {
                                if (!theApp->gui().closeAll())
                                        break;
                                lyx_view_ = 0;
@@ -1077,7 +1076,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                setErrorMessage(_("Missing argument"));
                                break;
                        }
-                       string const fname = i18nLibFileSearch("doc", arg, "lyx");
+                       string const fname = i18nLibFileSearch("doc", arg, "lyx").absFilename();
                        if (fname.empty()) {
                                lyxerr << "LyX: unable to find documentation file `"
                                                         << arg << "'. Bad installation?" << endl;
@@ -1712,18 +1711,19 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                }
 
                if (lyx_view_ && view()->buffer()) {
+                       // BufferView::update() updates the ViewMetricsInfo and
+                       // also initializes the position cache for all insets in
+                       // (at least partially) visible top-level paragraphs.
+                       std::pair<bool, bool> needSecondUpdate 
+                               = view()->update(updateFlags);
+
                        // Redraw screen unless explicitly told otherwise.
-                       // This also initializes the position cache for all insets
-                       // in (at least partially) visible top-level paragraphs.
-                       bool needSecondUpdate = false;
-                       if (updateFlags != Update::None)
-                               view()->update(updateFlags);
-                       else
-                               needSecondUpdate = view()->fitCursor();
+                       if (needSecondUpdate.first)
+                               // Buffer::changed() signals that a repaint is needed.
+                               // The frontend (WorkArea) knows which area to repaint
+                               // thanks to the ViewMetricsInfo updated above.
+                               view()->buffer()->changed();
 
-                       if (needSecondUpdate || updateFlags != Update::None) {
-                               view()->buffer()->changed(updateFlags & Update::SinglePar);
-                       }
                        lyx_view_->updateStatusBar();
 
                        // if we executed a mutating lfun, mark the buffer as dirty
@@ -1882,7 +1882,7 @@ void LyXFunc::open(string const & fname)
 
        // get absolute path of file and add ".lyx" to the filename if
        // necessary
-       string const fullpath = fileSearch(string(), filename, "lyx");
+       string const fullpath = fileSearch(string(), filename, "lyx").absFilename();
        if (!fullpath.empty()) {
                filename = fullpath;
        }
@@ -2092,6 +2092,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_LOADSESSION:
        case LyXRC::RC_CHKTEX_COMMAND:
        case LyXRC::RC_CONVERTER:
+       case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
        case LyXRC::RC_COPIER:
        case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
        case LyXRC::RC_CUSTOM_EXPORT_COMMAND:
@@ -2188,6 +2189,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_USER_NAME:
        case LyXRC::RC_USETEMPDIR:
        case LyXRC::RC_USE_ALT_LANG:
+       case LyXRC::RC_USE_CONVERTER_CACHE:
        case LyXRC::RC_USE_ESC_CHARS:
        case LyXRC::RC_USE_INP_ENC:
        case LyXRC::RC_USE_PERS_DICT: