[Kst] branches/work/kst/portto4/kst/src
Peter Kümmel
syntheticpp at gmx.net
Sun Aug 29 19:11:35 CEST 2010
SVN commit 1169556 by kuemmel:
remove buggy Qt code, enable time based update for dirfiles
M +2 -1 datasources/dirfilesource/dirfilesource.cpp
M +4 -19 libkst/datasource.cpp
--- branches/work/kst/portto4/kst/src/datasources/dirfilesource/dirfilesource.cpp #1169555:1169556
@@ -208,8 +208,9 @@
if (_fieldList.count() > 1) {
QString filePath = _dirfile->ReferenceFilename();
- setUpdateType(File, filePath);
+ //setUpdateType(File, filePath);
}
+ setUpdateType(Time);
registerChange();
return true;
--- branches/work/kst/portto4/kst/src/libkst/datasource.cpp #1169555:1169556
@@ -204,26 +204,11 @@
if (_updateCheckType == Timer) {
QTimer::singleShot(UpdateManager::self()->minimumUpdatePeriod()-1, this, SLOT(checkUpdate()));
} else if (_updateCheckType == File) {
- _watcher = new QFileSystemWatcher();
- QString usedfile = (file.isEmpty() ? _filename : file);
-
- bool isLocal;
- // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-13248
- //islocal = QFSFileEngine(usedfile).fileFlags(QAbstractFileEngine::LocalDiskFlag) & QAbstractFileEngine::LocalDiskFlag;
-#ifdef Q_OS_WIN
- // TODO What if the directory is mounted?
- isLocal = !usedfile.startsWith("//");
-#else
- // TODO How could we detect if the file is not local.
- // Always poll on Linux
- isLocal = false;
-#endif
-
- if (!isLocal) {
- // TODO undocumented Qt feature:
+ // TODO only works on local files:
// http://bugreports.qt.nokia.com/browse/QTBUG-8351
- _watcher->setObjectName(QLatin1String("_qt_autotest_force_engine_poller"));
- }
+ // http://bugreports.qt.nokia.com/browse/QTBUG-13248
+ _watcher = new QFileSystemWatcher();
+ const QString usedfile = (file.isEmpty() ? _filename : file);
_watcher->addPath(usedfile);
connect(_watcher, SIGNAL(fileChanged ( const QString & )), this, SLOT(checkUpdate()));
connect(_watcher, SIGNAL(directoryChanged ( const QString & )), this, SLOT(checkUpdate()));
More information about the Kst
mailing list