本文整理汇总了C++中KUrl::setAuthority方法的典型用法代码示例。如果您正苦于以下问题:C++ KUrl::setAuthority方法的具体用法?C++ KUrl::setAuthority怎么用?C++ KUrl::setAuthority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KUrl
的用法示例。
在下文中一共展示了KUrl::setAuthority方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ServiceBase
AmpacheService::AmpacheService( AmpacheServiceFactory* parent, const QString & name, const QString &url, const QString &username, const QString &password )
: ServiceBase( name, parent )
, m_authenticated( false )
, m_server ( QString() )
, m_sessionId ( QString() )
, m_collection( 0 )
{
DEBUG_BLOCK
setShortDescription( i18n( "Use Amarok as a seamless frontend to your Ampache server." ) );
setIcon( KIcon( "view-services-ampache-amarok" ) );
//we are using http queries later on, so we require
KUrl kurl;
if( url.contains( "//" ) )
{
kurl.setUrl( url, KUrl::TolerantMode );
if( kurl.protocol() != "http" && kurl.protocol() != "https" )
{
kurl.setProtocol( "http" );
}
}
else
{
kurl.setProtocol( "http" );
kurl.setAuthority( url );
}
m_server = kurl.url();
// We need to check the version of Ampache we are attempting to authenticate against, as this changes how we deal with it
QString versionString = "<server>/server/xml.server.php?action=ping";
versionString.replace(QString("<server>"), m_server);
debug() << "Verifying Ampache Version Using: " << versionString;
m_username = username;
m_password = password;
m_xmlVersionJob = KIO::storedGet( versionString, KIO::Reload, KIO::HideProgressInfo );
connect( m_xmlVersionJob, SIGNAL(result(KJob *)), this, SLOT( authenticate(KJob *) ) );
}