~ubuntu-branches/ubuntu/raring/kdepim/raring-proposed

« back to all changes in this revision

Viewing changes to messageviewer/viewer_p.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-06-07 07:56:38 UTC
  • mfrom: (0.2.27)
  • Revision ID: package-import@ubuntu.com-20120607075638-0luhdq11z7sgvs4m
Tags: 4:4.8.80-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
#include <KTempDir>
58
58
#include <KTemporaryFile>
59
59
#include <KToggleAction>
 
60
#include <KPrintPreview>
 
61
 
 
62
#include <kfileitemactions.h>
 
63
#include <KFileItemListProperties>
60
64
 
61
65
#include <KIO/NetAccess>
62
66
#include <KABC/Addressee>
91
95
#include <QPrintDialog>
92
96
#include <QHeaderView>
93
97
 
 
98
 
94
99
//libkdepim
95
100
#include "libkdepim/broadcaststatus.h"
96
101
#include <messagecore/attachmentpropertiesdialog.h>
125
130
#include "vcardviewer.h"
126
131
#include "mailwebview.h"
127
132
#include "findbar/findbarmailwebview.h"
 
133
#include "translator/translatorwidget.h"
128
134
 
129
135
#include "interfaces/bodypart.h"
130
136
#include "interfaces/htmlwriter.h"
158
164
    mNodeHelper( new NodeHelper ),
159
165
    mViewer( 0 ),
160
166
    mFindBar( 0 ),
 
167
    mTranslatorWidget(0),
161
168
    mAttachmentStrategy( 0 ),
162
169
    mHeaderStrategy( 0 ),
163
170
    mHeaderStyle( 0 ),
183
190
    mZoomTextOnlyAction( 0 ),
184
191
    mZoomInAction( 0 ),
185
192
    mZoomOutAction( 0 ),
186
 
    mZoomResetAction( 0 ), 
 
193
    mZoomResetAction( 0 ),
187
194
    mToggleMimePartTreeAction( 0 ),
 
195
    mSpeakTextAction(0),
188
196
    mCanStartDrag( false ),
189
197
    mHtmlWriter( 0 ),
190
198
    mSavedRelativePosition( 0 ),
208
216
  mHtmlLoadExtOverride = false;
209
217
  mHtmlLoadExternal = false;
210
218
  mZoomTextOnly = false;
211
 
  
 
219
 
212
220
  mUpdateReaderWinTimer.setObjectName( "mUpdateReaderWinTimer" );
213
221
  mResizeTimer.setObjectName( "mResizeTimer" );
214
222
 
215
223
  mExternalWindow  = ( aParent == mainWindow );
216
 
  mSplitterSizes << 180 << 100;
217
224
  mPrinting = false;
218
225
 
219
226
  createWidgets();
345
352
    return;
346
353
 
347
354
  if ( mimetype.isNull() || mimetype->name() == "application/octet-stream" ) {
348
 
    // consider the filename if mimetype can not be found by content-type
 
355
    // consider the filename if mimetype cannot be found by content-type
349
356
    mimetype = KMimeType::findByPath( name, 0, true /* no disk access */  );
350
357
 
351
358
  }
460
467
  return true;
461
468
}
462
469
 
 
470
void ViewerPrivate::createOpenWithMenu( KMenu *topMenu, KMime::Content* node )
 
