Comments?
Abdel.
Index: src/BufferView.C =================================================================== --- src/BufferView.C (revision 15017) +++ src/BufferView.C (working copy) @@ -517,12 +517,6 @@ } -bool BufferView::available() const -{ - return buffer_; -} - - Change const BufferView::getCurrentChange() { if (!buffer_->params().tracking_changes || !cursor_.selection()) @@ -1399,7 +1393,7 @@ // Launch a file browser string initpath = lyxrc.document_path; - if (available()) { + if (buffer_) { string const trypath = buffer_->filePath(); // If directory is writeable, use this as default. if (isDirWriteable(trypath)) Index: src/BufferView.h =================================================================== --- src/BufferView.h (revision 15017) +++ src/BufferView.h (working copy) @@ -127,9 +127,6 @@ /// return the Scrollbar Parameters ScrollbarParameters const & scrollbarParameters() const; - /// FIXME - bool available() const; - /// Save the current position as bookmark i void savePosition(unsigned int i); /// Restore the position from bookmark i Index: src/frontends/controllers/Kernel.C =================================================================== --- src/frontends/controllers/Kernel.C (revision 15012) +++ src/frontends/controllers/Kernel.C (working copy) @@ -51,7 +51,7 @@ { if (!lyxview_.view()) return false; - return lyxview_.view()->available(); + return lyxview_.view()->buffer(); } Index: src/frontends/LyXView.C =================================================================== --- src/frontends/LyXView.C (revision 15012) +++ src/frontends/LyXView.C (working copy) @@ -273,7 +273,7 @@ { lyxerr[Debug::INFO] << "Running autoSave()" << endl; - if (view()->available()) { + if (view()->buffer()) { ::autoSave(view()); } } @@ -318,7 +318,7 @@ docstring maximize_title = lyx::from_ascii("LyX"); docstring minimize_title = lyx::from_ascii("LyX"); - if (view()->available()) { + if (view()->buffer()) { string const cur_title = buffer()->fileName(); if (!cur_title.empty()) { maximize_title += lyx::from_ascii(": ") + makeDisplayPath(cur_title, 30); Index: src/frontends/WorkArea.C =================================================================== --- src/frontends/WorkArea.C (revision 15012) +++ src/frontends/WorkArea.C (working copy) @@ -235,7 +235,7 @@ * of the cursor. Note we cannot do this inside * dispatch() itself, because that's called recursively. */ -// if (buffer_view_->available()) +// if (buffer_view_->buffer()) toggleCursor(); // uneeded "redraw()" call commented out for now. @@ -343,7 +343,7 @@ if (cursor_visible_) return; - if (!buffer_view_->available()) + if (!buffer_view_->buffer()) return; CursorShape shape = BAR_SHAPE; Index: src/lyx_cb.C =================================================================== --- src/lyx_cb.C (revision 15017) +++ src/lyx_cb.C (working copy) @@ -302,7 +302,7 @@ // should probably be moved into BufferList (Lgb) // Perfect target for a thread... { - if (!bv->available()) + if (!bv->buffer()) return; if (bv->buffer()->isBakClean() || bv->buffer()->isReadonly()) { @@ -353,7 +353,7 @@ // Insert ascii file (if filename is empty, prompt for one) void insertAsciiFile(BufferView * bv, string const & f, bool asParagraph) { - if (!bv->available()) + if (!bv->buffer()) return; // FIXME: We don't know the encoding of the file Index: src/lyxfind.C =================================================================== --- src/lyxfind.C (revision 15017) +++ src/lyxfind.C (working copy) @@ -141,7 +141,7 @@ Alert::error(_("Search error"), _("Search string is empty")); return false; } - return bv->available(); + return bv->buffer(); } @@ -337,7 +337,7 @@ bool findNextChange(BufferView * bv) { - if (!bv->available()) + if (!bv->buffer()) return false; DocIterator cur = bv->cursor(); Index: src/lyxfunc.C =================================================================== --- src/lyxfunc.C (revision 15013) +++ src/lyxfunc.C (working copy) @@ -775,7 +775,7 @@ case LFUN_CANCEL: keyseq.reset(); meta_fake_bit = key_modifier::none; - if (view()->available()) + if (view()->buffer()) // cancel any selection dispatch(FuncRequest(LFUN_MARK_OFF)); setMessage(lyx::from_utf8(N_("Cancel"))); @@ -998,7 +998,7 @@ break; case LFUN_LYX_QUIT: - if (view()->available()) { + if (view()->buffer()) { // save cursor Position for opened files to .lyx/session LyX::ref().session().saveFilePosition(owner->buffer()->fileName(), boost::tie(view()->cursor().pit(), view()->cursor().pos()) ); @@ -1591,7 +1591,7 @@ } } - if (view()->available()) { + if (view()->buffer()) { // Redraw screen unless explicitly told otherwise. // This also initializes the position cache for all insets // in (at least partially) visible top-level paragraphs. @@ -1690,7 +1690,7 @@ string initpath = lyxrc.document_path; string filename(name); - if (view()->available()) { + if (view()->buffer()) { string const trypath = owner->buffer()->filePath(); // If directory is writeable, use this as default. if (isDirWriteable(trypath)) @@ -1742,7 +1742,7 @@ { string initpath = lyxrc.document_path; - if (view()->available()) { + if (view()->buffer()) { string const trypath = owner->buffer()->filePath(); // If directory is writeable, use this as default. if (isDirWriteable(trypath)) @@ -1819,7 +1819,7 @@ if (filename.empty()) { string initpath = lyxrc.document_path; - if (view()->available()) { + if (view()->buffer()) { string const trypath = owner->buffer()->filePath(); // If directory is writeable, use this as default. if (isDirWriteable(trypath)) @@ -1940,7 +1940,7 @@ if (keyseq.length() > 0 && !keyseq.deleted()) return keyseq.printOptions(); - if (!view()->available()) + if (!view()->buffer()) return lyx::to_utf8(_("Welcome to LyX!")); return view()->cursor().currentState();