From kde-commits Sat Mar 13 14:37:17 2010 From: Jakub Stachowski Date: Sat, 13 Mar 2010 14:37:17 +0000 To: kde-commits Subject: playground/utils/filelight/src Message-Id: <1268491037.192047.31295.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=126849104806926 SVN commit 1102759 by qbast: Fix stopping scan in Konqueror M +1 -1 app/mainWindow.cpp M +16 -7 part/part.cpp M +2 -1 part/part.h --- trunk/playground/utils/filelight/src/app/mainWindow.cpp #1102758:1102759 @@ -233,7 +233,7 @@ 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() --- trunk/playground/utils/filelight/src/part/part.cpp #1102758:1102759 @@ -110,12 +110,8 @@ { 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 @@ } bool -Part::closeURL() +Part::closeUrl() { if (m_manager->abort()) statusBar()->showMessage(i18n("Aborting Scan...")); @@ -183,7 +179,7 @@ m_map->hide(); m_stateWidget->hide(); - m_summary->show(); + showSummary(); setUrl(KUrl()); @@ -306,6 +302,19 @@ } +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" --- trunk/playground/utils/filelight/src/part/part.h #1102758:1102759 @@ -58,7 +58,7 @@ 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 @@ KStatusBar *statusBar() { return m_statusbar->statusBar(); } + void showSummary(); QLayout *m_layout; QWidget *m_summary;