From kde-commits Mon Apr 30 23:22:56 2012 From: David Faure Date: Mon, 30 Apr 2012 23:22:56 +0000 To: kde-commits Subject: [kdelibs/frameworks] /: previewjob.h ported to QUrl. setProtocol -> setScheme globally. Message-Id: <20120430232256.CA14DA60BB () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=133582831511221 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 =3D "UTF-8"; #else QString encoding =3D QTextCodec::codecForLocale()->name(); -#endif = +#endif data(fromUnicode( QString( "\n" "%2" ).arg( encoding, Qt::escape(t) ) ) ); - = + } = HelpProtocol *slave =3D 0; @@ -226,7 +226,7 @@ void HelpProtocol::get( const KUrl& url ) kDebug( 7119 ) << "target " << target.url(); = QString file =3D target.scheme() =3D=3D "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 *p= arent) : if (_url.isEmpty()) { // no dir specified -> current dir QString strPath =3D QDir::currentPath(); strPath.append(QChar('/')); - d->currUrl =3D QUrl(); - d->currUrl.setProtocol(QLatin1String("file")); - d->currUrl.setPath(strPath); + d->currUrl =3D QUrl::fromLocalFile(strPath); } else { d->currUrl =3D _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 =3D=3D 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, cons= t Identifier& propertyName, slot.setUndefined(this); return true; } - = + bool safe =3D isSafeScript(exec); = - // Look for overrides first. = + // Look for overrides first. JSValue **val =3D getDirectLocation(propertyName); if (val) { if (safe) { fillDirectLocationSlot(slot, val); } else { - // We may need to permit access to the property map cross-fram= e in = + // We may need to permit access to the property map cross-fram= e in // order to pick up cross-frame accessible functions that got - // cached as direct properties. = + // cached as direct properties. const HashEntry* entry =3D Lookup::findEntry(&WindowTable, pro= pertyName); 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 =3D Lookup::findEntry(&WindowTable, propertyNam= e); @@ -583,11 +583,11 @@ bool Window::getOwnPropertySlot(ExecState *exec, cons= t Identifier& propertyName, slot.setUndefined(this); return true; } - = + // invariant: accesses below this point are permitted by the XSS policy - = + KHTMLPart *part =3D qobject_cast(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, cons= t 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 =3D=3D Navigate && exec->dynamicInterpreter()->co= mpatMode() =3D=3D Interpreter::NetscapeCompat ) { slot.setUndefined(this); return true; } - = - = + + getSlotFromEntry(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 &p= ropertyName, 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 =3D 0L; // Get rid of everything, those user vars could hold references to DOM n= odes clearProperties(); @@ -2047,7 +2047,7 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, = JSObject *thisObj, const Li setDOMException(exec, DOM::DOMException::SECURITY_ERR); return jsUndefined(); } - = + QString sourceOrigin =3D part->xmlDocImpl()->origin()->toString(); QString targetOrigin =3D 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 *e= xec, JSObject*/*thisObj*/ = QString filename =3D args[0]->toString(exec).qstring(); QString fullFilename =3D QFileInfo(RegressionTest::curr->m_cur= rentBase+"/"+filename).absoluteFilePath(); //krazy:exclude=3Dduoblequote_ch= ars DOM demands chars - KUrl url; - url.setProtocol("file"); - url.setPath(fullFilename); + QUrl url =3D QUrl::fromLocalFile(fullFilename); PartMonitor pm(m_part); m_part->openUrl(url); pm.waitForCompletion(); @@ -1062,7 +1060,7 @@ void RegressionTest::getPartDOMOutput( QTextStream &o= utputStream, KHTMLPart* par // Make doctype's visually different from elements if (node.nodeType() =3D=3D DOM::Node::DOCUMENT_TYPE_NODE) outputStream << "!doctype "; - = + outputStream << node.nodeName().string(); = switch (node.nodeType()) { @@ -1496,9 +1494,7 @@ void RegressionTest::testStaticFile(const QString & f= ilename) 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 =3D QUrl::fromLocalFile(QFileInfo(m_baseDir + "/tests/"+filen= ame).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 =3D ptr->property("X-KDE-LocalProtocol").toStrin= g(); if ( !proto.isEmpty() && KProtocolInfo::isKnownProtocol( proto= ) ) { d->m_redirectionURL =3D 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 =3D=3D QNetworkProxy::HttpProxy || type =3D=3D QNetworkProxy:= :HttpCachingProxy) - url.setProtocol(QL1S("http")); + url.setScheme(QL1S("http")); else if (type =3D=3D QNetworkProxy::Socks5Proxy) - url.setProtocol(QL1S("socks")); + url.setScheme(QL1S("socks")); else if (type =3D=3D 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 =3D adjustProtocol(u.scheme()); - u.setProtocol(protocol); + u.setScheme(protocol); = if (KProtocolInfo::protocolClass(protocol) !=3D QL1S(":local")) { QDBusReply reply =3D QDBusInterface(QL1S("org.kde.k= ded"), 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 =3D 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::Iterator it =3D d->items.begin(); it != =3D d->items.end(); ++it) @@ -583,7 +583,7 @@ void PreviewJobPrivate::getOrCreateThumbnail() if (!localPath.isEmpty()) { createThumbnail( localPath ); } else { - const KUrl fileUrl =3D item.url(); + const QUrl fileUrl =3D item.url(); // heuristics for remote URL support bool supportsProtocol =3D 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 =3D localFile.fileName() ); - const KUrl currentURL =3D item.mostLocalUrl(); - KIO::Job * job =3D KIO::file_copy( currentURL, localURL, -1, KIO::= Overwrite | KIO::HideProgressInfo /* No GUI */ ); + tempName =3D localFile.fileName(); + const QUrl currentURL =3D item.mostLocalUrl(); + KIO::Job * job =3D 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 =3D PreviewJobPrivate::STATE_CREATETHUMB; - KUrl thumbURL; - thumbURL.setProtocol("thumbnail"); + QUrl thumbURL; + thumbURL.setScheme("thumbnail"); thumbURL.setPath(pixPath); KIO::TransferJob *job =3D KIO::get(thumbURL, NoReload, HideProgressInf= o); q->addSubjob(job); @@ -757,12 +756,12 @@ PreviewJob *KIO::filePreview( const KFileItemList &it= ems, int width, int height, scale, save, enabledPlugins); } = -PreviewJob *KIO::filePreview( const KUrl::List &items, int width, int heig= ht, +PreviewJob *KIO::filePreview( const QList &items, int width, int hei= ght, int iconSize, int iconAlpha, bool scale, bool save, const QStringList *enabledPlugins ) { KFileItemList fileItems; - for (KUrl::List::ConstIterator it =3D items.begin(); it !=3D items.end= (); ++it) { + for (QList::const_iterator it =3D items.begin(); it !=3D items.e= nd(); ++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 semantic= s of * \p enabledPlugins has been slightly changed. */ - KIO_DEPRECATED_EXPORT PreviewJob *filePreview( const KUrl::List &items= , int width, int height =3D 0, int iconSize =3D 0, int iconAlpha =3D 70, bo= ol scale =3D true, bool save =3D true, const QStringList *enabledPlugins = =3D 0 ); + KIO_DEPRECATED_EXPORT PreviewJob *filePreview( const QList &item= s, int width, int height =3D 0, int iconSize =3D 0, int iconAlpha =3D 70, b= ool scale =3D true, bool save =3D true, const QStringList *enabledPlugins = =3D 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 =3D 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 sslErrors; - = + MetaData sslMetaData; }; = @@ -746,7 +746,7 @@ void TCPSlaveBase::selectClientCertificate() do { ai.prompt =3D i18n("Enter the certificate password:"); ai.caption =3D i18n("SSL Certificate Password"); - ai.url.setProtocol("kssl"); + ai.url.setScheme("kssl"); ai.url.setHost(certname); ai.username =3D certname; ai.keepPassword =3D 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 f= or other reasons QVERIFY(QFile::exists(zipUrl.path())); - zipUrl.setProtocol("zip"); + zipUrl.setScheme("zip"); QModelIndex index =3D m_dirModel->indexForUrl(zipUrl); QVERIFY(!index.isValid()); // protocol mismatch, can't find it! - zipUrl.setProtocol("file"); + zipUrl.setScheme("file"); index =3D 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 &d= est, = dwFlags =3D 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 &d= est, 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", "sm= b")); + 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 |=3D MOVEFILE_COPY_ALLOWED; = = @@ -356,7 +356,7 @@ void FileProtocol::stat( const KUrl & url ) { if (!url.isLocalFile()) { KUrl redir(url); - redir.setProtocol(config()->readEntry("DefaultRemoteProtocol", "sm= b")); + 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 !=3D FTP_LOGIN) realURL.setUser( m_user ); if (m_pass !=3D 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 =3D 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 =3D dest; if (newDest.scheme() =3D=3D QLatin1String("webdavs")) - newDest.setProtocol(QLatin1String("https")); + newDest.setScheme(QLatin1String("https")); else if (newDest.scheme() =3D=3D QLatin1String("webdav")) - newDest.setProtocol(QLatin1String("http")); + newDest.setScheme(QLatin1String("http")); = m_request.method =3D DAV_COPY; m_request.davData.desturl =3D newDest.url(); @@ -1407,9 +1407,9 @@ void HTTPProtocol::rename( const KUrl& src, const KUr= l& dest, KIO::JobFlags flag // destination has to be "http://..." KUrl newDest =3D dest; if (newDest.scheme() =3D=3D QLatin1String("webdavs")) - newDest.setProtocol(QLatin1String("https")); + newDest.setScheme(QLatin1String("https")); else if (newDest.scheme() =3D=3D QLatin1String("webdav")) - newDest.setProtocol(QLatin1String("http")); + newDest.setScheme(QLatin1String("http")); = m_request.method =3D DAV_MOVE; m_request.davData.desturl =3D 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 strip= ped earlier @@ -3482,9 +3482,9 @@ endParsing: // If we're redirected to a http:// url, remember that we're d= oing webdav... if (m_protocol =3D=3D "webdav" || m_protocol =3D=3D "webdavs"){ if(u.scheme() =3D=3D QLatin1String("http")){ - u.setProtocol(QLatin1String("webdav")); + u.setScheme(QLatin1String("webdav")); }else if(u.scheme() =3D=3D QLatin1String("https")){ - u.setProtocol(QLatin1String("webdavs")); + u.setScheme(QLatin1String("webdavs")); } = m_request.redirectUrl =3D u;