| 306 | {} |
| 307 | |
| 308 | QString CommandChangeOutputFormat::getFileFormatFilter(ccCommandLineInterface& cmd, QString& defaultExt) |
| 309 | { |
| 310 | QString fileFilter; |
| 311 | defaultExt.clear(); |
| 312 | |
| 313 | if (!cmd.arguments().isEmpty()) |
| 314 | { |
| 315 | //test if the specified format corresponds to a known file type |
| 316 | QString extension = cmd.arguments().front().toUpper(); |
| 317 | cmd.arguments().pop_front(); |
| 318 | |
| 319 | const FileIOFilter::FilterContainer& filters = FileIOFilter::GetFilters(); |
| 320 | |
| 321 | for (const auto & filter : filters) |
| 322 | { |
| 323 | if (extension == filter->getDefaultExtension().toUpper()) |
| 324 | { |
| 325 | //found a matching filter |
| 326 | fileFilter = filter->getFileFilters(false).first(); |
| 327 | defaultExt = filter->getDefaultExtension(); |
| 328 | break; |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | //haven't found anything? |
| 333 | if (fileFilter.isEmpty()) |
| 334 | { |
| 335 | cmd.error(QObject::tr("Unhandled format specifier (%1)").arg(extension)); |
| 336 | } |
| 337 | } |
| 338 | else |
| 339 | { |
| 340 | cmd.error(QObject::tr("Missing file format specifier!")); |
| 341 | } |
| 342 | |
| 343 | return fileFilter; |
| 344 | } |
| 345 | |
| 346 | CommandChangeCloudOutputFormat::CommandChangeCloudOutputFormat() |
| 347 | : CommandChangeOutputFormat(QObject::tr("Change cloud output format"), COMMAND_CLOUD_EXPORT_FORMAT) |
nothing calls this directly
no test coverage detected