| 103 | } |
| 104 | |
| 105 | bool FileSystemChangeNotifier::removeNotification( const Path &path, ChangeDelegate callback ) |
| 106 | { |
| 107 | if (path.isEmpty()) |
| 108 | return false; |
| 109 | |
| 110 | // strip the filename and extension - we notify on dirs |
| 111 | Path dir(cleanPath(path)); |
| 112 | if (dir.isEmpty()) |
| 113 | return false; |
| 114 | |
| 115 | dir.setFileName( String() ); |
| 116 | dir.setExtension( String () ); |
| 117 | |
| 118 | DirMap::Iterator itr = mDirMap.find( dir ); |
| 119 | |
| 120 | if ( itr == mDirMap.end() ) |
| 121 | return false; |
| 122 | |
| 123 | FileInfoList &fileList = itr->value; |
| 124 | |
| 125 | // look for the file and return if we find it |
| 126 | for ( U32 i = 0; i < fileList.getSize(); i++ ) |
| 127 | { |
| 128 | FileInfo &fInfo = fileList[i]; |
| 129 | if ( fInfo.filePath == path ) |
| 130 | { |
| 131 | fInfo.signal.remove(callback); |
| 132 | if (fInfo.signal.isEmpty()) |
| 133 | fileList.erase( i ); |
| 134 | break; |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | // IF we removed the last file |
| 139 | // THEN get rid of the dir from our map and notify inherited classes |
| 140 | if ( fileList.getSize() == 0 ) |
| 141 | { |
| 142 | mDirMap.erase( dir ); |
| 143 | |
| 144 | return internalRemoveNotification( dir ); |
| 145 | } |
| 146 | |
| 147 | return true; |
| 148 | } |
| 149 | |
| 150 | void FileSystemChangeNotifier::startNotifier() |
| 151 | { |
no test coverage detected