本文整理汇总了C++中KUrl::port方法的典型用法代码示例。如果您正苦于以下问题:C++ KUrl::port方法的具体用法?C++ KUrl::port怎么用?C++ KUrl::port使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KUrl
的用法示例。
在下文中一共展示了KUrl::port方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: splitURL
// The opposite of parseURL
static QString splitURL( int mRealArgType, const KUrl& url )
{
if ( mRealArgType == 33 ) { // LDAP server
// The format is HOSTNAME:PORT:USERNAME:PASSWORD:BASE_DN
Q_ASSERT( url.protocol() == "ldap" );
return urlpart_encode( url.host() ) + ':' +
( url.port() != -1 ? QString::number( url.port() ) : QString() ) + ':' + // -1 is used for default ports, omit
urlpart_encode( url.user() ) + ':' +
urlpart_encode( url.pass() ) + ':' +
// KUrl automatically encoded the query (e.g. for spaces inside it),
// so decode it before writing it out to gpgconf (issue119)
urlpart_encode( KUrl::fromPercentEncoding( url.query().mid(1).toLatin1() ) );
}
return url.path();
}
示例2: RemoteView
VncView::VncView(QWidget *parent, const KUrl &url, KConfigGroup configGroup)
: RemoteView(parent),
m_initDone(false),
m_buttonMask(0),
m_repaint(false),
m_quitFlag(false),
m_firstPasswordTry(true),
m_dontSendClipboard(false),
m_horizontalFactor(1.0),
m_verticalFactor(1.0),
m_forceLocalCursor(false)
{
m_url = url;
m_host = url.host();
m_port = url.port();
// BlockingQueuedConnection can cause deadlocks when exiting, handled in startQuitting()
connect(&vncThread, SIGNAL(imageUpdated(int,int,int,int)), this, SLOT(updateImage(int,int,int,int)), Qt::BlockingQueuedConnection);
connect(&vncThread, SIGNAL(gotCut(QString)), this, SLOT(setCut(QString)), Qt::BlockingQueuedConnection);
connect(&vncThread, SIGNAL(passwordRequest(bool)), this, SLOT(requestPassword(bool)), Qt::BlockingQueuedConnection);
connect(&vncThread, SIGNAL(outputErrorMessage(QString)), this, SLOT(outputErrorMessage(QString)));
m_clipboard = QApplication::clipboard();
connect(m_clipboard, SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged()));
#ifndef QTONLY
m_hostPreferences = new VncHostPreferences(configGroup, this);
#else
Q_UNUSED(configGroup);
#endif
}
示例3:
SecurityOrigin::SecurityOrigin(const KUrl& url) :
m_protocol(url.protocol().toLower())
, m_host(url.host().toLower())
, m_port(url.port())
, m_domainWasSetInDOM(false)
, m_isUnique(false)
{
// These protocols do not create security origins; the owner frame provides the origin
if (m_protocol == "about" || m_protocol == "javascript")
m_protocol = "";
// For edge case URLs that were probably misparsed, make sure that the origin is unique.
if (m_host.isEmpty() && KProtocolInfo::protocolClass(m_protocol) == QLatin1String(":internet"))
m_isUnique = true;
// document.domain starts as m_host, but can be set by the DOM.
m_domain = m_host;
if (url.port() == -1 || isDefaultPortForProtocol(m_port, m_protocol))
m_port = 0;
}
示例4: setValues
void ChooseSocket::setValues(const QVariantHash &args)
{
if (m_args == args) {
return;
}
m_args = args;
ui->addressLE->clear();
ui->portISB->setValue(9100);
QString deviceUri = args[KCUPS_DEVICE_URI].toString();
KUrl url = deviceUri;
if (url.scheme() == QLatin1String("socket")) {
ui->addressLE->setText(url.host());
ui->portISB->setValue(url.port(9100));
}
ui->addressLE->setFocus();
m_isValid = true;
}
示例5: main
int main(int argc, char **argv)
{
KAboutData about("kftpgrabber", 0, ki18n("KFTPgrabber"), version, ki18n(description),
KAboutData::License_GPL, ki18n("(C) 2008, The KFTPgrabber developers"), KLocalizedString(), "http://www.kftp.org");
about.addAuthor(ki18n("Jernej Kos"), ki18n("Lead developer"), "[email protected]");
about.addAuthor(ki18n("Markus Brüffer"), ki18n("Developer"), "[email protected]");
about.addCredit(ki18n("Lee Joseph"), ki18n("Fedora ambassador responsible for promotion, testing and debugging; also a package maintainer for Fedora-compatible distributions"), "[email protected]");
about.addCredit(ki18n("libssh2 Developers"), ki18n("SSH library"), "[email protected]");
about.addCredit(ki18n("Anthony D. Urso"), ki18n("otpCalc code"));
about.addCredit(ki18n("Kopete Developers"), ki18n("KopeteBalloon popup code"), "[email protected]");
about.addCredit(ki18n("KSysGuard Developers"), ki18n("Traffic graph widget"), "[email protected]");
about.addCredit(ki18n("Bob Ziuchkovski"), ki18n("Icon design"), "[email protected]");
about.addCredit(ki18n("Tobias Ussing"), ki18n("Testing and debugging"), "[email protected]");
about.addCredit(ki18n("Tim Kosse"), ki18n("Directory parser code"), "[email protected]");
about.addCredit(ki18n("Peter Penz"), ki18n("Listview column handling code"), "[email protected]");
KCmdLineArgs::init(argc, argv, &about);
KCmdLineOptions options;
options.add("+[url]", ki18n("An optional URL to connect to"));
KCmdLineArgs::addCmdLineOptions(options);
KUniqueApplication app;
if (app.isSessionRestored()) {
RESTORE(MainWindow);
} else {
MainWindow *mainWindow = 0;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
KSplashScreen *splash = 0L;
QString splashPath = KStandardDirs::locate("appdata", "kftpgrabber-logo.png");
if (!KFTPCore::Config::startMinimized() && KFTPCore::Config::showSplash()) {
// Show the splash screen
if (!splashPath.isNull()) {
QPixmap splashImage = QPixmap(splashPath);
splash = new KSplashScreen(splashImage);
splash->setMaximumWidth(400);
splash->show();
}
}
mainWindow = new MainWindow();
if (!KFTPCore::Config::startMinimized())
mainWindow->show();
// Check if an URL was passed as a command line argument
if (args->count() == 1) {
KUrl remoteUrl = args->url(0);
if (!remoteUrl.isLocalFile()) {
if (!remoteUrl.port())
remoteUrl.setPort(21);
if (!remoteUrl.hasUser())
remoteUrl.setUser("anonymous");
if (!remoteUrl.hasPass()) {
if (!KFTPCore::Config::anonMail().isEmpty())
remoteUrl.setPass(KFTPCore::Config::anonMail());
else
remoteUrl.setPass("[email protected]");
}
KFTPSession::Manager::self()->spawnRemoteSession(KFTPSession::IgnoreSide, remoteUrl);
}
}
if (splash != 0L) {
splash->finish(mainWindow);
delete splash;
}
args->clear();
}
return app.exec();
}