mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Regularly check if preview is modified when visible on screen
In case one cannot rely on QFileSystemWatcher.
This commit is contained in:
parent
ad16347b08
commit
ac6d3ffb6a
@ -292,6 +292,7 @@ void RenderMonitoredPreview::draw(PainterInfo & pi, int x, int y) const
|
||||
{
|
||||
RenderPreview::draw(pi, x, y);
|
||||
startMonitoring();
|
||||
monitor_->checkModifiedAsync();
|
||||
}
|
||||
|
||||
|
||||
@ -311,7 +312,7 @@ bool RenderMonitoredPreview::monitoring() const
|
||||
void RenderMonitoredPreview::startMonitoring() const
|
||||
{
|
||||
if (!monitoring()) {
|
||||
monitor_ = FileSystemWatcher::monitor(filename_);
|
||||
monitor_ = FileSystemWatcher::activeMonitor(filename_);
|
||||
monitor_->connect(changed_);
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ private:
|
||||
/// This signal is emitted if the file is modified
|
||||
ChangedSig changed_;
|
||||
///
|
||||
mutable support::FileMonitorPtr monitor_;
|
||||
mutable support::ActiveFileMonitorPtr monitor_;
|
||||
///
|
||||
support::FileName filename_;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user