* @brief Format Result column data. * @param [in] pCtxt Pointer to compare context. * @param [in] p Pointer to DIFFITEM. * @return String to show in the column. */
| 337 | * @return String to show in the column. |
| 338 | */ |
| 339 | static String ColStatusGet(const CDiffContext *pCtxt, const void *p, int) |
| 340 | { |
| 341 | const DIFFITEM &di = *static_cast<const DIFFITEM*>(p); |
| 342 | int nDirs = pCtxt->GetCompareDirs(); |
| 343 | // Note that order of items does matter. We must check for |
| 344 | // skipped items before unique items, for example, so that |
| 345 | // skipped unique items are labeled as skipped, not unique. |
| 346 | String s; |
| 347 | bool bAddCompareFlags3WayString = false; |
| 348 | if (di.diffcode.isResultError()) |
| 349 | { |
| 350 | s = _("Unable to compare files"); |
| 351 | } |
| 352 | else if (di.diffcode.isResultAbort()) |
| 353 | { |
| 354 | s = _("Item aborted"); |
| 355 | } |
| 356 | else if (di.diffcode.isResultFiltered()) |
| 357 | { |
| 358 | if (di.diffcode.isDirectory()) |
| 359 | s = _("Folder skipped"); |
| 360 | else |
| 361 | s = _("File skipped"); |
| 362 | } |
| 363 | else if (di.renameMoveGroupId != -1) |
| 364 | { |
| 365 | s = ColStatusGetRenamedMoved(pCtxt, di); |
| 366 | } |
| 367 | else if (di.diffcode.isSideFirstOnly()) |
| 368 | { |
| 369 | s = strutils::format_string1(_("Left only: %1"), |
| 370 | di.getFilepath(0, pCtxt->GetNormalizedLeft())); |
| 371 | } |
| 372 | else if (di.diffcode.isSideSecondOnly()) |
| 373 | { |
| 374 | if (nDirs < 3) |
| 375 | { |
| 376 | s = strutils::format_string1(_("Right only: %1"), |
| 377 | di.getFilepath(1, pCtxt->GetNormalizedRight())); |
| 378 | } |
| 379 | else |
| 380 | { |
| 381 | s = strutils::format_string1(_("Middle only: %1"), |
| 382 | di.getFilepath(1, pCtxt->GetNormalizedMiddle())); |
| 383 | } |
| 384 | } |
| 385 | else if (di.diffcode.isSideThirdOnly()) |
| 386 | { |
| 387 | s = strutils::format_string1(_("Right only: %1"), |
| 388 | di.getFilepath(2, pCtxt->GetNormalizedRight())); |
| 389 | } |
| 390 | else if (nDirs > 2 && !di.diffcode.existsFirst()) |
| 391 | { |
| 392 | s = strutils::format_string1(_("Does not exist in %1"), |
| 393 | pCtxt->GetNormalizedLeft()); |
| 394 | bAddCompareFlags3WayString = true; |
| 395 | } |
| 396 | else if (nDirs > 2 && !di.diffcode.existsSecond()) |
nothing calls this directly
no test coverage detected