This should avoid performance problems related to the window update machinery.
Moreover this fixes a crash introduced by 82808fea when closing a file.
Note that GuiWorkArea::Private already had a read_only_ member, but it
was unused.
Also rename LyXVC::vcname() to LyXVC::vcstatus() since it now contains
directly the UI string to be shown.
The window title is built from the current file name and its
mofidication state. We use our own code instead of the automatic title
bar provided when windowFileName() is set because
1/ Qt does not keep the full path name
2/ Qt does not yield a nice application name
The "read only" and "version control" status are shown in the status bar:
* for read only we use the tab read only emblem (with the right size)
* for version control, we show the name of the backend (using a new
vcname() method of the backend).
The iconText() of the view is not updated anymore, since this is
deprecated in Qt5.
FileName::tempName() created a new temp file name by using qt to create a
temporary file with a unique name, and then deleting that file and returning
the name. This was unsafe, since other processes or even other threads of the
running LyX could create files with the same name between deletion and then
using the temp name.
This is fixed by using the TempFile class instead. As a side effect, a few
cases where the temp files were not deleted after usage were fixed as well.
The only place that is still unsafe is createTmpDir().
This reverts a small part of 0526eb9d and gets rid of the double calls of
SVN::findFile() and GIT::findFile(). Please note that git detection does
currently not work because of 26dd4d0c.
Only the local index is considered, no remote repo. Also getting the revision
(aka commit hash) is missing. How push and pull could be integrated with the
LyX VCS interface needs to be discussed, but the implemented functionality was
quite straight forward.
The advantage of having this in LyX is the intelligent file name handling
of included files. Implementation as discussed on the list, but ensure also
that an attempt to use locked files fails.
It is not possible to transport the different error/abort/success conditions
of a VCS checkin through a simple empty or nonempty string. Therefore it was
no wonder that the return values were used inconsistently for different VCS.
Now the log and return status are decoupled, and all VCS are handled
consistently. This is a prerequisite for proper locking detection of the
upcoming rename command.
Both cvs and svn are able to retrieve non-existing files from repository,
but this was only implemented for rcs. This is a prerequisite for the
planned move and copy VCV operations. I also improved error schecking and
used extractFromVC() also for files specified on the command line if they
do not exist (in GUI mode, it was already the case in non-GUI mode).
It did always point to the buffer's file name, so it is not needed and it was
not used in most cases anyway. Instead, ensure that owner_ is always set and
cannot be changed later.
Furthermore, make sure that the read-only flag is always set to both true and false, since now the buffer can be read-only during a reload.
Last, set the buffer clean after a successful reload.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32896 a592a061-630c-0410-9148-cb99ea01b6c8
* the menu-item should also be enabled when the buffer is still unnamed (it will be saved anyway), and
* no buffer-reload after user cancel.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28028 a592a061-630c-0410-9148-cb99ea01b6c8