471
{
 
472
  const QString contentTypeStr = node->contentType()->mimeType();
 
473
  const KService::List offers = KFileItemActions::associatedApplications(QStringList()<<contentTypeStr, QString() );
 
474
  if (!offers.isEmpty()) {
 
475
    QMenu* menu = topMenu;
 
476
    QActionGroup *actionGroup = new QActionGroup( menu );
 
477
    connect( actionGroup, SIGNAL(triggered(QAction*)), this, SLOT(slotOpenWithAction(QAction*)) );
 
478
 
 
479
    if (offers.count() > 1) { // submenu 'open with'
 
480
      menu = new QMenu(i18nc("@title:menu", "&Open With"), topMenu);
 
481
      menu->menuAction()->setObjectName("openWith_submenu"); // for the unittest
 
482
      topMenu->addMenu(menu);
 
483
    }
 
484
    //kDebug() << offers.count() << "offers" << topMenu << menu;
 
485
 
 
486
    KService::List::ConstIterator it = offers.constBegin();
 
487
    for(; it != offers.constEnd(); it++) {
 
488
      KAction* act = createAppAction(*it,
 
489
                                        // no submenu -> prefix single offer
 
490
                                        menu == topMenu, actionGroup);
 
491
      menu->addAction(act);
 
492
    }
 
493
 
 
494
    QString openWithActionName;
 
495
    if (menu != topMenu) { // submenu
 
496
      menu->addSeparator();
 
497
      openWithActionName = i18nc("@action:inmenu Open With", "&Other...");
 
498
    } else {
 
499
      openWithActionName = i18nc("@title:menu", "&Open With...");
 
500
    }
 
501
    KAction *openWithAct = new KAction(this);
 
502
    openWithAct->setText(openWithActionName);
 
503
    QObject::connect(openWithAct, SIGNAL(triggered()), this, SLOT(slotOpenWithDialog()));
 
504
    menu->addAction(openWithAct);
 
505
  }
 
506
  else { // no app offers -> Open With...
 
507
    KAction *act = new KAction(this);
 
508
    act->setText(i18nc("@title:menu", "&Open With..."));
 
509
    QObject::connect(act, SIGNAL(triggered()), this, SLOT(slotOpenWithDialog()));
 
510
    topMenu->addAction(act);
 
511
  }
 
512
}
 
513
 
 
514
void ViewerPrivate::slotOpenWithDialog()
 
515
{
 
516
  if ( !mCurrentContent )
 
517
    return;
 
518
  attachmentOpenWith( mCurrentContent );
 
519
}
 
520
 
 
521
KAction* ViewerPrivate::createAppAction(const KService::Ptr& service, bool singleOffer, QActionGroup *actionGroup )
 
522
{
 
523
  QString actionName(service->name().replace('&', "&&"));
 
524
  if (singleOffer) {
 
525
    actionName = i18n("Open &with %1", actionName);
 
526
  } else {
 
527
    actionName = i18nc("@item:inmenu Open With, %1 is application name", "%1", actionName);
 
528
  }
 
529
 
 
530
  KAction *act = new KAction(this);
 
531
  act->setIcon(KIcon(service->icon()));
 
532
  act->setText(actionName);
 
533
  actionGroup->addAction( act );
 
534
  act->setData(QVariant::fromValue(service));
 
535
  return act;
 
536
}
 
537
 
 
538
void ViewerPrivate::slotOpenWithAction(QAction *act)
 
539
{
 
540
  if(!mCurrentContent)
 
541
    return;
 
542
 
 
543
  KService::Ptr app = act->data().value<KService::Ptr>();
 
544
  attachmentOpen( mCurrentContent, app );
 
545
}
 
546
 
 
547
 
