Commit 3f35e0bb authored by Laurent Montel's avatar Laurent Montel 😁

Use KPrintPreview::isAvailable

parent a959629f
......@@ -37,7 +37,7 @@
#include <KActionCollection>
#include <KMimeTypeTrader>
#include <KPrintPreview>
KOEventPopupMenu::KOEventPopupMenu( Akonadi::ETMCalendar * calendar, QWidget *parent )
: QMenu( parent ), mCalendar( calendar )
{
......@@ -51,11 +51,11 @@ KOEventPopupMenu::KOEventPopupMenu( Akonadi::ETMCalendar * calendar, QWidget *pa
mEditOnlyItems.append( addSeparator() );
addAction( KOGlobals::self()->smallIcon( QLatin1String("document-print") ), i18n( "&Print..." ),
this, SLOT(print()) );
QAction *preview = addAction( KOGlobals::self()->smallIcon( QLatin1String("document-print-preview") ),
if (KPrintPreview::isAvailable()) {
addAction( KOGlobals::self()->smallIcon( QLatin1String("document-print-preview") ),
i18n( "Print Previe&w..." ),
this, SLOT(printPreview()) );
preview->setEnabled( !KMimeTypeTrader::self()->query(QLatin1String( "application/pdf"),
QLatin1String("KParts/ReadOnlyPart") ).isEmpty() );
}
//------------------------------------------------------------------------
mEditOnlyItems.append( addSeparator() );
mEditOnlyItems.append( addAction( KOGlobals::self()->smallIcon( QLatin1String("edit-cut") ),
......
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