KanKer 发表于 2005-4-27 20:16:56

修正konqueror无法下载公社自由软件某些链接的补丁


--- kdelibs-3.4.0/kio/kio/job.cpp       2005-03-17 23:18:22.000000000 +0800
+++ kdelibs-3.4.0/kio/kio/job.cpp.new   2005-04-27 19:32:40.000000000 +0800
@@ -864,17 +864,20 @@
// Slave got a redirection request
void TransferJob::slotRedirection( const KURL &url)
{
-   kdDebug(7007) << "TransferJob::slotRedirection(" << url << ")" << endl;
-   if (!kapp->authorizeURLAction("redirect", m_url, url))
+// Patched by KanKer.
+   KURL myurl=url;
+   myurl.setPath(QString::fromLocal8Bit(url.path().latin1()));
+   kdDebug(7007) << "TransferJob::slotRedirection(" << myurl << ")" << endl;
+   if (!kapp->authorizeURLAction("redirect", m_url, myurl))
      {
-       kdWarning(7007) << "TransferJob: Redirection from " << m_url << " to " << url << " REJECTED!" << endl;
+       kdWarning(7007) << "TransferJob: Redirection from " << m_url << " to " << myurl << " REJECTED!" << endl;
      return;
      }

   // Some websites keep redirecting to themselves where each redirection
   // acts as the stage in a state-machine. We define "endless redirections"
   // as 5 redirections to the same URL.
-    if (m_redirectionList.contains(url) > 5)
+    if (m_redirectionList.contains(myurl) > 5)
   {
      kdDebug(7007) << "TransferJob::slotRedirection: CYCLIC REDIRECTION!" << endl;
      m_error = ERR_CYCLIC_LINK;
@@ -882,10 +885,10 @@
   }
   else
   {
-       m_redirectionURL = url; // We'll remember that when the job finishes
-       if (m_url.hasUser() && !url.hasUser() && (m_url.host().lower() == url.host().lower()))
+       m_redirectionURL = myurl; // We'll remember that when the job finishes
+       if (m_url.hasUser() && !myurl.hasUser() && (m_url.host().lower() == myurl.host().lower()))
         m_redirectionURL.setUser(m_url.user()); // Preserve user
-       m_redirectionList.append(url);
+       m_redirectionList.append(myurl);
      m_outgoingMetaData["ssl_was_in_use"] = m_incomingMetaData["ssl_in_use"];
      // Tell the user that we haven't finished yet
      emit redirection(this, m_redirectionURL);


MagicLinux的kdelibs更新为3mgc,下载地址:
http://www.magiclinux.org/people/kanker/kde/3.4.0/rpms/

另kdeutils也做了更新,去掉了khexedit对application/octet-stream类型的关联,可使konqueror下的下载更方便些。

turingcat 发表于 2005-4-27 20:47:50

这个要怎么改呢?
写到源码里面去?源码在哪呢?
页: [1]
查看完整版本: 修正konqueror无法下载公社自由软件某些链接的补丁