463
548
void ViewerPrivate::showAttachmentPopup( KMime::Content* node, const QString & name, const QPoint & globalPos )
464
549
{
465
550
  prepareHandleAttachment( node, name );
474
559
  connect( action, SIGNAL(triggered(bool)), attachmentMapper, SLOT(map()) );
475
560
  attachmentMapper->setMapping( action, Viewer::Open );
476
561
 
477
 
  action = menu->addAction(i18n("Open With..."));
478
 
  connect( action, SIGNAL(triggered(bool)), attachmentMapper, SLOT(map()) );
479
 
  attachmentMapper->setMapping( action, Viewer::OpenWith );
 
562
  createOpenWithMenu( menu, node );
480
563
 
481
564
  action = menu->addAction(i18nc("to view something", "View") );
482
565
  connect( action, SIGNAL(triggered(bool)), attachmentMapper, SLOT(map()) );
539
622
{
540
623
  QFileInfo atmFileInfo( atmFileName );
541
624
 
542
 
  // tempfile name ist /TMP/attachmentsRANDOM/atmFileInfo.fileName()"
 
625
  // tempfile name is /TMP/attachmentsRANDOM/atmFileInfo.fileName()"
543
626
  KTempDir *linkDir = new KTempDir( KStandardDirs::locateLocal( "tmp", "attachments" ) );
544
627
  QString linkPath = linkDir->name() + atmFileInfo.fileName();
545
628
  QFile *linkFile = new QFile( linkPath );
571
654
  }
572
655
 
573
656
  if ( mimetype.isNull() ) {
574
 
    // consider the filename if mimetype can not be found by content-type
 
657
    // consider the filename if mimetype cannot be found by content-type
575
658
    mimetype = KMimeType::findByPath( fileName, 0, true /* no disk access */ );
576
659
  }
577
660
  if ( ( mimetype->name() == "application/octet-stream" )
631
714
    kDebug() << "got no offer";
632
715
    return;
633
716
  }
 
717
  attachmentOpen( node, offer );
 
718
}
 
719
 
 
720
void ViewerPrivate::attachmentOpen( KMime::Content *node, KService::Ptr offer )
 
721
{
634
722
  const QString name = mNodeHelper->writeNodeToTempFile( node );
635
723
  KUrl::List lst;
636
724
  KUrl url;
763
851
  if ( !col.isValid() )
764
852
    return;
765
853
  Akonadi::AgentInstance::List instances = Akonadi::AgentManager::self()->instances();
766
 
  QString itemResource = col.resource();
 
854
  const QString itemResource = col.resource();
767
855
  Akonadi::AgentInstance resourceInstance;
768
856
  foreach ( const Akonadi::AgentInstance &instance, instances ) {
769
857
    if ( instance.identifier() == itemResource ) {
970
1058
           this, SLOT(slotUrlOn(QString,QString,QString)) );
971
1059
  connect( mViewer, SIGNAL(linkClicked(QUrl)),
972
1060
           this, SLOT(slotUrlOpen(QUrl)), Qt::QueuedConnection );
973
 
  connect( mViewer, SIGNAL(popupMenu(QUrl,QPoint)),
974
 
           SLOT(slotUrlPopup(QUrl,QPoint)) );
 
1061
  connect( mViewer, SIGNAL(popupMenu(QUrl,QUrl,QPoint)),
 
1062
           SLOT(slotUrlPopup(QUrl,QUrl,QPoint)) );
975
1063
}
976
1064
 
977
1065
bool ViewerPrivate::eventFilter( QObject *, QEvent *e )
1046
1134
 
1047
1135
  mZoomTextOnly = GlobalSettings::self()->zoomTextOnly();
1048
1136
  setZoomTextOnly( mZoomTextOnly );
1049
 
  
 
1137
 
1050
1138
  KToggleAction *raction = actionForHeaderStyle( headerStyle(), headerStrategy() );
1051
1139
  if ( raction )
1052
1140
    raction->setChecked( true );
1056
1144
  if ( raction )
1057
1145
    raction->setChecked( true );
1058
1146
 
1059
 
  const int mimeH = GlobalSettings::self()->mimePaneHeight();
1060
 
  const int messageH = GlobalSettings::self()->messagePaneHeight();
1061
 
  mSplitterSizes.clear();
1062
 
  if ( GlobalSettings::self()->mimeTreeLocation() == GlobalSettings::EnumMimeTreeLocation::bottom )
1063
 
    mSplitterSizes << messageH << mimeH;
1064
 
  else
1065
 
    mSplitterSizes << mimeH << messageH;
1066
 
 
1067
1147
  adjustLayout();
1068
1148
 
1069
1149
  readGlobalOverrideCodec();
1077
1157
  mViewer->settings()->setFontSize( QWebSettings::MinimumFontSize, GlobalSettings::self()->minimumFontSize() );
1078
1158
  mViewer->settings()->setFontSize( QWebSettings::MinimumLogicalFontSize, GlobalSettings::self()->minimumFontSize() );
1079
1159
#endif
1080
 
  
 
1160
 
1081
1161
  if ( mMessage )
1082
1162
    update();
1083
1163
  mColorBar->update();
1106
1186
 
1107
1187
  if ( mHeaderStyle == style && mHeaderStrategy == strategy )
1108
1188
    return;
1109
 
  
 
1189
 
1110
1190
  mHeaderStyle = style ? style : HeaderStyle::fancy();
1111
1191
  mHeaderStrategy = strategy ? strategy : HeaderStrategy::rich();
1112
1192
  if ( mHeaderOnlyAttachmentsAction ) {
1120
1200
    }
1121
1201
  }
