AtomicString SVGURLReferenceResolver::fragmentIdentifier() const { // If this is a "fragment-only" URL, then the reference is always local, so // just return what's after the '#' as the fragment. if (m_isLocal) return AtomicString(m_relativeUrl.substring(1)); return AtomicString(absoluteUrl().fragmentIdentifier()); }
QString const LinkStatus::toString() const { QString aux; if(!is_root_) { Q_ASSERT(parent_); aux += i18n( "Parent: %1" ).arg( parent()->absoluteUrl().prettyURL() ) + "\n"; } Q_ASSERT(!original_url_.isNull()); aux += i18n( "URL: %1" ).arg( absoluteUrl().prettyURL() ) + "\n"; aux += i18n( "Original URL: %1" ).arg( originalUrl() ) + "\n"; if(node()) aux += i18n( "Node: %1" ).arg( node()->content() ) + "\n"; return aux; }
void LinkStatus::save(QDomElement& element) const { QDomElement child_element = element.ownerDocument().createElement("link"); // <url> QDomElement tmp_1 = element.ownerDocument().createElement("url"); tmp_1.appendChild(element.ownerDocument().createTextNode(absoluteUrl().prettyURL())); child_element.appendChild(tmp_1); // <status> tmp_1 = element.ownerDocument().createElement("status"); tmp_1.setAttribute("broken", ResultView::displayableWithStatus(this, ResultView::bad) ? "true" : "false"); tmp_1.appendChild(element.ownerDocument().createTextNode(statusText())); child_element.appendChild(tmp_1); // <label> tmp_1 = element.ownerDocument().createElement("label"); tmp_1.appendChild(element.ownerDocument().createTextNode(KCharsets::resolveEntities(label()))); child_element.appendChild(tmp_1); // <referers> tmp_1 = element.ownerDocument().createElement("referrers"); for(QValueVector<KURL>::const_iterator it = referrers_.begin(); it != referrers_.end(); ++it) { QDomElement tmp_2 = element.ownerDocument().createElement("url"); tmp_2.appendChild(element.ownerDocument().createTextNode(it->prettyURL())); tmp_1.appendChild(tmp_2); } Q_ASSERT(!referrers_.isEmpty()); child_element.appendChild(tmp_1); element.appendChild(child_element); }
bool SVGURLReferenceResolver::isLocal() const { return m_isLocal || equalIgnoringFragmentIdentifier(absoluteUrl(), m_document->url()); }