summaryrefslogtreecommitdiff
path: root/src/protocolhandler.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-05-17 17:00:07 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-05-17 17:01:30 +0200
commitf076ea2c8f3b1d4b7ff60d7ad02229baf36ae037 (patch)
tree4726c2865ee81b68c988bb8e49418edd5c6bf5aa /src/protocolhandler.cpp
parentWebkit --> WebKit (diff)
downloadrekonq-f076ea2c8f3b1d4b7ff60d7ad02229baf36ae037.tar.xz
Fix crashes on file:// urls
Diffstat (limited to 'src/protocolhandler.cpp')
-rw-r--r--src/protocolhandler.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp
index 63bc640d..4a25ccd7 100644
--- a/src/protocolhandler.cpp
+++ b/src/protocolhandler.cpp
@@ -65,7 +65,7 @@
ProtocolHandler::ProtocolHandler(QObject *parent)
: QObject(parent)
- , _lister(0)
+ , _lister( new KDirLister(this) )
, _frame(0)
{
}
@@ -73,6 +73,7 @@ ProtocolHandler::ProtocolHandler(QObject *parent)
ProtocolHandler::~ProtocolHandler()
{
+ delete _lister;
}
@@ -96,7 +97,7 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra
if(scriptSource.isEmpty()) {
// if javascript:<code here> then authority() returns
// an empty string. Extract the source manually
-// Use the prettyUrl() since that is unencoded
+ // Use the prettyUrl() since that is unencoded
// 11 is length of 'javascript:'
// fromPercentEncoding() is used to decode all the % encoded
@@ -202,10 +203,6 @@ bool ProtocolHandler::postHandling(const QNetworkRequest &request, QWebFrame *fr
QFileInfo fileInfo(_url.path());
if (fileInfo.isDir())
{
- if(_lister)
- delete _lister;
-
- _lister = new KDirLister(this);
connect(_lister, SIGNAL(newItems(const KFileItemList &)), this, SLOT(showResults(const KFileItemList &)));
_lister->openUrl(_url);
@@ -234,8 +231,6 @@ void ProtocolHandler::showResults(const KFileItemList &list)
Application::instance()->mainWindow()->currentTab()->setFocus();
Application::historyManager()->addHistoryEntry(_url.prettyUrl());
}
-
- delete _lister;
}
@@ -325,10 +320,6 @@ void ProtocolHandler::slotMostLocalUrlResult(KJob *job)
KIO::UDSEntry entry = statJob->statResult();
if (entry.isDir())
{
- if(_lister)
- delete _lister;
-
- _lister = new KDirLister(this);
connect(_lister, SIGNAL(newItems(const KFileItemList &)), this, SLOT(showResults(const KFileItemList &)));
_lister->openUrl(_url);
}