1122
1202
  update( Viewer::Force );
1123
 
  
 
1203
 
1124
1204
  if( !mExternalWindow && writeInConfigFile)
1125
1205
    writeConfig();
1126
1206
 
1176
1256
#endif
1177
1257
}
1178
1258
 
 
1259
void ViewerPrivate::printPreviousMessage( const Akonadi::Item &message )
 
1260
{
 
1261
// wince does not support printing
 
1262
#ifndef Q_OS_WINCE
 
1263
  disconnect( mPartHtmlWriter, SIGNAL(finished()), this, SLOT(slotPrintPreview()) );
 
1264
  connect( mPartHtmlWriter, SIGNAL(finished()), this, SLOT(slotPrintPreview()) );
 
1265
  setMessageItem( message, Viewer::Force );
 
1266
#endif
 
1267
}
 
1268
 
 
1269
 
1179
1270
void ViewerPrivate::resetStateForNewMessage()
1180
1271
{
1181
1272
  mClickedUrl.clear();
 
1273
  mImageUrl.clear();
1182
1274
  enableMessageDisplay(); // just to make sure it's on
1183
1275
  mMessage.reset();
1184
1276
  mNodeHelper->clear();
1188
1280
  setShowSignatureDetails( false );
1189
1281
  mShowRawToltecMail = !GlobalSettings::self()->showToltecReplacementText();
1190
1282
  mFindBar->closeBar();
 
1283
  mTranslatorWidget->slotCloseWidget();
 
1284
 
1191
1285
  if ( mPrinting )
1192
1286
    mLevelQuote = -1;
1193
1287
}
1299
1393
void ViewerPrivate::adjustLayout()
1300
1394
{
1301
1395
#ifndef QT_NO_TREEVIEW
 
1396
  const int mimeH = GlobalSettings::self()->mimePaneHeight();
 
1397
  const int messageH = GlobalSettings::self()->messagePaneHeight();
 
1398
  QList<int> splitterSizes;
 
1399
  if ( GlobalSettings::self()->mimeTreeLocation() == GlobalSettings::EnumMimeTreeLocation::bottom )
 
1400
    splitterSizes << messageH << mimeH;
 
1401
  else
 
1402
    splitterSizes << mimeH << messageH;
 
1403
 
1302
1404
  if ( GlobalSettings::self()->mimeTreeLocation() == GlobalSettings::EnumMimeTreeLocation::bottom )
1303
1405
    mSplitter->addWidget( mMimePartTree );
1304
1406
  else
1305
1407
    mSplitter->insertWidget( 0, mMimePartTree );
1306
 
  mSplitter->setSizes( mSplitterSizes );
 
1408
  mSplitter->setSizes( splitterSizes );
1307
1409
 
1308
1410
  if ( GlobalSettings::self()->mimeTreeMode() == GlobalSettings::EnumMimeTreeMode::Always &&
1309
1411
       mMsgDisplay )
1339
1441
  QVBoxLayout * vlay = new QVBoxLayout( q );
1340
1442
  vlay->setMargin( 0 );
1341
1443
  mSplitter = new QSplitter( Qt::Vertical, q );
 
1444
  connect(mSplitter, SIGNAL(splitterMoved(int,int)), this, SLOT(saveSplitterSizes()));
1342
1445
  mSplitter->setObjectName( "mSplitter" );
1343
1446
  mSplitter->setChildrenCollapsible( false );
1344
1447
  vlay->addWidget( mSplitter );
1375
1478
  mViewer->setObjectName( "mViewer" );
1376
1479
 
1377
1480
  mFindBar = new FindBarMailWebView( mViewer, readerBox );
 
1481
  mTranslatorWidget = new TranslatorWidget(readerBox);
1378
1482
#ifndef QT_NO_TREEVIEW
1379
1483
  mSplitter->setStretchFactor( mSplitter->indexOf(mMimePartTree), 0 );
1380
1484
#endif
1559
1663
  connect(mZoomResetAction, SIGNAL(triggered(bool)), SLOT(slotZoomReset()));
1560
1664
  mZoomResetAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_0));
