comparison src/fswatcher.cpp @ 647:a03264984ef8

Merge
author Chris Cannam
date Mon, 21 Jan 2013 10:22:44 +0000
parents ae67ea0af696
children 646e48a0d3a5
comparison
equal deleted inserted replaced
646:6653fc50a546 647:a03264984ef8
3 /* 3 /*
4 EasyMercurial 4 EasyMercurial
5 5
6 Based on hgExplorer by Jari Korhonen 6 Based on hgExplorer by Jari Korhonen
7 Copyright (c) 2010 Jari Korhonen 7 Copyright (c) 2010 Jari Korhonen
8 Copyright (c) 2012 Chris Cannam 8 Copyright (c) 2013 Chris Cannam
9 Copyright (c) 2012 Queen Mary, University of London 9 Copyright (c) 2013 Queen Mary, University of London
10 10
11 This program is free software; you can redistribute it and/or 11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as 12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2 of the 13 published by the Free Software Foundation; either version 2 of the
14 License, or (at your option) any later version. See the file 14 License, or (at your option) any later version. See the file
152 const FSEventStreamEventId eventIDs[]) 152 const FSEventStreamEventId eventIDs[])
153 { 153 {
154 FsWatcher *watcher = reinterpret_cast<FsWatcher *>(clientCallBackInfo); 154 FsWatcher *watcher = reinterpret_cast<FsWatcher *>(clientCallBackInfo);
155 const char *const *cpaths = reinterpret_cast<const char *const *>(paths); 155 const char *const *cpaths = reinterpret_cast<const char *const *>(paths);
156 for (size_t i = 0; i < numEvents; ++i) { 156 for (size_t i = 0; i < numEvents; ++i) {
157 #ifdef DEBUG_FSWATCHER
157 std::cerr << "path " << i << " = " << cpaths[i] << std::endl; 158 std::cerr << "path " << i << " = " << cpaths[i] << std::endl;
159 #endif
158 watcher->fsDirectoryChanged(QString::fromLocal8Bit(cpaths[i])); 160 watcher->fsDirectoryChanged(QString::fromLocal8Bit(cpaths[i]));
159 } 161 }
160 } 162 }
161 #endif 163 #endif
162 164
369 371
370 #ifdef Q_OS_MAC 372 #ifdef Q_OS_MAC
371 bool 373 bool
372 FsWatcher::manuallyCheckTrackedFiles() 374 FsWatcher::manuallyCheckTrackedFiles()
373 { 375 {
376 #ifdef DEBUG_FSWATCHER
374 std::cerr << "FsWatcher::manuallyCheckTrackedFiles" << std::endl; 377 std::cerr << "FsWatcher::manuallyCheckTrackedFiles" << std::endl;
378 #endif
375 bool foundChanges = false; 379 bool foundChanges = false;
376 380
377 for (PathTimeMap::iterator i = m_trackedFileUpdates.begin(); 381 for (PathTimeMap::iterator i = m_trackedFileUpdates.begin();
378 i != m_trackedFileUpdates.end(); ++i) { 382 i != m_trackedFileUpdates.end(); ++i) {
379 383