comparison base/ResourceFinder.cpp @ 711:45e3ba1d5a1f library_integration

Merge from the default branch
author Chris Cannam
date Tue, 11 Oct 2011 11:14:38 +0100
parents 9a0272c2d596
children 66c3f4e060e9
comparison
equal deleted inserted replaced
710:773f228f080d 711:45e3ba1d5a1f
100 home = QString("%1%2").arg(homedrive).arg(homepath); 100 home = QString("%1%2").arg(homedrive).arg(homepath);
101 } else { 101 } else {
102 home = QDir::home().absolutePath(); 102 home = QDir::home().absolutePath();
103 } 103 }
104 if (home == "") return ""; 104 if (home == "") return "";
105 return QString("%1/.%2").arg(qApp->applicationName()); //!!! wrong 105 return QString("%1/.%2").arg(home).arg(qApp->applicationName()); //!!! wrong
106 #else 106 #else
107 char *home = getenv("HOME"); 107 char *home = getenv("HOME");
108 if (!home || !home[0]) return ""; 108 if (!home || !home[0]) return "";
109 #ifdef Q_OS_MAC 109 #ifdef Q_OS_MAC
110 return QString("%1/Library/Application Support/%2/%3") 110 return QString("%1/Library/Application Support/%2/%3")
284 if (!file.copy(target)) { 284 if (!file.copy(target)) {
285 std::cerr << "ResourceFinder::unbundleResource: ERROR: Failed to un-bundle resource file \"" << fileName << "\" to user location \"" << target << "\"" << std::endl; 285 std::cerr << "ResourceFinder::unbundleResource: ERROR: Failed to un-bundle resource file \"" << fileName << "\" to user location \"" << target << "\"" << std::endl;
286 return false; 286 return false;
287 } 287 }
288 288
289 // Now since the file is in the user's editable space, the user should get
290 // to edit it. The chords.xml file I unbundled came out 444 instead of 644
291 // which won't do. Rather than put the chmod code there, I decided to put
292 // it here, because I think it will always be appropriate to make unbundled
293 // files editable. That's rather the point in many cases, and for the rest,
294 // nobody will likely notice they could have edited their font files or what
295 // have you that were unbundled to improve performance. (Dissenting
296 // opinions welcome. We can always shuffle this somewhere else if
297 // necessary. There are many possibilities.)
298 QFile chmod(target); 289 QFile chmod(target);
299 chmod.setPermissions(QFile::ReadOwner | 290 chmod.setPermissions(QFile::ReadOwner |
300 QFile::ReadUser | /* for potential platform-independence */ 291 QFile::ReadUser | /* for potential platform-independence */
301 QFile::ReadGroup | 292 QFile::ReadGroup |
302 QFile::ReadOther | 293 QFile::ReadOther |