1561
1665
 
1562
 
  
 
1666
 
1563
1667
  // Show message structure viewer
1564
1668
  mToggleMimePartTreeAction = new KToggleAction( i18n( "Show Message Structure" ), this );
1565
1669
  ac->addAction( "toggle_mimeparttree", mToggleMimePartTreeAction );
1614
1718
  connect( mToggleDisplayModeAction, SIGNAL(triggered(bool)),
1615
1719
           SLOT(slotToggleHtmlMode()) );
1616
1720
  mToggleDisplayModeAction->setHelpText( i18n( "Toggle display mode between HTML and plain text" ) );
 
1721
 
 
1722
 
 
1723
  mSpeakTextAction = new KAction(i18n("Speak Text"),this);
 
1724
  mSpeakTextAction->setIcon(KIcon("preferences-desktop-text-to-speech"));
 
1725
  ac->addAction( "speak_text", mSpeakTextAction );
 
1726
  connect( mSpeakTextAction, SIGNAL(triggered(bool)),
 
1727
           this, SLOT(slotSpeakText()) );
 
1728
 
 
1729
  mCopyImageLocation = new KAction(i18n("Copy Image Location"),this);
 
1730
  mCopyImageLocation->setIcon(KIcon("view-media-visualization"));
 
1731
  ac->addAction("copy_image_location", mCopyImageLocation);
 
1732
  mCopyImageLocation->setShortcutConfigurable( false );
 
1733
  connect( mCopyImageLocation, SIGNAL(triggered(bool)),
 
1734
           SLOT(slotCopyImageLocation()) );
 
1735
 
 
1736
  mTranslateAction = new KAction(i18n("Translate..."),this);
 
1737
  mTranslateAction->setIcon(KIcon("preferences-desktop-locale"));
 
1738
  ac->addAction("translate_text", mTranslateAction);
 
1739
  connect( mTranslateAction, SIGNAL(triggered(bool)),
 
1740
           SLOT(slotTranslate()) );
 
1741
 
1617
1742
}
1618
1743
 
1619
1744
 
1900
2025
  emit showStatusBarMessage( msg );
1901
2026
}
1902
2027
 
1903
 
void ViewerPrivate::slotUrlPopup(const QUrl &aUrl, const QPoint& aPos)
 
2028
void ViewerPrivate::slotUrlPopup(const QUrl &aUrl, const QUrl &imageUrl, const QPoint& aPos)
1904
2029
{
1905
2030
  const KUrl url( aUrl );
 
2031
  const KUrl iUrl( imageUrl );
1906
2032
  mClickedUrl = url;
 
2033
  mImageUrl = iUrl;
1907
2034
 
1908
2035
  if ( URLHandlerManager::instance()->handleContextMenuRequest( url, aPos, this ) )
1909
2036
    return;
1917
2044
    mCopyURLAction->setText( i18n( "Copy Link Address" ) );
1918
2045
  }
