Commit 752a59f5 authored by Christopher Reichert's avatar Christopher Reichert
Browse files

Reload Document when contents of symlink target change.

If okular loads a symlink, watch the document the symlink
points to using readlink. Reload the symlink when the
actual document changes.

CCBUG: 186118
parent a9354072
......@@ -1014,8 +1014,9 @@ bool Part::openFile()
if ( url().isLocalFile() )
{
if ( !m_watcher->contains( localFilePath() ) ) m_watcher->addFile(localFilePath());
QFileInfo fi(localFilePath());
const QFileInfo fi(localFilePath());
if ( !m_watcher->contains( fi.absolutePath() ) ) m_watcher->addDir(fi.absolutePath());
if ( fi.isSymLink() ) m_watcher->addFile( fi.readLink() );
}
// if the 'OpenTOC' flag is set, open the TOC
......@@ -1204,7 +1205,7 @@ void Part::slotFileDirty( const QString& path )
}
else
{
QFileInfo fi(localFilePath());
const QFileInfo fi(localFilePath());
if ( fi.absolutePath() == path )
{
// Our parent has been dirtified
......@@ -1220,6 +1221,13 @@ void Part::slotFileDirty( const QString& path )
m_dirtyHandler->start( 750 );
}
}
else if ( fi.isSymLink() )
{
if ( QFile::exists( fi.readLink() ))
m_dirtyHandler->start( 750 );
else
m_fileWasRemoved = true;
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment