| 224 | } |
| 225 | |
| 226 | static bool isParentPath(const QVector<QString>& parent, const QVector<QString>& child, bool direct) |
| 227 | { |
| 228 | if (direct && child.size() != parent.size() + 1) { |
| 229 | return false; |
| 230 | } else if (!direct && child.size() <= parent.size()) { |
| 231 | return false; |
| 232 | } |
| 233 | for (int i = 0; i < parent.size(); ++i) { |
| 234 | if (child.at(i) != parent.at(i)) { |
| 235 | // support for trailing '/' |
| 236 | if (i + 1 == parent.size() && parent.at(i).isEmpty()) { |
| 237 | return true; |
| 238 | } |
| 239 | // otherwise we take a different branch here |
| 240 | return false; |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | return true; |
| 245 | } |
| 246 | |
| 247 | bool Path::isParentOf(const Path& path) const |
| 248 | { |
no test coverage detected