Fix building okular without QTextToSpeech by adding ifdefs.

Also hide speech box in gui if built without tts features.
remotes/origin/session-restoration
Jeremy Whiting 7 years ago committed by Oliver Sander
parent ef52350f7d
commit 67e7dc8f4c
  1. 6
      conf/dlgaccessibility.cpp

@ -13,7 +13,9 @@
#include "settings.h"
#ifdef HAVE_SPEECH
#include <QtTextToSpeech>
#endif
DlgAccessibility::DlgAccessibility( QWidget * parent )
: QWidget( parent ), m_selected( 0 )
@ -32,12 +34,16 @@ DlgAccessibility::DlgAccessibility( QWidget * parent )
page->hide();
m_color_pages[ m_selected ]->show();
#ifdef HAVE_SPEECH
// Populate tts engines
const QStringList engines = QTextToSpeech::availableEngines();
for (const QString &engine: engines) {
m_dlg->kcfg_ttsEngine->addItem (engine);
}
m_dlg->kcfg_ttsEngine->setProperty("kcfg_property", QByteArray("currentText"));
#else
m_dlg->speechBox->hide();
#endif
connect(m_dlg->kcfg_RenderMode, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &DlgAccessibility::slotColorMode);
}

Loading…
Cancel
Save