KIO
kprotocolmanager.cpp
23 #undef interface // windows.h defines this, breaks QtDBus since it has parameters named interface
92 if (nptr[-1] == '/' && hptr == host) { // "bugs.kde.org" vs "http://bugs.kde.org", the config UI says URLs are ok
179 const bool useNoProxyList = (type == KProtocolManager::ManualProxy || type == KProtocolManager::EnvVarProxy);
416 return http_config().readPathEntry("CacheDir", QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1String("/kio_http"));
527 const QString proxy(QString::fromLocal8Bit(qgetenv(proxyVar.toLocal8Bit().constData())).trimmed());
565 QDBusInterface(QStringLiteral("org.kde.kded5"), QStringLiteral("/modules/proxyscout"), QStringLiteral("org.kde.KPAC.ProxyScout"))
606 QDBusInterface(QStringLiteral("org.kde.kded5"), QStringLiteral("/modules/proxyscout")).asyncCall(QStringLiteral("blackListProxy"), proxy);
718 const QString sendUserAgent = KIO::WorkerConfig::self()->configData(QStringLiteral("http"), hostname.toLower(), QStringLiteral("SendUserAgent")).toLower();
723 const QString useragent = KIO::WorkerConfig::self()->configData(QStringLiteral("http"), hostname.toLower(), QStringLiteral("UserAgent"));
736 const QString modifiers = KIO::WorkerConfig::self()->configData(QStringLiteral("http"), QString(), QStringLiteral("UserAgentKeys"));
804 + QLatin1String("KIO/%1.%2 ").arg(QString::number(KIO_VERSION_MAJOR), QString::number(KIO_VERSION_MINOR))
811 QString KProtocolManager::userAgentForApplication(const QString &appName, const QString &appVersion, const QStringList &extraInfo)
830 return (appName + QLatin1Char('/') + appVersion + QStringLiteral(" (") + info + QLatin1Char(')'));
833 bool KProtocolManager::getSystemNameVersionAndMachine(QString &systemName, QString &systemVersion, QString &machine)
841 // try calling GetVersionEx using the OSVERSIONINFOEX, if that fails, try using the OSVERSIONINFO
1170 KProtocolInfo::FileNameUsedForCopying KProtocolManager::fileNameUsedForCopying(const QUrl &url)
1195 const QList<KProtocolInfoPrivate *> allProtocols = KProtocolInfoFactory::self()->allProtocols();
1208 return KIO::WorkerConfig::self()->configData(url.scheme(), url.host(), QStringLiteral("Charset"));
Q_OBJECTQ_OBJECT
T & first()
static bool supportsMakeDir(const QUrl &url)
Returns whether the protocol can create directories/folders.
Definition: kprotocolmanager.cpp:1060
QString readEntry(const char *key, const char *aDefault=nullptr) const
static bool canCopyToFile(const QUrl &url)
Returns whether the protocol can copy files/objects directly to the filesystem itself.
Definition: kprotocolmanager.cpp:1130
static bool canRenameFromFile(const QUrl &url)
Returns whether the protocol can rename (i.e.
Definition: kprotocolmanager.cpp:1140
static ProxyAuthMode proxyAuthMode()
Returns the way proxy authorization should be handled.
Definition: kprotocolmanager.cpp:384
static bool supportsPermissions(const QUrl &url)
Returns whether the protocol suppports KIO/POSIX permissions handling.
Definition: kprotocolmanager.cpp:1211
static bool supportsReading(const QUrl &url)
Returns whether the protocol can retrieve data from URLs.
Definition: kprotocolmanager.cpp:1040
QString number(int n, int base)
QStringView right(qsizetype length) const const
QString fromUtf8(const char *str, int size)
QPair< QHostAddress, int > parseSubnet(const QString &subnet)
NoGlobals
CaseInsensitive
static QStringList proxiesForUrl(const QUrl &url)
Returns all the possible proxy server addresses for url.
Definition: kprotocolmanager.cpp:548
static void reparseConfiguration()
Force a reload of the general config file of KIO workers ( kioslaverc).
Definition: kprotocolmanager.cpp:257
Type type(const QSqlDatabase &db)
QString scheme() const const
QList< QNetworkProxy > systemProxyForQuery(const QNetworkProxyQuery &query)
int count(const T &value) const const
static int readTimeout()
Returns the preferred timeout value for reading from remote connections in seconds.
Definition: kprotocolmanager.cpp:327
bool contains(const QString &str, Qt::CaseSensitivity cs) const const
QString trimmed() const const
QString url(QUrl::FormattingOptions options) const const
QString arg(Args &&... args) const const
QStringView mid(qsizetype start) const const
static QString slaveProtocol(const QUrl &url, QString &proxy)
Return the protocol to use in order to handle the given url It's usually the same,...
Definition: kprotocolmanager.cpp:617
void chop(int n)
static bool canDeleteRecursive(const QUrl &url)
Returns whether the protocol can recursively delete directories by itself.
Definition: kprotocolmanager.cpp:1160
static bool supportsMoving(const QUrl &url)
Returns whether the protocol can move files/objects between different locations.
Definition: kprotocolmanager.cpp:1090
applicationVersion
void setHost(const QString &host, QUrl::ParsingMode mode)
QString writableLocation(QStandardPaths::StandardLocation type)
QStringView::const_iterator cbegin() const const
QByteArray toLatin1() const const
static int maxCacheAge()
Returns the maximum age in seconds cached files should be kept before they are deleted as necessary.
Definition: kprotocolmanager.cpp:419
QDBusMessage call(const QString &method, Args &&... args)
QStringView::const_iterator cend() const const
static bool supportsTruncating(const QUrl &url)
Returns whether the protocol can be truncated with FileJob::truncate(KIO::filesize_t length).
Definition: kprotocolmanager.cpp:1110
QStringView left(qsizetype length) const const
Definition: ksslerroruidata.h:17
QDBusPendingCall asyncCall(const QString &method, Args &&... args)
static KProtocolInfo::FileNameUsedForCopying fileNameUsedForCopying(const QUrl &url)
This setting defines the strategy to use for generating a filename, when copying a file or directory ...
Definition: kprotocolmanager.cpp:1170
static QString workerProtocol(const QUrl &url, QString &proxy)
Return the protocol to use in order to handle the given url It's usually the same,...
Definition: kprotocolmanager.cpp:623
void removeAt(int i)
Q_GLOBAL_STATIC(Internal::StaticControl, s_instance) class ControlPrivate
void setScheme(const QString &scheme)
static QString protocolForArchiveMimetype(const QString &mimeType)
Returns which protocol handles this MIME type, if it's an archive MIME type.
Definition: kprotocolmanager.cpp:1190
static bool isKnownProtocol(const QUrl &url)
Returns whether a protocol is installed that is able to handle url.
Definition: kprotocolinfo.cpp:445
void reserve(int alloc)
QString languageToString(QLocale::Language language)
static bool isSourceProtocol(const QUrl &url)
Returns whether the protocol can act as a source protocol.
Definition: kprotocolmanager.cpp:1010
bool isValid() const const
int size() const const
static bool autoResume()
Returns true if partial downloads should be automatically resumed.
Definition: kprotocolmanager.cpp:946
static bool persistentProxyConnection()
Returns true if proxy connections should be persistent.
Definition: kprotocolmanager.cpp:960
static bool useCache()
Returns true/false to indicate whether a cache should be used.
Definition: kprotocolmanager.cpp:394
QString toString(QUrl::FormattingOptions options) const const
static QString charsetFor(const QUrl &url)
Returns the charset to use for the specified url.
Definition: kprotocolmanager.cpp:1206
QString fromLocal8Bit(const char *str, int size)
bool isEmpty() const const
void unlock()
static int connectTimeout()
Returns the preferred timeout value for remote connections in seconds.
Definition: kprotocolmanager.cpp:336
static bool supportsOpening(const QUrl &url)
Returns whether the protocol can be opened using KIO::open(const QUrl&).
Definition: kprotocolmanager.cpp:1100
static ProxyType proxyType()
Returns the type of proxy configuration that is used.
Definition: kprotocolmanager.cpp:377
static bool markPartial()
Returns true if partial downloads should be marked with a ".part" extension.
Definition: kprotocolmanager.cpp:931
bool isEmpty() const const
static KProtocolInfo::Type outputType(const QUrl &url)
Returns whether the protocol should be treated as a filesystem or as a stream when writing to it.
Definition: kprotocolmanager.cpp:1000
QCA_EXPORT QString appName()
void setPort(int port)
static QString proxyConfigScript()
Returns the URL of the script for automatic proxy configuration.
Definition: kprotocolmanager.cpp:967
bool isEmpty() const const
static QString defaultMimetype(const QUrl &url)
Returns default MIME type for this URL based on the protocol.
Definition: kprotocolmanager.cpp:1180
PostalAddress address(const QVariant &location)
static QString defaultUserAgent()
Returns the default user-agent string used for web browsing.
Definition: kprotocolmanager.cpp:734
QString join(const QString &separator) const const
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const const
static QString proxyForUrl(const QUrl &url)
Returns the Proxy server address for a given URL.
Definition: kprotocolmanager.cpp:482
KSharedConfigPtr config()
static bool canRenameToFile(const QUrl &url)
Returns whether the protocol can rename (i.e.
Definition: kprotocolmanager.cpp:1150
MetaData configData(const QString &protocol, const QString &host)
Query worker configuration for workers of type protocol when dealing with host.
Definition: workerconfig.cpp:189
int indexOf(QStringView str, int from) const const
applicationName
static KIO::CacheControl cacheControl()
Returns the Cache control directive to be used.
Definition: kprotocolmanager.cpp:401
QString & replace(int position, int n, QChar after)
ProxyType
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const const
static bool getSystemNameVersionAndMachine(QString &systemName, QString &systemVersion, QString &machine)
Returns system name, version and machine type, for example "Windows", "5.1", "i686".
Definition: kprotocolmanager.cpp:833
ScriptableExtension * host() const
static bool supportsDeleting(const QUrl &url)
Returns whether the protocol can delete files/objects.
Definition: kprotocolmanager.cpp:1070
QString toLower() const const
QString host(QUrl::ComponentFormattingOptions options) const const
static bool useReverseProxy()
Returns whether or not the proxy server lookup should be reversed or not.
Definition: kprotocolmanager.cpp:370
void relock()
GenericCacheLocation
const char * constData() const const
static bool canCopyFromFile(const QUrl &url)
Returns whether the protocol can copy files/objects directly from the filesystem itself.
Definition: kprotocolmanager.cpp:1120
QString fromLatin1(const char *str, int size)
static QStringList listing(const QUrl &url)
Returns the list of fields this protocol returns when listing The current possibilities are Name,...
Definition: kprotocolmanager.cpp:1030
QStringList uiLanguages() const const
static bool supportsListing(const QUrl &url)
Returns whether the protocol can list files/objects.
Definition: kprotocolmanager.cpp:1020
static void badProxy(const QString &proxy)
Marks this proxy as bad (down).
Definition: kprotocolmanager.cpp:603
static QString proxyFor(const QString &protocol)
Returns the proxy server address for a given protocol.
Definition: kprotocolmanager.cpp:453
static int responseTimeout()
Returns the preferred response timeout value for remote connecting in seconds.
Definition: kprotocolmanager.cpp:354
int port(int defaultPort) const const
static QString acceptLanguagesHeader()
Return Accept-Languages header built up according to user's desktop language settings.
Definition: kprotocolmanager.cpp:865
KIOCORE_EXPORT void lookupHost(const QString &hostName, QObject *receiver, const char *member)
Definition: hostinfo.cpp:246
void clear()
static int proxyConnectTimeout()
Returns the preferred timeout value for proxy connections in seconds.
Definition: kprotocolmanager.cpp:345
static QString userAgentForHost(const QString &hostname)
Returns the user-agent string configured for the specified host.
Definition: kprotocolmanager.cpp:716
static bool persistentConnections()
Returns true if connections should be persistent.
Definition: kprotocolmanager.cpp:953
QString readPathEntry(const char *key, const QString &aDefault) const
bool sync() override
static KProtocolInfo::Type inputType(const QUrl &url)
Returns whether the protocol should be treated as a filesystem or as a stream when reading from it.
Definition: kprotocolmanager.cpp:990
static QString cacheDir()
The directory which contains the cache files.
Definition: kprotocolmanager.cpp:412
int compare(const QString &other, Qt::CaseSensitivity cs) const const
void setUserName(const QString &userName, QUrl::ParsingMode mode)
QByteArray toLocal8Bit() const const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
static QString noProxyFor()
Returns the strings for hosts that should contacted DIRECTLY, bypassing any proxy settings.
Definition: kprotocolmanager.cpp:433
QList< QHostAddress > addresses() const const
KIOCORE_EXPORT KIO::CacheControl parseCacheControl(const QString &cacheControl)
Parses the string representation of the cache control option.
Definition: global.cpp:158
static bool supportsLinking(const QUrl &url)
Returns whether the protocol can create links between files/objects.
Definition: kprotocolmanager.cpp:1080
static int maxCacheSize()
Returns the maximum size that can be used for caching.
Definition: kprotocolmanager.cpp:426
static QString userAgentForApplication(const QString &appName, const QString &appVersion, const QStringList &extraInfo=QStringList())
Returns the application's user-agent string.
Definition: kprotocolmanager.cpp:811
static bool supportsWriting(const QUrl &url)
Returns whether the protocol can store data to URLs.
Definition: kprotocolmanager.cpp:1050
static bool useProxy()
Returns whether or not the user specified the use of proxy server to make connections.
Definition: kprotocolmanager.cpp:365
static QString proxiedBy(const QString &protocol)
Returns the name of the protocol through which the request will be routed if proxy support is enabled...
Definition: kprotocolinfo.cpp:415
static QString protocolClass(const QString &protocol)
Returns the protocol class for the specified protocol.
Definition: kprotocolinfo.cpp:364
static int minimumKeepSize()
Returns the minimum file size for keeping aborted downloads.
Definition: kprotocolmanager.cpp:938
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:54:43 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:54:43 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.