QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 613|回复: 1

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

[复制链接]
发表于 2005-4-27 20:16:56 | 显示全部楼层 |阅读模式
[code:1]
--- 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);
[/code:1]

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

另kdeutils也做了更新,去掉了khexedit对application/octet-stream类型的关联,可使konqueror下的下载更方便些。
发表于 2005-4-27 20:47:50 | 显示全部楼层
这个要怎么改呢?
写到源码里面去?源码在哪呢?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-26 10:42 , Processed in 0.041611 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表