comparison data/fileio/CachedFile.cpp @ 843:e802e550a1f2

Drop std:: from cout, cerr, endl -- pull these in through Debug.h
author Chris Cannam
date Tue, 26 Nov 2013 13:35:08 +0000
parents b99dc5465b80
children f2fcb3ed51fa
comparison
equal deleted inserted replaced
842:23d3a6eca5c3 843:e802e550a1f2
155 155
156 if (retrieve()) { 156 if (retrieve()) {
157 SVDEBUG << "CachedFile::check: Retrieval succeeded" << endl; 157 SVDEBUG << "CachedFile::check: Retrieval succeeded" << endl;
158 updateLastRetrieval(true); 158 updateLastRetrieval(true);
159 } else { 159 } else {
160 std::cerr << "CachedFile::check: Retrieval failed, will try again later (using existing file for now)" << std::endl; 160 cerr << "CachedFile::check: Retrieval failed, will try again later (using existing file for now)" << endl;
161 } 161 }
162 } 162 }
163 } else { 163 } else {
164 SVDEBUG << "CachedFile::check: No valid last retrieval" << endl; 164 SVDEBUG << "CachedFile::check: No valid last retrieval" << endl;
165 // there is no acceptable file 165 // there is no acceptable file
166 if (retrieve()) { 166 if (retrieve()) {
167 SVDEBUG << "CachedFile::check: Retrieval succeeded" << endl; 167 SVDEBUG << "CachedFile::check: Retrieval succeeded" << endl;
168 m_ok = true; 168 m_ok = true;
169 updateLastRetrieval(true); 169 updateLastRetrieval(true);
170 } else { 170 } else {
171 std::cerr << "CachedFile::check: Retrieval failed, remaining in invalid state" << std::endl; 171 cerr << "CachedFile::check: Retrieval failed, remaining in invalid state" << endl;
172 // again, we don't need to do anything here -- the last 172 // again, we don't need to do anything here -- the last
173 // retrieval timestamp is already invalid 173 // retrieval timestamp is already invalid
174 } 174 }
175 } 175 }
176 176
210 } 210 }
211 211
212 QFile previous(m_localFilename); 212 QFile previous(m_localFilename);
213 if (previous.exists()) { 213 if (previous.exists()) {
214 if (!previous.remove()) { 214 if (!previous.remove()) {
215 std::cerr << "CachedFile::retrieve: ERROR: Failed to remove previous copy of cached file at \"" << m_localFilename << "\"" << std::endl; 215 cerr << "CachedFile::retrieve: ERROR: Failed to remove previous copy of cached file at \"" << m_localFilename << "\"" << endl;
216 return false; 216 return false;
217 } 217 }
218 } 218 }
219 219
220 //!!! This is not ideal, could leave us with nothing (old file 220 //!!! This is not ideal, could leave us with nothing (old file
221 //!!! removed, new file not able to be copied in because e.g. no 221 //!!! removed, new file not able to be copied in because e.g. no
222 //!!! disk space left) 222 //!!! disk space left)
223 223
224 if (!tempFile.copy(m_localFilename)) { 224 if (!tempFile.copy(m_localFilename)) {
225 std::cerr << "CachedFile::retrieve: ERROR: Failed to copy newly retrieved file from \"" << tempName << "\" to \"" << m_localFilename << "\"" << std::endl; 225 cerr << "CachedFile::retrieve: ERROR: Failed to copy newly retrieved file from \"" << tempName << "\" to \"" << m_localFilename << "\"" << endl;
226 return false; 226 return false;
227 } 227 }
228 228
229 SVDEBUG << "CachedFile::retrieve: Successfully copied newly retrieved file \"" << tempName << "\" to its home at \"" << m_localFilename << "\"" << endl; 229 SVDEBUG << "CachedFile::retrieve: Successfully copied newly retrieved file \"" << tempName << "\" to its home at \"" << m_localFilename << "\"" << endl;
230 230