本文整理汇总了C++中kurl::List::fromLast方法的典型用法代码示例。如果您正苦于以下问题:C++ List::fromLast方法的具体用法?C++ List::fromLast怎么用?C++ List::fromLast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kurl::List
的用法示例。
在下文中一共展示了List::fromLast方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slaveProtocol
QString KProtocolManager::slaveProtocol(const KURL &url, QString &proxy)
{
if(url.hasSubURL()) // We don't want the suburl's protocol
{
KURL::List list = KURL::split(url);
KURL::List::Iterator it = list.fromLast();
return slaveProtocol(*it, proxy);
}
if(!d)
d = new KProtocolManagerPrivate;
if(d->url == url)
{
proxy = d->proxy;
return d->protocol;
}
if(useProxy())
{
proxy = proxyForURL(url);
if((proxy != "DIRECT") && (!proxy.isEmpty()))
{
bool isRevMatch = false;
KProtocolManager::ProxyType type = proxyType();
bool useRevProxy = ((type == ManualProxy) && useReverseProxy());
QString noProxy;
// Check no proxy information iff the proxy type is either
// ManualProxy or EnvVarProxy
if((type == ManualProxy) || (type == EnvVarProxy))
noProxy = noProxyFor();
if(!noProxy.isEmpty())
{
QString qhost = url.host().lower();
const char *host = qhost.latin1();
QString qno_proxy = noProxy.stripWhiteSpace().lower();
const char *no_proxy = qno_proxy.latin1();
isRevMatch = revmatch(host, no_proxy);
// If no match is found and the request url has a port
// number, try the combination of "host:port". This allows
// users to enter host:port in the No-proxy-For list.
if(!isRevMatch && url.port() > 0)
{
qhost += ':' + QString::number(url.port());
host = qhost.latin1();
isRevMatch = revmatch(host, no_proxy);
}
// If the hostname does not contain a dot, check if
// <local> is part of noProxy.
if(!isRevMatch && host && (strchr(host, '.') == NULL))
isRevMatch = revmatch("<local>", no_proxy);
}
if((!useRevProxy && !isRevMatch) || (useRevProxy && isRevMatch))
{
d->url = proxy;
if(d->url.isValid())
{
// The idea behind slave protocols is not applicable to http
// and webdav protocols.
QString protocol = url.protocol().lower();
if(protocol.startsWith("http") || protocol.startsWith("webdav"))
d->protocol = protocol;
else
{
d->protocol = d->url.protocol();
kdDebug() << "slaveProtocol: " << d->protocol << endl;
}
d->url = url;
d->proxy = proxy;
return d->protocol;
}
}
}
}
d->url = url;
d->proxy = proxy = QString::null;
d->protocol = url.protocol();
return d->protocol;
}