SLOT(slotStopLoading()),
actionCollection(),
"threadview_stop");
+
+ new KAction(i18n("Delete"),
+ "edittrash",
+ Key_Delete,
+ m_threadview,
+ SLOT(slotDeleteButtonClicked()),
+ actionCollection(),
+ "threadview_delete");
+
}
KParts::BrowserExtension* KitaThreadPart::browserExtension() const
void KitaThreadView::slotDeleteButtonClicked()
{
- if ( !m_datURL.isEmpty()
- && QMessageBox::warning( this,
- "Kita",
- "Do you want to delete Log ?",
- QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default )
- == QMessageBox::Ok )
- {
- Kita::DatManager::deleteCache( threadURL(), this );
- emit closeThreadTab( m_datURL );
- emit updateSubjectTab( m_datURL );
+ if( m_datURL.isEmpty() ) return;
+
+ int rescode = Kita::DatManager::getResponseCode( m_datURL );
+ int readNum = Kita::DatManager::getReadNum( m_datURL );
+ if( ( rescode != 200 && rescode != 206) || readNum >= 900 ){
+ if( QMessageBox::warning( this,
+ "Kita",
+ "Do you want to delete Log ?",
+ QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default )
+ != QMessageBox::Ok ) return;
}
+
+ Kita::DatManager::deleteCache( threadURL(), this );
+ emit closeThreadTab( m_datURL );
+ emit updateSubjectTab( m_datURL );
}
/*--------------------------------------------------------*/
void slotReloadButton();
void slotStopLoading();
void focusSearchCombo();
+ void slotDeleteButtonClicked();
protected slots:
void slotDOMNodeActivated( const DOM::Node& node );
void slotShowErrorDialog( const QString& input, const KURL& urlOfInput = 0 );
void slotComboActivated( int index );
void slotUpdateInfo();
- void slotDeleteButtonClicked();
signals:
void datURLRedirected( const KURL& newDatURL );