void KrecipesView::print(bool ok)
{
	QPrinter printer;
	QPointer<QPrintPreviewDialog> previewdlg = new QPrintPreviewDialog(&printer, this);
	//Show the print preview dialog.
	connect(previewdlg, SIGNAL(paintRequested(QPrinter *)),
		m_printPage->mainFrame(), SLOT(print(QPrinter *)));
	previewdlg->exec();
	delete previewdlg;
	//Remove the temporary directory which stores the HTML and free memory.
	m_tempdir->unlink();
	delete m_tempdir;
	delete m_printPage;
}
void KrecipesView::print(bool ok)
{
	QPrinter printer;
	QPointer<QPrintPreviewDialog> previewdlg = new QPrintPreviewDialog(&printer, this);
	 
	connect(previewdlg, SIGNAL(paintRequested(QPrinter *)),
		m_printPage->mainFrame(), SLOT(print(QPrinter *)));
	previewdlg->exec();
	delete previewdlg;
	 
	m_tempdir->unlink();
	delete m_tempdir;
	delete m_printPage;
}