summaryrefslogtreecommitdiff
path: root/src/protocolhandler.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-05-04 09:19:16 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-05-04 09:19:16 +0200
commit7ea1b6add7ebef4d475801e15e89992e734617c1 (patch)
treea083886be1493a1616ef380e8ccad40e09e49e1f /src/protocolhandler.cpp
parentFix conflicts (diff)
downloadrekonq-7ea1b6add7ebef4d475801e15e89992e734617c1.tar.xz
Memory leaks fixes
first bunch
Diffstat (limited to 'src/protocolhandler.cpp')
-rw-r--r--src/protocolhandler.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp
index 51bd7e9a..82d39225 100644
--- a/src/protocolhandler.cpp
+++ b/src/protocolhandler.cpp
@@ -73,6 +73,7 @@ ProtocolHandler::ProtocolHandler(QObject *parent)
ProtocolHandler::~ProtocolHandler()
{
+ delete _lister;
}
@@ -189,6 +190,9 @@ bool ProtocolHandler::postHandling(const QNetworkRequest &request, QWebFrame *fr
QFileInfo fileInfo(_url.path());
if (fileInfo.isDir())
{
+ if(_lister)
+ delete _lister;
+
_lister = new KDirLister;
connect(_lister, SIGNAL(newItems(const KFileItemList &)), this, SLOT(showResults(const KFileItemList &)));
_lister->openUrl(_url);
@@ -209,15 +213,16 @@ void ProtocolHandler::showResults(const KFileItemList &list)
if (!_lister->rootItem().isNull() && _lister->rootItem().isReadable() && _lister->rootItem().isFile())
{
emit downloadUrl(_lister->rootItem().url());
- return;
}
+ else
+ {
+ QString html = dirHandling(list);
+ _frame->setHtml(html, _url);
- QString html = dirHandling(list);
- _frame->setHtml(html, _url);
-
- Application::instance()->mainWindow()->currentTab()->setFocus();
- Application::historyManager()->addHistoryEntry(_url.prettyUrl());
-
+ Application::instance()->mainWindow()->currentTab()->setFocus();
+ Application::historyManager()->addHistoryEntry(_url.prettyUrl());
+ }
+
delete _lister;
}
@@ -308,6 +313,9 @@ void ProtocolHandler::slotMostLocalUrlResult(KJob *job)
KIO::UDSEntry entry = statJob->statResult();
if (entry.isDir())
{
+ if(_lister)
+ delete _lister;
+
_lister = new KDirLister;
connect(_lister, SIGNAL(newItems(const KFileItemList &)), this, SLOT(showResults(const KFileItemList &)));
_lister->openUrl(_url);