| 634 | } |
| 635 | |
| 636 | void SynchronizerGUI::checkExcludeURLValidity(QString &text, QString &error) |
| 637 | { |
| 638 | QUrl url = Synchronizer::fsUrl(text); |
| 639 | if (url.isRelative()) |
| 640 | return; |
| 641 | |
| 642 | QString leftBase = leftLocation->currentText(); |
| 643 | if (!leftBase.endsWith('/')) |
| 644 | leftBase += '/'; |
| 645 | QUrl leftBaseURL = Synchronizer::fsUrl(leftBase); |
| 646 | if (leftBaseURL.isParentOf(url) && !url.isParentOf(leftBaseURL)) { |
| 647 | text = QDir(leftBaseURL.path()).relativeFilePath(url.path()); |
| 648 | return; |
| 649 | } |
| 650 | |
| 651 | QString rightBase = rightLocation->currentText(); |
| 652 | if (!rightBase.endsWith('/')) |
| 653 | rightBase += '/'; |
| 654 | QUrl rightBaseURL = Synchronizer::fsUrl(rightBase); |
| 655 | if (rightBaseURL.isParentOf(url) && !url.isParentOf(rightBaseURL)) { |
| 656 | text = QDir(rightBaseURL.path()).relativeFilePath(url.path()); |
| 657 | return; |
| 658 | } |
| 659 | |
| 660 | error = i18n("URL must be the descendant of either the left or the right base URL."); |
| 661 | } |
| 662 | |
| 663 | void SynchronizerGUI::doubleClicked(QTreeWidgetItem *itemIn) |
| 664 | { |