| 680 | } |
| 681 | |
| 682 | QString WizDocumentOperatorPrivate::getUniqueFolderName(const QString& parentLocation, const QString& locationName) |
| 683 | { |
| 684 | QString name = locationName; |
| 685 | int nRepeat = 0; |
| 686 | WizDatabase& db = WizDatabaseManager::instance()->db(); |
| 687 | CWizStdStringArray arrayAllLocations; |
| 688 | if (!db.getAllLocations(arrayAllLocations)) |
| 689 | return ""; |
| 690 | CWizStdStringArray arrayChild; |
| 691 | if (!db.getChildLocations(arrayAllLocations, parentLocation, arrayChild)) |
| 692 | return ""; |
| 693 | |
| 694 | while (true) |
| 695 | { |
| 696 | if (nRepeat > 0) |
| 697 | { |
| 698 | name = locationName + "_" + QString::number(nRepeat); |
| 699 | } |
| 700 | bool continueLoop = false; |
| 701 | CWizStdStringArray::const_iterator it; |
| 702 | for (it = arrayChild.begin(); it != arrayChild.end(); it++) |
| 703 | { |
| 704 | QString brotherLocation = *it; |
| 705 | if (WizDatabase::getLocationName(brotherLocation) == name) |
| 706 | { |
| 707 | nRepeat ++; |
| 708 | continueLoop = true; |
| 709 | break; |
| 710 | } |
| 711 | } |
| 712 | if (!continueLoop) |
| 713 | break; |
| 714 | } |
| 715 | return name; |
| 716 | } |
| 717 | |
| 718 | QString WizDocumentOperatorPrivate::getUniqueFolderName(const WIZTAGDATA& parentTag, const WIZTAGDATA& sourceTag, bool combineFolder, const QString& exceptGUID) |
| 719 | { |
nothing calls this directly
no test coverage detected