! Find direct child locations of \a strParentLocation from \a arrayAllLocation, then store unique set in \a arrayLocation. If \a strParentLocation is empty, then the unique root locations of \a arrayAllLocation is returned. */
| 3814 | then the unique root locations of \a arrayAllLocation is returned. |
| 3815 | */ |
| 3816 | bool WizDatabase::getChildLocations(const CWizStdStringArray& arrayAllLocation, \ |
| 3817 | const QString& strParentLocation, \ |
| 3818 | CWizStdStringArray& arrayLocation) |
| 3819 | { |
| 3820 | if (strParentLocation.isEmpty()) |
| 3821 | return getAllRootLocations(arrayAllLocation, arrayLocation); |
| 3822 | |
| 3823 | std::set<QString> setLocation; |
| 3824 | |
| 3825 | CWizStdStringArray::const_iterator it; |
| 3826 | for (it = arrayAllLocation.begin(); it != arrayAllLocation.end(); it++) { |
| 3827 | const QString& location = *it; |
| 3828 | |
| 3829 | if (location.length() > strParentLocation.length() && location.startsWith(strParentLocation)) |
| 3830 | { |
| 3831 | int index = location.indexOf('/', strParentLocation.length() + 1); |
| 3832 | if (index > 0) |
| 3833 | { |
| 3834 | QString strChild = location.left(index + 1); |
| 3835 | setLocation.insert(strChild); |
| 3836 | } |
| 3837 | } |
| 3838 | } |
| 3839 | |
| 3840 | arrayLocation.assign(setLocation.begin(), setLocation.end()); |
| 3841 | |
| 3842 | return true; |
| 3843 | } |
| 3844 | |
| 3845 | bool WizDatabase::isInDeletedItems(const CString& strLocation) |
| 3846 | { |
no test coverage detected