mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
generic: misc cleanups
This commit is contained in:
parent
e893b6eb06
commit
0a78c4ef65
10 changed files with 69 additions and 109 deletions
|
@ -38,6 +38,7 @@
|
|||
#include <QtCore/QFile>
|
||||
#include <QTextStream>
|
||||
|
||||
#include "kdebug.h"
|
||||
#include "krandom.h"
|
||||
#include "kglobal.h"
|
||||
#include "kcomponentdata.h"
|
||||
|
@ -313,7 +314,7 @@ KLockFile::LockResult KLockFile::Private::deleteStaleLock()
|
|||
// I see no way to prevent the race condition here, where we could
|
||||
// delete a new lock file that another process just got after we
|
||||
// decided the old one was too stale for us too.
|
||||
qWarning("WARNING: deleting stale lockfile %s", qPrintable(m_fileName));
|
||||
kWarning() << "Deleting stale lockfile" << qPrintable(m_fileName);
|
||||
QFile::remove(m_fileName);
|
||||
return LockOK;
|
||||
}
|
||||
|
@ -350,7 +351,7 @@ KLockFile::LockResult KLockFile::Private::deleteStaleLockWithLink()
|
|||
if ((KDE_lstat(lckFile, &st_buf2) == 0) && st_buf1 == st_buf2)
|
||||
{
|
||||
// - - if yes, delete lock file, delete temp file, retry lock
|
||||
qWarning("WARNING: deleting stale lockfile %s", lckFile.data());
|
||||
kWarning() << "Deleting stale lockfile" << lckFile.data();
|
||||
::unlink(lckFile);
|
||||
::unlink(tmpFile);
|
||||
return KLockFile::LockOK;
|
||||
|
@ -366,18 +367,17 @@ KLockFile::LockResult KLockFile::Private::deleteStaleLockWithLink()
|
|||
if (!linkCountSupport)
|
||||
{
|
||||
// Without support for link counts we will have a little race condition
|
||||
qWarning("WARNING: deleting stale lockfile %s", lckFile.data());
|
||||
kWarning() << "Deleting stale lockfile" << lckFile.data();
|
||||
::unlink(tmpFile);
|
||||
if (::unlink(lckFile) < 0) {
|
||||
qWarning("WARNING: Problem deleting stale lockfile %s: %s", lckFile.data(),
|
||||
strerror(errno));
|
||||
kWarning() << "Problem deleting stale lockfile" << lckFile.data() << ": " << strerror(errno);
|
||||
return KLockFile::LockFail;
|
||||
}
|
||||
return KLockFile::LockOK;
|
||||
}
|
||||
|
||||
// Failed to delete stale lock file
|
||||
qWarning("WARNING: Problem deleting stale lockfile %s", lckFile.data());
|
||||
kWarning() << "Problem deleting stale lockfile" << lckFile.data();
|
||||
::unlink(tmpFile);
|
||||
return KLockFile::LockFail;
|
||||
}
|
||||
|
|
|
@ -1407,7 +1407,7 @@ int kdeinit_xio_errhandler( Display *disp )
|
|||
// disp is 0L when KDE shuts down. We don't want those warnings then.
|
||||
|
||||
if ( disp )
|
||||
qWarning( "kdeinit4: Fatal IO error: client killed" );
|
||||
kWarning() << "Fatal IO error: client killed";
|
||||
|
||||
if (sock_file[0])
|
||||
{
|
||||
|
@ -1426,7 +1426,7 @@ int kdeinit_xio_errhandler( Display *disp )
|
|||
}
|
||||
|
||||
if ( disp )
|
||||
qWarning( "kdeinit4: sending SIGHUP to children." );
|
||||
kWarning() << "Sending SIGHUP to children.";
|
||||
|
||||
/* this should remove all children we started */
|
||||
KDE_signal(SIGHUP, SIG_IGN);
|
||||
|
@ -1435,14 +1435,14 @@ int kdeinit_xio_errhandler( Display *disp )
|
|||
sleep(2);
|
||||
|
||||
if ( disp )
|
||||
qWarning( "kdeinit4: sending SIGTERM to children." );
|
||||
kWarning() << "Sending SIGTERM to children.";
|
||||
|
||||
/* and if they don't listen to us, this should work */
|
||||
KDE_signal(SIGTERM, SIG_IGN);
|
||||
kill(0, SIGTERM);
|
||||
|
||||
if ( disp )
|
||||
qWarning( "kdeinit4: Exit." );
|
||||
kWarning() << "Exit.";
|
||||
|
||||
exit( 0 );
|
||||
return 0;
|
||||
|
|
|
@ -93,7 +93,7 @@ IdleSlave::gotInput()
|
|||
if (mConn.read( &cmd, data) == -1)
|
||||
{
|
||||
// Communication problem with slave.
|
||||
//kError(7016) << "SlavePool: No communication with slave." << endl;
|
||||
// kError(7016) << "No communication with slave." << endl;
|
||||
deleteLater();
|
||||
}
|
||||
else if (cmd == MSG_SLAVE_ACK)
|
||||
|
@ -102,7 +102,7 @@ IdleSlave::gotInput()
|
|||
}
|
||||
else if (cmd != MSG_SLAVE_STATUS)
|
||||
{
|
||||
kError(7016) << "SlavePool: Unexpected data from slave." << endl;
|
||||
kError(7016) << "Unexpected data from slave." << endl;
|
||||
deleteLater();
|
||||
}
|
||||
else
|
||||
|
@ -187,7 +187,7 @@ ssize_t kde_safe_write(int fd, const void *buf, size_t count)
|
|||
ssize_t ret = 0;
|
||||
K_EINTR_LOOP(ret, QT_WRITE(fd, buf, count));
|
||||
if (ret < 0)
|
||||
qWarning() << "write failed:" << strerror(errno);
|
||||
kWarning() << "write failed:" << strerror(errno);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ KLauncher::KLauncher(int _kdeinitSocket)
|
|||
if (!mConnectionServer.isListening())
|
||||
{
|
||||
// Severe error!
|
||||
qDebug("KLauncher: Fatal error, can't create tempfile!");
|
||||
kDebug() << "Fatal error, can't create tempfile!";
|
||||
::_exit(1);
|
||||
}
|
||||
|
||||
|
@ -231,13 +231,13 @@ KLauncher::KLauncher(int _kdeinitSocket)
|
|||
mSlaveDebug = QString::fromLocal8Bit(qgetenv("KDE_SLAVE_DEBUG_WAIT"));
|
||||
if (!mSlaveDebug.isEmpty())
|
||||
{
|
||||
qWarning("Klauncher running in slave-debug mode for slaves of protocol '%s'", qPrintable(mSlaveDebug));
|
||||
kWarning() << "Running in slave-debug mode for slaves of protocol:" << qPrintable(mSlaveDebug);
|
||||
}
|
||||
mSlaveValgrind = QString::fromLocal8Bit(qgetenv("KDE_SLAVE_VALGRIND"));
|
||||
if (!mSlaveValgrind.isEmpty())
|
||||
{
|
||||
mSlaveValgrindSkin = QString::fromLocal8Bit(qgetenv("KDE_SLAVE_VALGRIND_SKIN"));
|
||||
qWarning("Klauncher running slaves through valgrind for slaves of protocol '%s'", qPrintable(mSlaveValgrind));
|
||||
kWarning() << "Running slaves through valgrind for slaves of protocol:" << qPrintable(mSlaveValgrind);
|
||||
}
|
||||
klauncher_header request_header;
|
||||
request_header.cmd = LAUNCHER_OK;
|
||||
|
|
|
@ -48,14 +48,6 @@
|
|||
#include <QtNetwork/QSslCertificate>
|
||||
#include <QtNetwork/QSslConfiguration>
|
||||
|
||||
#define QL1S(x) QLatin1String(x)
|
||||
#define QL1C(x) QLatin1Char(x)
|
||||
|
||||
static QNetworkRequest::Attribute gSynchronousNetworkRequestAttribute = QNetworkRequest::SynchronousRequestAttribute;
|
||||
|
||||
|
||||
|
||||
|
||||
static qint64 sizeFromRequest(const QNetworkRequest& req)
|
||||
{
|
||||
const QVariant size = req.header(QNetworkRequest::ContentLengthHeader);
|
||||
|
@ -186,7 +178,7 @@ QNetworkReply *AccessManager::createRequest(Operation op, const QNetworkRequest
|
|||
|
||||
if (!d->externalContentAllowed &&
|
||||
!KDEPrivate::AccessManagerReply::isLocalRequest(reqUrl) &&
|
||||
reqUrl.scheme() != QL1S("data")) {
|
||||
reqUrl.scheme() != QLatin1String("data")) {
|
||||
kDebug( 7044 ) << "Blocked: " << reqUrl;
|
||||
return new KDEPrivate::AccessManagerReply(op, req, QNetworkReply::ContentAccessDenied, i18n("Blocked request."), this);
|
||||
}
|
||||
|
@ -215,7 +207,7 @@ QNetworkReply *AccessManager::createRequest(Operation op, const QNetworkRequest
|
|||
|
||||
// WORKAROUND: Avoid the brain damaged stuff QtWebKit does when a POST
|
||||
// operation is redirected! See BR# 268694.
|
||||
metaData.remove(QL1S("content-type")); // Remove the content-type from a GET/HEAD request!
|
||||
metaData.remove(QLatin1String("content-type")); // Remove the content-type from a GET/HEAD request!
|
||||
break;
|
||||
}
|
||||
case PutOperation: {
|
||||
|
@ -223,7 +215,7 @@ QNetworkReply *AccessManager::createRequest(Operation op, const QNetworkRequest
|
|||
const qint64 size = sizeFromRequest(req);
|
||||
if (size > 0) {
|
||||
kioJob = KIO::http_post(reqUrl, outgoingData, size, KIO::HideProgressInfo);
|
||||
metaData.insert(QL1S("CustomHTTPMethod"), QL1S("PUT"));
|
||||
metaData.insert(QLatin1String("CustomHTTPMethod"), QLatin1String("PUT"));
|
||||
} else {
|
||||
kioJob = KIO::put(reqUrl, -1, KIO::HideProgressInfo);
|
||||
}
|
||||
|
@ -231,14 +223,14 @@ QNetworkReply *AccessManager::createRequest(Operation op, const QNetworkRequest
|
|||
}
|
||||
case PostOperation: {
|
||||
kioJob = KIO::http_post(reqUrl, outgoingData, sizeFromRequest(req), KIO::HideProgressInfo);
|
||||
if (!metaData.contains(QL1S("content-type"))) {
|
||||
if (!metaData.contains(QLatin1String("content-type"))) {
|
||||
const QVariant header = req.header(QNetworkRequest::ContentTypeHeader);
|
||||
if (header.isValid()) {
|
||||
metaData.insert(QL1S("content-type"),
|
||||
(QL1S("Content-Type: ") + header.toString()));
|
||||
metaData.insert(QLatin1String("content-type"),
|
||||
(QLatin1String("Content-Type: ") + header.toString()));
|
||||
} else {
|
||||
metaData.insert(QL1S("content-type"),
|
||||
QL1S("Content-Type: application/x-www-form-urlencoded"));
|
||||
metaData.insert(QLatin1String("content-type"),
|
||||
QLatin1String("Content-Type: application/x-www-form-urlencoded"));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -248,7 +240,7 @@ QNetworkReply *AccessManager::createRequest(Operation op, const QNetworkRequest
|
|||
const qint64 size = sizeFromRequest(req);
|
||||
if (size > 0) {
|
||||
kioJob = KIO::http_post(reqUrl, outgoingData, size, KIO::HideProgressInfo);
|
||||
metaData.insert(QL1S("CustomHTTPMethod"), QL1S("DELETE"));
|
||||
metaData.insert(QLatin1String("CustomHTTPMethod"), QLatin1String("DELETE"));
|
||||
} else {
|
||||
kioJob = KIO::http_delete(reqUrl, KIO::HideProgressInfo);
|
||||
}
|
||||
|
@ -268,7 +260,7 @@ QNetworkReply *AccessManager::createRequest(Operation op, const QNetworkRequest
|
|||
else
|
||||
kioJob = KIO::get(reqUrl, KIO::NoReload, KIO::HideProgressInfo);
|
||||
|
||||
metaData.insert(QL1S("CustomHTTPMethod"), method);
|
||||
metaData.insert(QLatin1String("CustomHTTPMethod"), method);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
@ -303,7 +295,7 @@ QNetworkReply *AccessManager::createRequest(Operation op, const QNetworkRequest
|
|||
a solution is found, we have to live with the side effects of creating
|
||||
nested event loops.
|
||||
*/
|
||||
if (req.attribute(gSynchronousNetworkRequestAttribute).toBool()) {
|
||||
if (req.attribute(QNetworkRequest::SynchronousRequestAttribute).toBool()) {
|
||||
KUrl finalURL;
|
||||
QByteArray data;
|
||||
|
||||
|
@ -359,40 +351,40 @@ void AccessManager::AccessManagerPrivate::setMetaDataForRequest(QNetworkRequest
|
|||
if (userMetaData.isValid() && userMetaData.type() == QVariant::Map)
|
||||
metaData += userMetaData.toMap();
|
||||
|
||||
metaData.insert(QL1S("PropagateHttpHeader"), QL1S("true"));
|
||||
metaData.insert(QLatin1String("PropagateHttpHeader"), QLatin1String("true"));
|
||||
|
||||
if (request.hasRawHeader("User-Agent")) {
|
||||
metaData.insert(QL1S("UserAgent"), request.rawHeader("User-Agent"));
|
||||
metaData.insert(QLatin1String("UserAgent"), request.rawHeader("User-Agent"));
|
||||
request.setRawHeader("User-Agent", QByteArray());
|
||||
}
|
||||
|
||||
if (request.hasRawHeader("Accept")) {
|
||||
metaData.insert(QL1S("accept"), request.rawHeader("Accept"));
|
||||
metaData.insert(QLatin1String("accept"), request.rawHeader("Accept"));
|
||||
request.setRawHeader("Accept", QByteArray());
|
||||
}
|
||||
|
||||
if (request.hasRawHeader("Accept-Charset")) {
|
||||
metaData.insert(QL1S("Charsets"), request.rawHeader("Accept-Charset"));
|
||||
metaData.insert(QLatin1String("Charsets"), request.rawHeader("Accept-Charset"));
|
||||
request.setRawHeader("Accept-Charset", QByteArray());
|
||||
}
|
||||
|
||||
if (request.hasRawHeader("Accept-Language")) {
|
||||
metaData.insert(QL1S("Languages"), request.rawHeader("Accept-Language"));
|
||||
metaData.insert(QLatin1String("Languages"), request.rawHeader("Accept-Language"));
|
||||
request.setRawHeader("Accept-Language", QByteArray());
|
||||
}
|
||||
|
||||
if (request.hasRawHeader("Referer")) {
|
||||
metaData.insert(QL1S("referrer"), request.rawHeader("Referer"));
|
||||
metaData.insert(QLatin1String("referrer"), request.rawHeader("Referer"));
|
||||
request.setRawHeader("Referer", QByteArray());
|
||||
}
|
||||
|
||||
if (request.hasRawHeader("Content-Type")) {
|
||||
metaData.insert(QL1S("content-type"), request.rawHeader("Content-Type"));
|
||||
metaData.insert(QLatin1String("content-type"), request.rawHeader("Content-Type"));
|
||||
request.setRawHeader("Content-Type", QByteArray());
|
||||
}
|
||||
|
||||
if (request.attribute(QNetworkRequest::AuthenticationReuseAttribute) == QNetworkRequest::Manual) {
|
||||
metaData.insert(QL1S("no-preemptive-auth-reuse"), QL1S("true"));
|
||||
metaData.insert(QLatin1String("no-preemptive-auth-reuse"), QLatin1String("true"));
|
||||
}
|
||||
|
||||
request.setRawHeader("Content-Length", QByteArray());
|
||||
|
@ -405,11 +397,11 @@ void AccessManager::AccessManagerPrivate::setMetaDataForRequest(QNetworkRequest
|
|||
Q_FOREACH(const QByteArray &key, request.rawHeaderList()) {
|
||||
const QByteArray value = request.rawHeader(key);
|
||||
if (value.length())
|
||||
customHeaders << (key + QL1S(": ") + value);
|
||||
customHeaders << (key + QLatin1String(": ") + value);
|
||||
}
|
||||
|
||||
if (!customHeaders.isEmpty()) {
|
||||
metaData.insert(QL1S("customHTTPHeader"), customHeaders.join("\r\n"));
|
||||
metaData.insert(QLatin1String("customHTTPHeader"), customHeaders.join("\r\n"));
|
||||
}
|
||||
|
||||
// Append per request meta data, if any...
|
||||
|
@ -449,11 +441,11 @@ bool KIO::Integration::sslConfigFromMetaData(const KIO::MetaData& metadata, QSsl
|
|||
{
|
||||
bool success = false;
|
||||
|
||||
if (metadata.value(QL1S("ssl_in_use")) == QL1S("TRUE")) {
|
||||
const QSsl::SslProtocol sslProto = qSslProtocolFromString(metadata.value(QL1S("ssl_protocol_version")));
|
||||
if (metadata.value(QLatin1String("ssl_in_use")) == QLatin1String("TRUE")) {
|
||||
const QSsl::SslProtocol sslProto = qSslProtocolFromString(metadata.value(QLatin1String("ssl_protocol_version")));
|
||||
QList<QSslCipher> cipherList;
|
||||
cipherList << QSslCipher(metadata.value(QL1S("ssl_cipher_name")), sslProto);
|
||||
sslconfig.setCaCertificates(QSslCertificate::fromData(metadata.value(QL1S("ssl_peer_chain")).toUtf8()));
|
||||
cipherList << QSslCipher(metadata.value(QLatin1String("ssl_cipher_name")), sslProto);
|
||||
sslconfig.setCaCertificates(QSslCertificate::fromData(metadata.value(QLatin1String("ssl_peer_chain")).toUtf8()));
|
||||
sslconfig.setCiphers(cipherList);
|
||||
sslconfig.setProtocol(sslProto);
|
||||
success = sslconfig.isNull();
|
||||
|
@ -499,9 +491,9 @@ QList<QNetworkCookie> CookieJar::cookiesForUrl(const QUrl &url) const
|
|||
}
|
||||
|
||||
const QString cookieStr = reply.value();
|
||||
const QStringList cookies = cookieStr.split(QL1S("; "), QString::SkipEmptyParts);
|
||||
const QStringList cookies = cookieStr.split(QLatin1String("; "), QString::SkipEmptyParts);
|
||||
Q_FOREACH(const QString& cookie, cookies) {
|
||||
const int index = cookie.indexOf(QL1C('='));
|
||||
const int index = cookie.indexOf(QLatin1Char('='));
|
||||
const QString name = cookie.left(index);
|
||||
const QString value = cookie.right((cookie.length() - index - 1));
|
||||
cookieList << QNetworkCookie(name.toUtf8(), value.toUtf8());
|
||||
|
|
|
@ -34,9 +34,6 @@
|
|||
|
||||
#include <QtNetwork/QSslConfiguration>
|
||||
|
||||
#define QL1S(x) QLatin1String(x)
|
||||
#define QL1C(x) QLatin1Char(x)
|
||||
|
||||
namespace KDEPrivate {
|
||||
|
||||
AccessManagerReply::AccessManagerReply(const QNetworkAccessManager::Operation op,
|
||||
|
@ -153,7 +150,7 @@ bool AccessManagerReply::ignoreContentDisposition (const KIO::MetaData& metaData
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!metaData.contains(QL1S("content-disposition-type"))) {
|
||||
if (!metaData.contains(QLatin1String("content-disposition-type"))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -182,27 +179,27 @@ void AccessManagerReply::setHeaderFromMetaData (const KIO::MetaData& _metaData)
|
|||
setSslConfiguration(sslConfig);
|
||||
|
||||
// Set the raw header information...
|
||||
const QStringList httpHeaders (metaData.value(QL1S("HTTP-Headers")).split(QL1C('\n'), QString::SkipEmptyParts));
|
||||
const QStringList httpHeaders (metaData.value(QLatin1String("HTTP-Headers")).split(QLatin1Char('\n'), QString::SkipEmptyParts));
|
||||
if (httpHeaders.isEmpty()) {
|
||||
if (metaData.contains(QL1S("charset"))) {
|
||||
if (metaData.contains(QLatin1String("charset"))) {
|
||||
QString mimeType = header(QNetworkRequest::ContentTypeHeader).toString();
|
||||
mimeType += QL1S(" ; charset=");
|
||||
mimeType += metaData.value(QL1S("charset"));
|
||||
mimeType += QLatin1String(" ; charset=");
|
||||
mimeType += metaData.value(QLatin1String("charset"));
|
||||
// kDebug(7044) << "changed content-type to" << mimeType;
|
||||
setHeader(QNetworkRequest::ContentTypeHeader, mimeType.toUtf8());
|
||||
}
|
||||
} else {
|
||||
Q_FOREACH(const QString& httpHeader, httpHeaders) {
|
||||
int index = httpHeader.indexOf(QL1C(':'));
|
||||
int index = httpHeader.indexOf(QLatin1Char(':'));
|
||||
// Handle HTTP status line...
|
||||
if (index == -1) {
|
||||
// Except for the status line, all HTTP header must be an nvpair of
|
||||
// type "<name>:<value>"
|
||||
if (!httpHeader.startsWith(QL1S("HTTP/"), Qt::CaseInsensitive)) {
|
||||
if (!httpHeader.startsWith(QLatin1String("HTTP/"), Qt::CaseInsensitive)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
QStringList statusLineAttrs (httpHeader.split(QL1C(' '), QString::SkipEmptyParts));
|
||||
QStringList statusLineAttrs (httpHeader.split(QLatin1Char(' '), QString::SkipEmptyParts));
|
||||
if (statusLineAttrs.count() > 1) {
|
||||
setAttribute(QNetworkRequest::HttpStatusCodeAttribute, statusLineAttrs.at(1));
|
||||
}
|
||||
|
@ -218,18 +215,18 @@ void AccessManagerReply::setHeaderFromMetaData (const KIO::MetaData& _metaData)
|
|||
QString headerValue = httpHeader.mid(index+1);
|
||||
|
||||
// Ignore cookie header since it is handled by the http ioslave.
|
||||
if (headerName.startsWith(QL1S("set-cookie"), Qt::CaseInsensitive)) {
|
||||
if (headerName.startsWith(QLatin1String("set-cookie"), Qt::CaseInsensitive)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (headerName.startsWith(QL1S("content-disposition"), Qt::CaseInsensitive) &&
|
||||
if (headerName.startsWith(QLatin1String("content-disposition"), Qt::CaseInsensitive) &&
|
||||
ignoreContentDisposition(metaData)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Without overridding the corrected mime-type sent by kio_http, add
|
||||
// back the "charset=" portion of the content-type header if present.
|
||||
if (headerName.startsWith(QL1S("content-type"), Qt::CaseInsensitive)) {
|
||||
if (headerName.startsWith(QLatin1String("content-type"), Qt::CaseInsensitive)) {
|
||||
|
||||
QString mimeType (header(QNetworkRequest::ContentTypeHeader).toString());
|
||||
|
||||
|
@ -238,18 +235,18 @@ void AccessManagerReply::setHeaderFromMetaData (const KIO::MetaData& _metaData)
|
|||
// real content type from the disposition filename.
|
||||
if (mimeType == KMimeType::defaultMimeType()) {
|
||||
int accuracy = 0;
|
||||
const QString fileName (metaData.value(QL1S("content-disposition-filename")));
|
||||
const QString fileName (metaData.value(QLatin1String("content-disposition-filename")));
|
||||
KMimeType::Ptr mime = KMimeType::findByUrl((fileName.isEmpty() ? url().path() : fileName), 0, false, true, &accuracy);
|
||||
if (!mime->isDefault() && accuracy == 100) {
|
||||
mimeType = mime->name();
|
||||
}
|
||||
}
|
||||
metaData.remove(QL1S("content-disposition-type"));
|
||||
metaData.remove(QL1S("content-disposition-filename"));
|
||||
metaData.remove(QLatin1String("content-disposition-type"));
|
||||
metaData.remove(QLatin1String("content-disposition-filename"));
|
||||
}
|
||||
|
||||
if (!headerValue.contains(mimeType, Qt::CaseInsensitive)) {
|
||||
index = headerValue.indexOf(QL1C(';'));
|
||||
index = headerValue.indexOf(QLatin1Char(';'));
|
||||
if (index == -1) {
|
||||
headerValue = mimeType;
|
||||
} else {
|
||||
|
@ -289,7 +286,7 @@ bool AccessManagerReply::isLocalRequest (const KUrl& url)
|
|||
{
|
||||
const QString scheme (url.protocol());
|
||||
return (KProtocolInfo::isKnownProtocol(scheme) &&
|
||||
KProtocolInfo::protocolClass(scheme).compare(QL1S(":local"), Qt::CaseInsensitive) == 0);
|
||||
KProtocolInfo::protocolClass(scheme).compare(QLatin1String(":local"), Qt::CaseInsensitive) == 0);
|
||||
}
|
||||
|
||||
void AccessManagerReply::readHttpResponseHeaders(KIO::Job *job)
|
||||
|
@ -441,7 +438,7 @@ void AccessManagerReply::slotStatResult(KJob* kJob)
|
|||
KIO::UDSEntry entry = statJob->statResult();
|
||||
QString mimeType = entry.stringValue(KIO::UDSEntry::UDS_MIME_TYPE);
|
||||
if (mimeType.isEmpty() && entry.isDir())
|
||||
mimeType = QL1S("inode/directory");
|
||||
mimeType = QLatin1String("inode/directory");
|
||||
|
||||
if (!mimeType.isEmpty())
|
||||
setHeader(QNetworkRequest::ContentTypeHeader, mimeType.toUtf8());
|
||||
|
@ -458,7 +455,7 @@ void AccessManagerReply::slotRedirection(KIO::Job* job, const KUrl& u)
|
|||
return;
|
||||
}
|
||||
setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl(u));
|
||||
if (job->queryMetaData(QL1S("redirect-to-get")) == QL1S("true")) {
|
||||
if (job->queryMetaData(QLatin1String("redirect-to-get")) == QLatin1String("true")) {
|
||||
setOperation(QNetworkAccessManager::GetOperation);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ ChmodJob *KIO::chmod( const KFileItemList& lstItems, int permissions, int mask,
|
|||
{
|
||||
struct passwd* pw = getpwnam(QFile::encodeName(owner));
|
||||
if ( pw == 0L )
|
||||
kError(250) << " ERROR: No user" << owner;
|
||||
kError(250) << "No user" << owner;
|
||||
else
|
||||
newOwnerID = pw->pw_uid;
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ ChmodJob *KIO::chmod( const KFileItemList& lstItems, int permissions, int mask,
|
|||
{
|
||||
struct group* g = getgrnam(QFile::encodeName(group));
|
||||
if ( g == 0L )
|
||||
kError(250) << " ERROR: No group" << group;
|
||||
kError(250) << "No group" << group;
|
||||
else
|
||||
newGroupID = g->gr_gid;
|
||||
}
|
||||
|
|
|
@ -165,7 +165,6 @@ bool SocketConnectionBackend::connectToRemote(const KUrl &url)
|
|||
|
||||
if (mode == LocalSocketMode) {
|
||||
KLocalSocket *sock = new KLocalSocket(this);
|
||||
QString path = url.path();
|
||||
#if 0
|
||||
// TODO: Activate once abstract socket support is implemented in Qt.
|
||||
KLocalSocket::LocalSocketType type = KLocalSocket::UnixSocket;
|
||||
|
@ -173,7 +172,7 @@ bool SocketConnectionBackend::connectToRemote(const KUrl &url)
|
|||
if (url.queryItem(QLatin1String("abstract")) == QLatin1String("1"))
|
||||
type = KLocalSocket::AbstractUnixSocket;
|
||||
#endif
|
||||
sock->connectToPath(path);
|
||||
sock->connectToPath(url.path());
|
||||
socket = sock;
|
||||
} else {
|
||||
socket = new QTcpSocket(this);
|
||||
|
|
|
@ -31,12 +31,11 @@
|
|||
#include <acl/libacl.h>
|
||||
#endif
|
||||
#include <QHash>
|
||||
|
||||
#include <kdebug.h>
|
||||
|
||||
#include <QList>
|
||||
#include <QPair>
|
||||
|
||||
#include <kdebug.h>
|
||||
|
||||
|
||||
class KACL::KACLPrivate {
|
||||
public:
|
||||
|
|
|
@ -909,9 +909,9 @@ QMimeData * KDirModel::mimeData( const QModelIndexList & indexes ) const
|
|||
QString application_x_qiconlist;
|
||||
const int items = urls.count();
|
||||
for (int i = 0; i < items; i++) {
|
||||
const int offset = i*16;
|
||||
QString tmp("%1$@@$%2$@@$32$@@$32$@@$%3$@@$%4$@@$32$@@$16$@@$no data$@@$");
|
||||
application_x_qiconlist += tmp.arg(offset).arg(offset).arg(offset).arg(offset+40);
|
||||
const int offset = i*16;
|
||||
QString tmp("%1$@@$%2$@@$32$@@$32$@@$%3$@@$%4$@@$32$@@$16$@@$no data$@@$");
|
||||
application_x_qiconlist += tmp.arg(offset).arg(offset).arg(offset).arg(offset+40);
|
||||
}
|
||||
data->setData("application/x-qiconlist", application_x_qiconlist.toLatin1());
|
||||
|
||||
|
@ -1118,24 +1118,4 @@ void KDirModel::expandToUrl(const KUrl& url)
|
|||
fetchMore(parentIndex);
|
||||
}
|
||||
|
||||
bool KDirModel::insertRows(int , int, const QModelIndex&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool KDirModel::insertColumns(int, int, const QModelIndex&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool KDirModel::removeRows(int, int, const QModelIndex&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool KDirModel::removeColumns(int, int, const QModelIndex&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#include "moc_kdirmodel.cpp"
|
||||
|
|
|
@ -244,13 +244,6 @@ Q_SIGNALS:
|
|||
*/
|
||||
void needSequenceIcon(const QModelIndex& index, int sequenceIndex);
|
||||
|
||||
private:
|
||||
// Make those private, they shouldn't be called by applications
|
||||
virtual bool insertRows(int , int, const QModelIndex & = QModelIndex());
|
||||
virtual bool insertColumns(int, int, const QModelIndex & = QModelIndex());
|
||||
virtual bool removeRows(int, int, const QModelIndex & = QModelIndex());
|
||||
virtual bool removeColumns(int, int, const QModelIndex & = QModelIndex());
|
||||
|
||||
private:
|
||||
friend class KDirModelPrivate;
|
||||
KDirModelPrivate *const d;
|
||||
|
|
Loading…
Add table
Reference in a new issue