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

Use KPrintPreview::isAvailable

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