From 28d697b94c8400ee7468aa9094cb6762d683d38e Mon Sep 17 00:00:00 2001 From: nowrep Date: Sat, 30 Mar 2013 21:15:47 +0100 Subject: [PATCH] [PAC] Don't copy local PAC files into profile. --- src/lib/network/pac/pacmanager.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lib/network/pac/pacmanager.cpp b/src/lib/network/pac/pacmanager.cpp index e4ff2ab43..be09cecd6 100644 --- a/src/lib/network/pac/pacmanager.cpp +++ b/src/lib/network/pac/pacmanager.cpp @@ -61,6 +61,16 @@ void PacManager::downloadPacFile() return; } + if (m_url.isLocalFile()) { + if (!QFile(m_url.path()).exists()) { + qWarning() << "PacManager: PAC file " << m_url.path() << "doesn't exists!"; + } + else { + reloadScript(); + } + return; + } + m_reply = new FollowRedirectReply(m_url, mApp->networkManager()); connect(m_reply, SIGNAL(finished()), this, SLOT(replyFinished())); } @@ -107,7 +117,7 @@ void PacManager::reloadScript() m_pacrunner = new ProxyAutoConfig(this); } - QFile file(mApp->currentProfilePath() + "proxy.pac"); + QFile file(m_url.isLocalFile() ? m_url.path() : mApp->currentProfilePath() + "proxy.pac"); if (!file.open(QFile::ReadOnly)) { qWarning() << "PacManager: Cannot open PAC file for reading" << file.fileName();