if(!qwatcher_->files().contains(qfilename)) {
bool exists = QFile(qfilename).exists();
#if (QT_VERSION >= 0x050000)
- if (!exists || !qwatcher_->addPath(qfilename)) {
+ if (!exists || !qwatcher_->addPath(qfilename))
#else
auto add_path = [&]() {
qwatcher_->addPath(qfilename);
return qwatcher_->files().contains(qfilename);
};
- if (!exists || !add_path()) {
+ if (!exists || !add_path())
#endif
+ {
if (exists)
LYXERR(Debug::FILES,
"Could not add path to QFileSystemWatcher: "
class FileSystemWatcher
{
public:
- // as described above
+ /// as described above
static FileMonitorPtr monitor(FileName const & filename);
/// same but with an ActiveFileMonitor
static ActiveFileMonitorPtr activeMonitor(FileName const & filename,
int interval = 10000);
- // Output whether the paths tracked by qwatcher_ and the active
- // FileMonitorGuards are in correspondence.
+ /// Output whether the paths tracked by qwatcher_ and the active
+ /// FileMonitorGuards are in correspondence.
static void debug();
private:
FileSystemWatcher();
static FileSystemWatcher & instance();
///
std::shared_ptr<FileMonitorGuard> getGuard(FileName const & filename);
- // Caches the monitor guards but allow them to be destroyed
+ /// Caches the monitor guards but allow them to be destroyed
std::map<std::string, std::weak_ptr<FileMonitorGuard>> store_;
- // This class is a wrapper for QFileSystemWatcher
+ /// This class is a wrapper for QFileSystemWatcher
std::unique_ptr<QFileSystemWatcher> const qwatcher_;
};
void reconnectToFileMonitorGuard();
private:
- // boost signal
+ /// boost signal
sig fileChanged_;
- // the unique watch for our file
+ /// the unique watch for our file
std::shared_ptr<FileMonitorGuard> const monitor_;
- //
+ ///
std::weak_ptr<FileMonitorBlockerGuard> blocker_;
};