Commit 27cb029a authored by Jakub Stachowski's avatar Jakub Stachowski

Fix stopping scan in Konqueror


svn path=/trunk/playground/utils/filelight/; revision=1102759
parent c443b977
......@@ -233,7 +233,7 @@ bool MainWindow::slotScanUrl(const KUrl &url)
inline void MainWindow::slotAbortScan()
{
if (m_part->closeURL()) action("scan_stop")->setEnabled(false);
if (m_part->closeUrl()) action("scan_stop")->setEnabled(false);
}
inline void MainWindow::scanStarted()
......
......@@ -110,12 +110,8 @@ Part::postInit()
{
if (url().isEmpty()) //if url is not empty openUrl() has been called immediately after ctor, which happens
{
m_summary = new SummaryWidget(widget());
m_summary->setObjectName("summaryWidget");
connect(m_summary, SIGNAL(activated(const KUrl&)), SLOT(openUrl(const KUrl&)));
m_map->hide();
m_summary->show();
m_layout->addWidget(m_summary);
showSummary();
//FIXME KXMLGUI is b0rked, it should allow us to set this
//BEFORE createGUI is called but it doesn't
......@@ -175,7 +171,7 @@ Part::openUrl(const KUrl &u)
}
bool
Part::closeURL()
Part::closeUrl()
{
if (m_manager->abort())
statusBar()->showMessage(i18n("Aborting Scan..."));
......@@ -183,7 +179,7 @@ Part::closeURL()
m_map->hide();
m_stateWidget->hide();
m_summary->show();
showSummary();
setUrl(KUrl());
......@@ -306,6 +302,19 @@ Part::mapChanged(const Folder *tree)
}
void
Part::showSummary()
{
if (m_summary == 0) {
m_summary = new SummaryWidget(widget());
m_summary->setObjectName("summaryWidget");
connect(m_summary, SIGNAL(activated(const KUrl&)), SLOT(openUrl(const KUrl&)));
m_summary->show();
m_layout->addWidget(m_summary);
}
else m_summary->show();
}
} //namespace Filelight
#include "part.moc"
......@@ -58,7 +58,7 @@ public:
virtual bool openFile() {
return false; //pure virtual in base class
}
virtual bool closeURL();
virtual bool closeUrl();
QString prettyUrl() const {
return url().protocol() == "file" ? url().path() : url().prettyUrl();
......@@ -80,6 +80,7 @@ private:
KStatusBar *statusBar() {
return m_statusbar->statusBar();
}
void showSummary();
QLayout *m_layout;
QWidget *m_summary;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment