| 1232 | |
| 1233 | |
| 1234 | QString Application::defaultUserImagesFolderPath() |
| 1235 | // ---------------------------------------------------------------------------- |
| 1236 | // Try to guess the best Images folder to use by default |
| 1237 | // ---------------------------------------------------------------------------- |
| 1238 | { |
| 1239 | #ifdef CONFIG_MINGW |
| 1240 | // Looking at the Windows registry |
| 1241 | QSettings settings( |
| 1242 | "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows" |
| 1243 | "\\CurrentVersion\\Explorer", |
| 1244 | QSettings::NativeFormat); |
| 1245 | // For Windows Vista/7 |
| 1246 | // Typically C:\Users\username\Documents\Pictures |
| 1247 | // For Windows XP |
| 1248 | // Typically C:\Documents and Settings\username\My Documents\My Pictures |
| 1249 | QString path = settings.value("User Shell Folders\\My Pictures") |
| 1250 | .toString(); |
| 1251 | if (!path.isNull()) |
| 1252 | { |
| 1253 | return QDir::toNativeSeparators(path); |
| 1254 | } |
| 1255 | #endif // CONFIG_MINGW |
| 1256 | |
| 1257 | // Trying to find a home sub-directory ending with "pictures" |
| 1258 | QFileInfoList list = QDir::home().entryInfoList( |
| 1259 | QDir::NoDotAndDotDot | QDir::Dirs ); |
| 1260 | for (int i = 0; i < list.size(); i++) |
| 1261 | { |
| 1262 | QFileInfo info = list[i]; |
| 1263 | if (info.fileName().endsWith("pictures", Qt::CaseInsensitive) ) |
| 1264 | { |
| 1265 | return QDir::toNativeSeparators(info.absoluteFilePath()); |
| 1266 | } |
| 1267 | } |
| 1268 | // Last default would be home itself |
| 1269 | return QDir::toNativeSeparators(QDir::homePath()); |
| 1270 | } |
| 1271 | |
| 1272 | |
| 1273 | bool Application::createDefaultProjectFolder() |