[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdelibs/frameworks] /: previewjob.h ported to QUrl. setProtocol -> setScheme globally.
From: David Faure <faure () kde ! org>
Date: 2012-04-30 23:22:56
Message-ID: 20120430232256.CA14DA60BB () git ! kde ! org
[Download RAW message or body]
Git commit ce876bf9a3c576ed4c27e13198e75beb4d74b1f7 by David Faure.
Committed on 01/05/2012 at 01:23.
Pushed by dfaure into branch 'frameworks'.
previewjob.h ported to QUrl. setProtocol -> setScheme globally.
M +4 -4 kdoctools/kio_help.cpp
M +1 -3 kfile/kdiroperator.cpp
M +2 -2 kfile/kurlnavigator.cpp
M +25 -25 khtml/ecma/kjs_window.cpp
M +1 -1 khtml/rendering/render_form.cpp
M +3 -7 khtml/test_regression.cpp
M +1 -1 kio/kio/job.cpp
M +4 -4 kio/kio/kprotocolmanager.cpp
M +1 -1 kio/kio/metainfojob.cpp
M +10 -11 kio/kio/previewjob.cpp
M +2 -2 kio/kio/previewjob.h
M +4 -4 kio/kio/tcpslavebase.cpp
M +2 -2 kio/tests/kdirmodeltest.cpp
M +1 -1 kioslave/file/file.cpp
M +2 -2 kioslave/file/file_unix.cpp
M +5 -5 kioslave/file/file_win.cpp
M +2 -2 kioslave/ftp/ftp.cpp
M +8 -8 kioslave/http/http.cpp
http://commits.kde.org/kdelibs/ce876bf9a3c576ed4c27e13198e75beb4d74b1f7
diff --git a/kdoctools/kio_help.cpp b/kdoctools/kio_help.cpp
index c7d6abe..63e1f3d 100644
--- a/kdoctools/kio_help.cpp
+++ b/kdoctools/kio_help.cpp
@@ -139,7 +139,7 @@ QString HelpProtocol::lookupFile(const QString &fname,
if (!langLookup(documentationNotFound).isEmpty())
{
KUrl red;
- red.setProtocol("help");
+ red.setScheme("help");
red.setPath(documentationNotFound);
red.setQuery(query);
redirection(red);
@@ -164,11 +164,11 @@ void HelpProtocol::unicodeError( const QString &t )
QString encoding = "UTF-8";
#else
QString encoding = QTextCodec::codecForLocale()->name();
-#endif
+#endif
data(fromUnicode( QString(
"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; \
charset=%1\"></head>\n" "%2</html>" ).arg( encoding, Qt::escape(t) ) ) );
-
+
}
HelpProtocol *slave = 0;
@@ -226,7 +226,7 @@ void HelpProtocol::get( const KUrl& url )
kDebug( 7119 ) << "target " << target.url();
QString file = target.scheme() == "file" ? target.toLocalFile() : target.path();
-
+
if ( mGhelp ) {
if ( !file.endsWith( QLatin1String( ".xml" ) ) ) {
get_file( target );
diff --git a/kfile/kdiroperator.cpp b/kfile/kdiroperator.cpp
index 60d76e8..f0d601c 100644
--- a/kfile/kdiroperator.cpp
+++ b/kfile/kdiroperator.cpp
@@ -383,9 +383,7 @@ KDirOperator::KDirOperator(const QUrl& _url, QWidget *parent) :
if (_url.isEmpty()) { // no dir specified -> current dir
QString strPath = QDir::currentPath();
strPath.append(QChar('/'));
- d->currUrl = QUrl();
- d->currUrl.setProtocol(QLatin1String("file"));
- d->currUrl.setPath(strPath);
+ d->currUrl = QUrl::fromLocalFile(strPath);
} else {
d->currUrl = _url;
if (d->currUrl.scheme().isEmpty())
diff --git a/kfile/kurlnavigator.cpp b/kfile/kurlnavigator.cpp
index 3f63970..f26629a 100644
--- a/kfile/kurlnavigator.cpp
+++ b/kfile/kurlnavigator.cpp
@@ -330,7 +330,7 @@ void KUrlNavigator::Private::slotProtocolChanged(const QString& \
protocol) Q_ASSERT(m_editable);
KUrl url;
- url.setProtocol(protocol);
+ url.setScheme(protocol);
url.setPath((protocol == QLatin1String("file")) ? QLatin1String("/") : \
QLatin1String("//"));
m_pathBox->setEditUrl(url);
@@ -1014,7 +1014,7 @@ void KUrlNavigator::setLocationUrl(const QUrl& newUrl)
if (!insideCompressedPath) {
// drop the tar: or zip: protocol since we are not
// inside the compressed path
- url.setProtocol("file");
+ url.setScheme("file");
}
}
diff --git a/khtml/ecma/kjs_window.cpp b/khtml/ecma/kjs_window.cpp
index cefe90f..ea455a2 100644
--- a/khtml/ecma/kjs_window.cpp
+++ b/khtml/ecma/kjs_window.cpp
@@ -524,7 +524,7 @@ bool Window::isCrossFrameAccessible(int token) const
case BToA:
case ValueOf:
case ToString:
- case PostMessage:
+ case PostMessage:
return true;
default:
return false;
@@ -555,27 +555,27 @@ bool Window::getOwnPropertySlot(ExecState *exec, const \
Identifier& propertyName, slot.setUndefined(this);
return true;
}
-
+
bool safe = isSafeScript(exec);
- // Look for overrides first.
+ // Look for overrides first.
JSValue **val = getDirectLocation(propertyName);
if (val) {
if (safe) {
fillDirectLocationSlot(slot, val);
} else {
- // We may need to permit access to the property map cross-frame in
+ // We may need to permit access to the property map cross-frame in
// order to pick up cross-frame accessible functions that got
- // cached as direct properties.
+ // cached as direct properties.
const HashEntry* entry = Lookup::findEntry(&WindowTable, propertyName);
if (entry && isCrossFrameAccessible(entry->value))
fillDirectLocationSlot(slot, val);
else
- slot.setUndefined(this);
+ slot.setUndefined(this);
}
- return true;
+ return true;
}
-
+
// The only stuff we permit XSS (besides cached things above) are
// a few of hashtable properties.
const HashEntry* entry = Lookup::findEntry(&WindowTable, propertyName);
@@ -583,11 +583,11 @@ bool Window::getOwnPropertySlot(ExecState *exec, const \
Identifier& propertyName, slot.setUndefined(this);
return true;
}
-
+
// invariant: accesses below this point are permitted by the XSS policy
-
+
KHTMLPart *part = qobject_cast<KHTMLPart*>(m_frame->m_part.data());
-
+
if (entry) {
// Things that work on any ReadOnlyPart first
switch(entry->value) {
@@ -600,26 +600,26 @@ bool Window::getOwnPropertySlot(ExecState *exec, const \
Identifier& propertyName, default:
break;
}
-
+
if (!part) {
slot.setUndefined(this);
return true;
}
// KHTMLPart-specific next.
-
+
// Disabled in NS-compat mode. Supported by default - can't hurt, unless \
someone uses // if (navigate) to test for IE (unlikely).
if (entry->value == Navigate && exec->dynamicInterpreter()->compatMode() == \
Interpreter::NetscapeCompat ) { slot.setUndefined(this);
return true;
}
-
-
+
+
getSlotFromEntry<WindowFunc, Window>(entry, this, slot);
return true;
- }
-
+ }
+
if (!part) {
// not a KHTMLPart, so try to get plugin scripting stuff
if (pluginRootGet(exec, m_frame->m_scriptable.data(), propertyName, slot))
@@ -789,7 +789,7 @@ JSValue* Window::getValueProperty(ExecState *exec, int token)
case ElementCtor:
return ElementPseudoCtor::self(exec);
case DocumentFragmentCtor:
- return DocumentFragmentPseudoCtor::self(exec);
+ return DocumentFragmentPseudoCtor::self(exec);
case HTMLElementCtor:
return HTMLElementPseudoCtor::self(exec);
case HTMLHtmlElementCtor:
@@ -1214,7 +1214,7 @@ void Window::put(ExecState* exec, const Identifier \
&propertyName, JSValue *value case Onmessage:
if (isSafeScript(exec))
setListener(exec,DOM::EventImpl::MESSAGE_EVENT,value);
- return;
+ return;
case Onmousedown:
if (isSafeScript(exec))
setListener(exec,DOM::EventImpl::MOUSEDOWN_EVENT,value);
@@ -1455,7 +1455,7 @@ void Window::clear( ExecState *exec )
delete winq;
qDeleteAll(m_delayed);
m_delayed.clear();
-
+
winq = 0L;
// Get rid of everything, those user vars could hold references to DOM nodes
clearProperties();
@@ -2047,7 +2047,7 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject \
*thisObj, const Li setDOMException(exec, DOM::DOMException::SECURITY_ERR);
return jsUndefined();
}
-
+
QString sourceOrigin = part->xmlDocImpl()->origin()->toString();
QString targetOrigin = args[1]->toString(exec).qstring();
KUrl targetURL(targetOrigin);
@@ -2059,7 +2059,7 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject \
*thisObj, const Li setDOMException(exec, DOM::DOMException::SYNTAX_ERR);
return jsUndefined();
}
-
+
// Grab a snapshot of the data. Unfortunately it means we copy it
// twice, but it's simpler than having separate code for swizzling
// prototype pointers.
@@ -2367,7 +2367,7 @@ void WindowQObject::resumeTimers()
// of a pause..
timerEvent(0);
}
-
+
--pauseLevel; // We do it afterwards so that timerEvent can know about us.
}
@@ -2476,7 +2476,7 @@ void WindowQObject::timerEvent(QTimerEvent *)
// Work out when next event is to occur
setNextTimer();
-
+
// unless we're inside a nested context, do post-script processing
if (!pauseLevel)
parent->afterScriptExecution();
@@ -2751,7 +2751,7 @@ void Location::put(ExecState *exec, const Identifier &p, \
JSValue *v, int attr) url.setPort(str.toUInt());
break;
case Protocol:
- url.setProtocol(str);
+ url.setScheme(str);
break;
case Search:
url.setQuery(str);
diff --git a/khtml/rendering/render_form.cpp b/khtml/rendering/render_form.cpp
index 8bf8073..8b73c85 100644
--- a/khtml/rendering/render_form.cpp
+++ b/khtml/rendering/render_form.cpp
@@ -881,7 +881,7 @@ void LineEditWidget::slotCreateWebShortcut()
url.setPath( baseUrl.path() );
}
if ( !url.hasHost() ) {
- url.setProtocol( baseUrl.scheme() );
+ url.setScheme( baseUrl.scheme() );
url.setHost( baseUrl.host() );
}
NodeImpl *node;
diff --git a/khtml/test_regression.cpp b/khtml/test_regression.cpp
index fe5cc35..ae38131 100644
--- a/khtml/test_regression.cpp
+++ b/khtml/test_regression.cpp
@@ -507,9 +507,7 @@ JSValue* KHTMLPartFunction::callAsFunction(ExecState *exec, \
JSObject*/*thisObj*/
QString filename = args[0]->toString(exec).qstring();
QString fullFilename = \
QFileInfo(RegressionTest::curr->m_currentBase+"/"+filename).absoluteFilePath(); //krazy:exclude=duoblequote_chars \
DOM demands chars
- KUrl url;
- url.setProtocol("file");
- url.setPath(fullFilename);
+ QUrl url = QUrl::fromLocalFile(fullFilename);
PartMonitor pm(m_part);
m_part->openUrl(url);
pm.waitForCompletion();
@@ -1062,7 +1060,7 @@ void RegressionTest::getPartDOMOutput( QTextStream \
&outputStream, KHTMLPart* par // Make doctype's visually different from elements
if (node.nodeType() == DOM::Node::DOCUMENT_TYPE_NODE)
outputStream << "!doctype ";
-
+
outputStream << node.nodeName().string();
switch (node.nodeType()) {
@@ -1496,9 +1494,7 @@ void RegressionTest::testStaticFile(const QString & filename)
else if (filename.endsWith(".xml")) args.setMimeType("text/xml");
m_part->setArguments(args);
// load page
- KUrl url;
- url.setProtocol("file");
- url.setPath(QFileInfo(m_baseDir + "/tests/"+filename).absoluteFilePath());
+ QUrl url = QUrl::fromLocalFile(QFileInfo(m_baseDir + \
"/tests/"+filename).absoluteFilePath()); PartMonitor pm(m_part);
m_part->openUrl(url);
pm.waitForCompletion();
diff --git a/kio/kio/job.cpp b/kio/kio/job.cpp
index e88ebf1..d79b642 100644
--- a/kio/kio/job.cpp
+++ b/kio/kio/job.cpp
@@ -2557,7 +2557,7 @@ void ListJob::slotFinished()
QString proto = ptr->property("X-KDE-LocalProtocol").toString();
if ( !proto.isEmpty() && KProtocolInfo::isKnownProtocol( proto) ) {
d->m_redirectionURL = d->m_url;
- d->m_redirectionURL.setProtocol( proto );
+ d->m_redirectionURL.setScheme(proto);
setError( 0 );
emit redirection(this,d->m_redirectionURL);
}
diff --git a/kio/kio/kprotocolmanager.cpp b/kio/kio/kprotocolmanager.cpp
index 2df7ead..216a4e3 100644
--- a/kio/kio/kprotocolmanager.cpp
+++ b/kio/kio/kprotocolmanager.cpp
@@ -419,11 +419,11 @@ static QStringList getSystemProxyFor( const KUrl& url )
}
if (type == QNetworkProxy::HttpProxy || type == QNetworkProxy::HttpCachingProxy)
- url.setProtocol(QL1S("http"));
+ url.setScheme(QL1S("http"));
else if (type == QNetworkProxy::Socks5Proxy)
- url.setProtocol(QL1S("socks"));
+ url.setScheme(QL1S("socks"));
else if (type == QNetworkProxy::FtpCachingProxy)
- url.setProtocol(QL1S("ftp"));
+ url.setScheme(QL1S("ftp"));
url.setHost(proxy.hostName());
url.setPort(proxy.port());
@@ -468,7 +468,7 @@ QStringList KProtocolManager::proxiesForUrl( const KUrl &url )
{
KUrl u (url);
const QString protocol = adjustProtocol(u.scheme());
- u.setProtocol(protocol);
+ u.setScheme(protocol);
if (KProtocolInfo::protocolClass(protocol) != QL1S(":local")) {
QDBusReply<QStringList> reply = QDBusInterface(QL1S("org.kde.kded"),
diff --git a/kio/kio/metainfojob.cpp b/kio/kio/metainfojob.cpp
index f396734..bafad61 100644
--- a/kio/kio/metainfojob.cpp
+++ b/kio/kio/metainfojob.cpp
@@ -129,7 +129,7 @@ void MetaInfoJob::getMetaInfo()
Q_ASSERT(!item.isNull());
KUrl URL;
- URL.setProtocol("metainfo");
+ URL.setScheme("metainfo");
URL.setPath(item.url().path());
KIO::TransferJob* job = KIO::get(URL, NoReload, HideProgressInfo);
diff --git a/kio/kio/previewjob.cpp b/kio/kio/previewjob.cpp
index 530e1c8..6fb2a2c 100644
--- a/kio/kio/previewjob.cpp
+++ b/kio/kio/previewjob.cpp
@@ -376,7 +376,7 @@ void PreviewJobPrivate::startPreview()
determineNextFile();
}
-void PreviewJob::removeItem( const KUrl& url )
+void PreviewJob::removeItem(const QUrl& url)
{
Q_D(PreviewJob);
for (QLinkedList<PreviewItem>::Iterator it = d->items.begin(); it != \
d->items.end(); ++it) @@ -583,7 +583,7 @@ void \
PreviewJobPrivate::getOrCreateThumbnail() if (!localPath.isEmpty()) {
createThumbnail( localPath );
} else {
- const KUrl fileUrl = item.url();
+ const QUrl fileUrl = item.url();
// heuristics for remote URL support
bool supportsProtocol = false;
if (m_remoteProtocolPlugins.value(fileUrl.scheme()).contains(item.mimetype())) \
{ @@ -596,7 +596,7 @@ void PreviewJobPrivate::getOrCreateThumbnail()
}
if (supportsProtocol) {
- createThumbnail(fileUrl.url());
+ createThumbnail(fileUrl.toString());
return;
}
// No plugin support access to this remote content, copy the file
@@ -605,10 +605,9 @@ void PreviewJobPrivate::getOrCreateThumbnail()
QTemporaryFile localFile;
localFile.setAutoRemove(false);
localFile.open();
- KUrl localURL;
- localURL.setPath( tempName = localFile.fileName() );
- const KUrl currentURL = item.mostLocalUrl();
- KIO::Job * job = KIO::file_copy( currentURL, localURL, -1, KIO::Overwrite | \
KIO::HideProgressInfo /* No GUI */ ); + tempName = localFile.fileName();
+ const QUrl currentURL = item.mostLocalUrl();
+ KIO::Job * job = KIO::file_copy( currentURL, QUrl::fromLocalFile(tempName), \
-1, KIO::Overwrite | KIO::HideProgressInfo /* No GUI */ ); \
job->addMetaData("thumbnail","1"); q->addSubjob(job);
}
@@ -618,8 +617,8 @@ void PreviewJobPrivate::createThumbnail( const QString &pixPath )
{
Q_Q(PreviewJob);
state = PreviewJobPrivate::STATE_CREATETHUMB;
- KUrl thumbURL;
- thumbURL.setProtocol("thumbnail");
+ QUrl thumbURL;
+ thumbURL.setScheme("thumbnail");
thumbURL.setPath(pixPath);
KIO::TransferJob *job = KIO::get(thumbURL, NoReload, HideProgressInfo);
q->addSubjob(job);
@@ -757,12 +756,12 @@ PreviewJob *KIO::filePreview( const KFileItemList &items, int \
width, int height, scale, save, enabledPlugins);
}
-PreviewJob *KIO::filePreview( const KUrl::List &items, int width, int height,
+PreviewJob *KIO::filePreview( const QList<QUrl> &items, int width, int height,
int iconSize, int iconAlpha, bool scale, bool save,
const QStringList *enabledPlugins )
{
KFileItemList fileItems;
- for (KUrl::List::ConstIterator it = items.begin(); it != items.end(); ++it) {
+ for (QList<QUrl>::const_iterator it = items.begin(); it != items.end(); ++it) {
Q_ASSERT( (*it).isValid() ); // please call us with valid urls only
fileItems.append(KFileItem(KFileItem::Unknown, KFileItem::Unknown, *it, \
true)); }
diff --git a/kio/kio/previewjob.h b/kio/kio/previewjob.h
index 1c1cef6..8dd6cc3 100644
--- a/kio/kio/previewjob.h
+++ b/kio/kio/previewjob.h
@@ -157,7 +157,7 @@ namespace KIO {
*
* @param url the url of the item that should be removed from the preview \
queue
*/
- void removeItem( const KUrl& url );
+ void removeItem( const QUrl& url );
/**
* If @p ignoreSize is true, then the preview is always
@@ -283,7 +283,7 @@ namespace KIO {
* with the setter-methods instead. Note that the semantics of
* \p enabledPlugins has been slightly changed.
*/
- KIO_DEPRECATED_EXPORT PreviewJob *filePreview( const KUrl::List &items, int \
width, int height = 0, int iconSize = 0, int iconAlpha = 70, bool scale = true, bool \
save = true, const QStringList *enabledPlugins = 0 ); + KIO_DEPRECATED_EXPORT \
PreviewJob *filePreview( const QList<QUrl> &items, int width, int height = 0, int \
iconSize = 0, int iconAlpha = 70, bool scale = true, bool save = true, const \
QStringList *enabledPlugins = 0 ); #endif
/**
diff --git a/kio/kio/tcpslavebase.cpp b/kio/kio/tcpslavebase.cpp
index 49aab9a..81837e9 100644
--- a/kio/kio/tcpslavebase.cpp
+++ b/kio/kio/tcpslavebase.cpp
@@ -140,14 +140,14 @@ public:
sslMetaData.insert("ssl_peer_chain", peerCertChain);
sendSslMetaData();
}
-
+
void clearSslMetaData()
{
sslMetaData.clear();
sslMetaData.insert("ssl_in_use", "FALSE");
sendSslMetaData();
}
-
+
void sendSslMetaData()
{
MetaData::ConstIterator it = sslMetaData.constBegin();
@@ -173,7 +173,7 @@ public:
bool sslNoUi; // If true, we just drop the connection silently
// if SSL certificate check fails in some way.
QList<KSslError> sslErrors;
-
+
MetaData sslMetaData;
};
@@ -746,7 +746,7 @@ void TCPSlaveBase::selectClientCertificate()
do {
ai.prompt = i18n("Enter the certificate password:");
ai.caption = i18n("SSL Certificate Password");
- ai.url.setProtocol("kssl");
+ ai.url.setScheme("kssl");
ai.url.setHost(certname);
ai.username = certname;
ai.keepPassword = true;
diff --git a/kio/tests/kdirmodeltest.cpp b/kio/tests/kdirmodeltest.cpp
index a5a0528..8e0cd91 100644
--- a/kio/tests/kdirmodeltest.cpp
+++ b/kio/tests/kdirmodeltest.cpp
@@ -1027,10 +1027,10 @@ void KDirModelTest::testZipFile() // # 171721
KUrl zipUrl(path);
zipUrl.addPath("wronglocalsizes.zip"); // just a zip file lying here for other \
reasons QVERIFY(QFile::exists(zipUrl.path()));
- zipUrl.setProtocol("zip");
+ zipUrl.setScheme("zip");
QModelIndex index = m_dirModel->indexForUrl(zipUrl);
QVERIFY(!index.isValid()); // protocol mismatch, can't find it!
- zipUrl.setProtocol("file");
+ zipUrl.setScheme("file");
index = m_dirModel->indexForUrl(zipUrl);
QVERIFY(index.isValid());
}
diff --git a/kioslave/file/file.cpp b/kioslave/file/file.cpp
index be17e7d..78ef452 100644
--- a/kioslave/file/file.cpp
+++ b/kioslave/file/file.cpp
@@ -285,7 +285,7 @@ void FileProtocol::get( const KUrl& url )
{
if (!url.isLocalFile()) {
KUrl redir(url);
- redir.setProtocol(config()->readEntry("DefaultRemoteProtocol", "smb"));
+ redir.setScheme(config()->readEntry("DefaultRemoteProtocol", "smb"));
redirection(redir);
finished();
return;
diff --git a/kioslave/file/file_unix.cpp b/kioslave/file/file_unix.cpp
index 2b47b7c..dc89724 100644
--- a/kioslave/file/file_unix.cpp
+++ b/kioslave/file/file_unix.cpp
@@ -321,7 +321,7 @@ void FileProtocol::listDir( const KUrl& url)
{
if (!url.isLocalFile()) {
KUrl redir(url);
- redir.setProtocol(config()->readEntry("DefaultRemoteProtocol", "smb"));
+ redir.setScheme(config()->readEntry("DefaultRemoteProtocol", "smb"));
redirection(redir);
kDebug(7101) << "redirecting to " << redir.url();
finished();
@@ -650,7 +650,7 @@ void FileProtocol::stat( const KUrl & url )
{
if (!url.isLocalFile()) {
KUrl redir(url);
- redir.setProtocol(config()->readEntry("DefaultRemoteProtocol", "smb"));
+ redir.setScheme(config()->readEntry("DefaultRemoteProtocol", "smb"));
redirection(redir);
kDebug(7101) << "redirecting to " << redir.url();
finished();
diff --git a/kioslave/file/file_win.cpp b/kioslave/file/file_win.cpp
index e58d310..4d34684 100644
--- a/kioslave/file/file_win.cpp
+++ b/kioslave/file/file_win.cpp
@@ -140,7 +140,7 @@ void FileProtocol::copy( const KUrl &src, const KUrl &dest,
dwFlags = 0;
}
-
+
if( !QFileInfo(_dest.dir().absolutePath()).exists() )
{
_dest.dir().mkdir(_dest.dir().absolutePath());
@@ -163,7 +163,7 @@ void FileProtocol::copy( const KUrl &src, const KUrl &dest,
LPVOID lpMsgBuf;
FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
@@ -191,7 +191,7 @@ void FileProtocol::listDir( const KUrl& url )
if (!url.isLocalFile()) {
KUrl redir(url);
- redir.setProtocol(config()->readEntry("DefaultRemoteProtocol", "smb"));
+ redir.setScheme(config()->readEntry("DefaultRemoteProtocol", "smb"));
redirection(redir);
kDebug(7101) << "redirecting to " << redir.url();
finished();
@@ -265,7 +265,7 @@ void FileProtocol::rename( const KUrl &src, const KUrl &dest,
#endif
}
// To avoid error 17 - The system cannot move the file to a different disk \
drive.
-#ifndef _WIN32_WCE
+#ifndef _WIN32_WCE
dwFlags |= MOVEFILE_COPY_ALLOWED;
@@ -356,7 +356,7 @@ void FileProtocol::stat( const KUrl & url )
{
if (!url.isLocalFile()) {
KUrl redir(url);
- redir.setProtocol(config()->readEntry("DefaultRemoteProtocol", "smb"));
+ redir.setScheme(config()->readEntry("DefaultRemoteProtocol", "smb"));
redirection(redir);
kDebug(7101) << "redirecting to " << redir.url();
finished();
diff --git a/kioslave/ftp/ftp.cpp b/kioslave/ftp/ftp.cpp
index a6cc321..de93728 100644
--- a/kioslave/ftp/ftp.cpp
+++ b/kioslave/ftp/ftp.cpp
@@ -385,7 +385,7 @@ bool Ftp::ftpOpenConnection (LoginMode loginMode)
if (userNameChanged && m_bLoggedOn)
{
KUrl realURL;
- realURL.setProtocol( "ftp" );
+ realURL.setScheme( "ftp" );
if (m_user != FTP_LOGIN)
realURL.setUser( m_user );
if (m_pass != FTP_PASSWD)
@@ -1516,7 +1516,7 @@ void Ftp::listDir( const KUrl &url )
if ( path.isEmpty() )
{
KUrl realURL;
- realURL.setProtocol( "ftp" );
+ realURL.setScheme( "ftp" );
realURL.setUser( m_user );
realURL.setPass( m_pass );
realURL.setHost( m_host );
diff --git a/kioslave/http/http.cpp b/kioslave/http/http.cpp
index 12580e3..6f60b7e 100644
--- a/kioslave/http/http.cpp
+++ b/kioslave/http/http.cpp
@@ -488,7 +488,7 @@ void HTTPProtocol::resetSessionSettings()
QString protocol = refUrl.scheme();
if (protocol.startsWith(QLatin1String("webdav"))) {
protocol.replace(0, 6, QLatin1String("http"));
- refUrl.setProtocol(protocol);
+ refUrl.setScheme(protocol);
}
if (protocol.startsWith(QLatin1String("http"))) {
@@ -1377,9 +1377,9 @@ void HTTPProtocol::copy( const KUrl& src, const KUrl& dest, \
int, KIO::JobFlags f // destination has to be "http(s)://..."
KUrl newDest = dest;
if (newDest.scheme() == QLatin1String("webdavs"))
- newDest.setProtocol(QLatin1String("https"));
+ newDest.setScheme(QLatin1String("https"));
else if (newDest.scheme() == QLatin1String("webdav"))
- newDest.setProtocol(QLatin1String("http"));
+ newDest.setScheme(QLatin1String("http"));
m_request.method = DAV_COPY;
m_request.davData.desturl = newDest.url();
@@ -1407,9 +1407,9 @@ void HTTPProtocol::rename( const KUrl& src, const KUrl& dest, \
KIO::JobFlags flag // destination has to be "http://..."
KUrl newDest = dest;
if (newDest.scheme() == QLatin1String("webdavs"))
- newDest.setProtocol(QLatin1String("https"));
+ newDest.setScheme(QLatin1String("https"));
else if (newDest.scheme() == QLatin1String("webdav"))
- newDest.setProtocol(QLatin1String("http"));
+ newDest.setScheme(QLatin1String("http"));
m_request.method = DAV_MOVE;
m_request.davData.desturl = newDest.url();
@@ -2339,7 +2339,7 @@ QString HTTPProtocol::formatRequestUri() const
if (protocol.startsWith(QLatin1String("webdav"))) {
protocol.replace(0, qstrlen("webdav"), QLatin1String("http"));
}
- u.setProtocol(protocol);
+ u.setScheme(protocol);
u.setHost(m_request.url.host());
// if the URL contained the default port it should have been stripped \
earlier @@ -3482,9 +3482,9 @@ endParsing:
// If we're redirected to a http:// url, remember that we're doing \
webdav... if (m_protocol == "webdav" || m_protocol == "webdavs"){
if(u.scheme() == QLatin1String("http")){
- u.setProtocol(QLatin1String("webdav"));
+ u.setScheme(QLatin1String("webdav"));
}else if(u.scheme() == QLatin1String("https")){
- u.setProtocol(QLatin1String("webdavs"));
+ u.setScheme(QLatin1String("webdavs"));
}
m_request.redirectUrl = u;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic