comparison base/TempDirectory.cpp @ 686:b4a8d8221eaf debug-output

Remove most toStdString calls (no longer needed, with debug header)
author Chris Cannam
date Thu, 12 May 2011 17:31:24 +0100
parents 27cdabba2d3e
children 06f13a3b9e9e
comparison
equal deleted inserted replaced
685:99222d4bfc78 686:b4a8d8221eaf
206 cleanupDirectory(fi.absoluteFilePath()); 206 cleanupDirectory(fi.absoluteFilePath());
207 } else { 207 } else {
208 if (!QFile(fi.absoluteFilePath()).remove()) { 208 if (!QFile(fi.absoluteFilePath()).remove()) {
209 std::cerr << "WARNING: TempDirectory::cleanup: " 209 std::cerr << "WARNING: TempDirectory::cleanup: "
210 << "Failed to unlink file \"" 210 << "Failed to unlink file \""
211 << fi.absoluteFilePath().toStdString() << "\"" 211 << fi.absoluteFilePath() << "\""
212 << std::endl; 212 << std::endl;
213 } 213 }
214 } 214 }
215 } 215 }
216 216
217 QString dirname = dir.dirName(); 217 QString dirname = dir.dirName();
218 if (dirname != "") { 218 if (dirname != "") {
219 if (!dir.cdUp()) { 219 if (!dir.cdUp()) {
220 std::cerr << "WARNING: TempDirectory::cleanup: " 220 std::cerr << "WARNING: TempDirectory::cleanup: "
221 << "Failed to cd to parent directory of " 221 << "Failed to cd to parent directory of "
222 << tmpdir.toStdString() << std::endl; 222 << tmpdir << std::endl;
223 return; 223 return;
224 } 224 }
225 if (!dir.rmdir(dirname)) { 225 if (!dir.rmdir(dirname)) {
226 std::cerr << "WARNING: TempDirectory::cleanup: " 226 std::cerr << "WARNING: TempDirectory::cleanup: "
227 << "Failed to remove directory " 227 << "Failed to remove directory "
228 << dirname.toStdString() << std::endl; 228 << dirname << std::endl;
229 } 229 }
230 } 230 }
231 231
232 if (isRoot) { 232 if (isRoot) {
233 m_tmpdir = ""; 233 m_tmpdir = "";
246 246
247 QDir subdir(dirpath, "*.pid", QDir::Name, QDir::Files); 247 QDir subdir(dirpath, "*.pid", QDir::Name, QDir::Files);
248 248
249 if (subdir.count() == 0) { 249 if (subdir.count() == 0) {
250 std::cerr << "INFO: Found temporary directory with no .pid file in it!\n(directory=\"" 250 std::cerr << "INFO: Found temporary directory with no .pid file in it!\n(directory=\""
251 << dirpath.toStdString() << "\"). Removing it..." << std::endl; 251 << dirpath << "\"). Removing it..." << std::endl;
252 cleanupDirectory(dirpath); 252 cleanupDirectory(dirpath);
253 std::cerr << "...done." << std::endl; 253 std::cerr << "...done." << std::endl;
254 continue; 254 continue;
255 } 255 }
256 256