1919
2046
 
1920
 
  emit popupMenu( mMessageItem, aUrl, aPos );
 
2047
  emit popupMenu( mMessageItem, aUrl, imageUrl, aPos );
1921
2048
}
1922
2049
 
1923
2050
void ViewerPrivate::slotToggleHtmlMode()
1930
2057
 
1931
2058
void ViewerPrivate::slotFind()
1932
2059
{
 
2060
#if QT_VERSION >= 0x040800
1933
2061
  if ( mViewer->hasSelection() )
1934
2062
    mFindBar->setText( mViewer->selectedText() );
 
2063
#endif
1935
2064
  mFindBar->show();
1936
2065
  mFindBar->focusAndSetCursor();
1937
2066
}
1938
2067
 
 
2068
void ViewerPrivate::slotTranslate()
 
2069
{
 
2070
  const QString text = mViewer->selectedText();
 
2071
  mTranslatorWidget->show();
 
2072
  if(!text.isEmpty())
 
2073
    mTranslatorWidget->setTextToTranslate(text);
 
2074
}
1939
2075
 
1940
2076
void ViewerPrivate::slotToggleFixedFont()
1941
2077
{
2185
2321
  mSplitter->setGeometry( 0, 0, q->width(), q->height() );
2186
2322
}
2187
2323
 
 
2324
void ViewerPrivate::slotPrintPreview()
 
2325
{
 
2326
  disconnect( mPartHtmlWriter, SIGNAL(finished()), this, SLOT(slotPrintPreview()) );
 
2327
  // wince does not support printing
 
2328
#ifndef Q_OS_WINCE
 
2329
  if ( !mMessage )
 
2330
    return;
 
2331
  QPrinter printer;
 
2332
  KPrintPreview previewdlg( &printer, mViewer );
 
2333
  mViewer->print( &printer );
 
2334
  previewdlg.exec();
 
2335
#endif
 
2336
}
2188
2337
 
