MCPcopy Create free account
hub / github.com/KDE/krusader / checkExcludeURLValidity

Method checkExcludeURLValidity

app/Synchronizer/synchronizergui.cpp:636–661  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

634}
635
636void 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
663void SynchronizerGUI::doubleClicked(QTreeWidgetItem *itemIn)
664{

Callers

nothing calls this directly

Calls 1

pathMethod · 0.45

Tested by

no test coverage detected