- Timestamp:
- Aug 8, 2011, 9:35:15 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qfilesystemwatcher_os2.cpp
r946 r947 42 42 ****************************************************************************/ 43 43 44 //#define QFILESYSTEMWATCHER_DEBUG 45 44 46 #include "qfilesystemwatcher.h" 45 47 #include "qfilesystemwatcher_os2_p.h" … … 51 53 52 54 #include "qdebug.h" 55 #ifdef QFILESYSTEMWATCHER_DEBUG 56 #define DEBUG(a) qDebug a 57 #else 58 #define DEBUG(a) do {} while(0) 59 #endif 53 60 54 61 // OS/2 has the Dos*ChangeNotify API for file system change notifications but … … 212 219 arc = DosQueryPathInfo(QFile::encodeName(path), FIL_STANDARD, 213 220 &newInfo, sizeof(newInfo)); 221 DEBUG(() << "POLLER ADD" << path << arc); 214 222 if (arc == NO_ERROR) 215 223 watchedPaths.insert(path, newInfo); … … 228 236 229 237 foreach (const QString &path, paths) { 238 DEBUG(() << "POLLER REMOVE" << path); 230 239 watchedPaths.remove(path); 231 240 } … … 255 264 256 265 locker.relock(); 266 267 //DEBUG(() << "*** POLLER" << watchedPaths.size() << "items"); 257 268 258 269 for (PathMap::iterator it = watchedPaths.begin(); … … 273 284 newInfo.attrFile != info.attrFile) { 274 285 // there was a change, memorize it and update the info 286 DEBUG(() << "POLLER CHANGE!" << path); 275 287 changedPaths << path; 276 288 info = newInfo; … … 285 297 void QOS2FileSysPollerThread::stop(QMutexLocker &locker) 286 298 { 287 Q_ASSERT(locker.locked());288 289 299 if (isRunning()) { 290 300 finish = true; … … 393 403 QMutexLocker locker(&mutex); 394 404 405 DEBUG(() << "WATCHER ADD" << paths); 406 395 407 QStringList p = paths, pollerPaths; 396 408 QMutableListIterator<QString> it(p); … … 459 471 QMutexLocker locker(&mutex); 460 472 473 DEBUG(() << "WATCHER REMOVE" << paths); 474 461 475 QStringList p = paths, pollerPaths; 462 476 QMutableListIterator<QString> it(p); … … 504 518 QMutexLocker locker(&mutex); 505 519 520 DEBUG(() << "WATCHER REMOVE" << engine); 521 506 522 QStringList pollerPaths; 507 523 foreach (const QString &normalPath, instance->watchedPaths.keys()) { … … 542 558 foreach(const PathInfo &pi, variants) { 543 559 foreach(QOS2FileSystemWatcherEngine *e, pi.engines) { 544 if (pi.type == File) 560 if (pi.type == File) { 561 DEBUG(() << "WATCHER EMIT FILE" << pi.path); 545 562 e->doFileChanged(pi.path, false); 546 else 563 } else { 564 DEBUG(() << "WATCHER EMIT DIR" << pi.path); 547 565 e->doDirectoryChanged(pi.path, false); 566 } 548 567 } 549 568 } … … 599 618 QString normalPath = QString::fromLocal8Bit(info->szName).toUpper(); 600 619 620 //DEBUG(() << "WATCHER NOTIFY" << (int) info->bAction << normalPath); 621 601 622 switch (info->bAction) { 602 623 case RCNF_FILE_DELETED: … … 622 643 if (type == pi.type) { 623 644 foreach(QOS2FileSystemWatcherEngine *e, pi.engines) { 624 if (type == File) 645 if (type == File) { 646 DEBUG(() << "WATCHER EMIT FILE" 647 << (int) info->bAction << pi.path 648 << deleted); 625 649 e->doFileChanged(pi.path, deleted); 626 else 650 } else { 651 DEBUG(() << "WATCHER EMIT DIR" 652 << (int) info->bAction << pi.path 653 << deleted); 627 654 e->doDirectoryChanged(pi.path, deleted); 655 } 628 656 } 629 657 } … … 639 667 if (watchedPaths.contains(normalPath)) { 640 668 foreach(const PathInfo &pi, watchedPaths[normalPath]) { 641 if (pi.type == Dir) 642 foreach(QOS2FileSystemWatcherEngine *e, pi.engines) 669 if (pi.type == Dir) { 670 foreach(QOS2FileSystemWatcherEngine *e, pi.engines) { 671 DEBUG(() << "WATCHER EMIT DIR" 672 << (int) info->bAction << pi.path); 643 673 e->doDirectoryChanged(pi.path, false); 674 } 675 } 644 676 } 645 677 } … … 661 693 void QOS2FileSysWatcherThread::stop(QMutexLocker &locker) 662 694 { 663 Q_ASSERT(locker.locked());664 665 695 if (isRunning()) { 666 696 // stop the thread
Note:
See TracChangeset
for help on using the changeset viewer.