2189
2338
void ViewerPrivate::slotPrintMsg()
2190
2339
{
2191
2340
  disconnect( mPartHtmlWriter, SIGNAL(finished()), this, SLOT(slotPrintMsg()) );
2192
 
  if ( !mMessage ) return;
2193
2341
 
2194
2342
// wince does not support printing
2195
2343
#ifndef Q_OS_WINCE
 
2344
  if ( !mMessage )
 
2345
    return;
2196
2346
  QPrinter printer;
2197
2347
 
2198
2348
  AutoQPointer<QPrintDialog> dlg( new QPrintDialog( &printer, mViewer ) );
2351
2501
 
2352
2502
void ViewerPrivate::attachmentCopy( const KMime::Content::List & contents )
2353
2503
{
2354
 
#ifndef QT_NO_CLIPBOARD 
 
2504
#ifndef QT_NO_CLIPBOARD
2355
2505
  if ( contents.isEmpty() )
2356
2506
    return;
2357
2507
 
2434
2584
 
2435
2585
void ViewerPrivate::slotHandleAttachment( int choice )
2436
2586
{
2437
 
  //mAtmUpdate = true;
2438
2587
  if(!mCurrentContent)
2439
2588
    return;
2440
2589
  if ( choice == Viewer::Delete ) {
2463
2612
  }
2464
2613
}
2465
2614
 
 
2615
void ViewerPrivate::slotSpeakText()
 
2616
{
 
2617
  const QString text = mViewer->selectedText();
 
2618
  MessageViewer::Util::speakSelectedText( text, mMainWindow);
 
2619
}
 
2620
 
 
2621
void ViewerPrivate::slotCopyImageLocation()
 
2622
{
 
2623
#ifndef QT_NO_CLIPBOARD
 
2624
  QApplication::clipboard()->setText( mImageUrl.url() );
 
2625
#endif
 
2626
}
 
2627
 
2466
2628
void ViewerPrivate::slotCopySelectedText()
2467
2629
{
2468
2630
#ifndef QT_NO_CLIPBOARD
2515
2677
 
2516
2678
void ViewerPrivate::slotSaveMessage()
2517
2679
{
2518
 
  if( !mMessageItem.hasPayload<KMime::Message::Ptr>() )
2519
 
    return;
2520
 
  Util::saveMessageInMbox( QList<Akonadi::Item>()<<mMessageItem, mMainWindow );  
 
2680
  if ( !mMessageItem.isValid() ) {
 
2681
    return;
 
2682
  }
 
2683
 
 
2684
  if ( !mMessageItem.hasPayload<KMime::Message::Ptr>() ) {
 
2685
    if ( mMessageItem.isValid() ) {
 
2686
      kWarning() << "Payload is not a MessagePtr!";
 
2687
    }
 
2688
    return;
 
2689
  }
 
2690
 
 
2691
  Util::saveMessageInMbox( QList<Akonadi::Item>() << mMessageItem, mMainWindow );
2521
2692
}
2522
2693
 
2523
2694
void ViewerPrivate::saveRelativePosition()
2874
3045
 
2875
3046
void ViewerPrivate::setZoomFactor( qreal zoomFactor )
2876
3047
{
2877
 
#ifndef KDEPIM_NO_WEBKIT  
 
3048
#ifndef KDEPIM_NO_WEBKIT
2878
3049
  mViewer->setZoomFactor ( zoomFactor );
2879
 
#endif  
 
3050
#endif
2880
3051
}
2881
3052
 
2882
3053
 
2883
3054
void ViewerPrivate::slotZoomIn()
2884
3055
{
2885
 
#ifndef KDEPIM_NO_WEBKIT  
 
3056
#ifndef KDEPIM_NO_WEBKIT
2886
3057
  if( mZoomFactor >= 300 )
2887
3058
    return;
2888
3059
  mZoomFactor += zoomBy;
2889
3060
  if( mZoomFactor > 300 )
2890
3061
    mZoomFactor = 300;
2891
3062
  mViewer->setZoomFactor( mZoomFactor/100.0 );
2892
 
#endif  
 
3063
#endif
2893
3064
}
2894
3065
 
2895
3066
void ViewerPrivate::slotZoomOut()
2896
3067
{
2897
 
#ifndef KDEPIM_NO_WEBKIT  
 
3068
#ifndef KDEPIM_NO_WEBKIT
2898
3069
  if ( mZoomFactor <= 100 )
2899
3070
    return;
2900
3071
  mZoomFactor -= zoomBy;
2911
3082
  {
2912
3083
    mZoomTextOnlyAction->setChecked( mZoomTextOnly );
2913
3084
  }
2914
 
#ifndef KDEPIM_NO_WEBKIT    
 
3085
#ifndef KDEPIM_NO_WEBKIT
2915
3086
  mViewer->settings()->setAttribute(QWebSettings::ZoomTextOnly, mZoomTextOnly);
2916
 
#endif  
 
3087
#endif
2917
3088
}
2918
3089
 
2919
3090
void ViewerPrivate::slotZoomTextOnly()
2923
3094
 
2924
3095
void ViewerPrivate::slotZoomReset()
2925
3096
{
2926
 
#ifndef KDEPIM_NO_WEBKIT  
 
3097
#ifndef KDEPIM_NO_WEBKIT
2927
3098
  mZoomFactor = 100;
2928
3099
  mViewer->setZoomFactor( 1.0 );
2929
3100
#endif
2934
3105
  emit resumeNetworkJobs();
2935
3106
}
2936
3107
 
 
3108
 
 
3109
 
2937
3110
#include "viewer_p.moc"