Fixed okular's speech to look for renamed kde speech application Jovie

Fixed okular's speech class to connect to org.kde.KSpeech endpoint


svn path=/trunk/KDE/kdegraphics/okular/; revision=1138355
remotes/origin/KDE/4.5
Jeremy Paul Whiting 16 years ago
parent 6f0fec062e
commit 7698d0db23
  1. 2
      part.cpp
  2. 24
      ui/tts.cpp

@ -594,7 +594,7 @@ m_cliPresentation(false), m_embedMode(detectEmbedMode(parentWidget, parent, args
slotNewConfig(); slotNewConfig();
// [SPEECH] check for KTTSD presence and usability // [SPEECH] check for KTTSD presence and usability
KService::List offers = KServiceTypeTrader::self()->query("DBUS/Text-to-Speech", "Name == 'KTTSD'"); KService::List offers = KServiceTypeTrader::self()->query("DBUS/Text-to-Speech", "Name == 'Jovie'");
Okular::Settings::setUseKTTSD( !offers.isEmpty() ); Okular::Settings::setUseKTTSD( !offers.isEmpty() );
Okular::Settings::self()->writeConfig(); Okular::Settings::self()->writeConfig();

@ -39,27 +39,27 @@ void OkularTTS::Private::setupIface()
if ( kspeech ) if ( kspeech )
return; return;
// If KTTSD not running, start it. // If Jovie not running, start it.
QDBusReply<bool> reply = QDBusConnection::sessionBus().interface()->isServiceRegistered( "org.kde.kttsd" ); QDBusReply<bool> reply = QDBusConnection::sessionBus().interface()->isServiceRegistered( "org.kde.KSpeech" );
bool kttsdactive = false; bool jovieactive = false;
if ( reply.isValid() ) if ( reply.isValid() )
kttsdactive = reply.value(); jovieactive = reply.value();
if ( !kttsdactive ) if ( !jovieactive )
{ {
QString error; QString error;
if ( KToolInvocation::startServiceByDesktopName( "kttsd", QStringList(), &error ) ) if ( KToolInvocation::startServiceByDesktopName( "jovie", QStringList(), &error ) )
{ {
emit q->errorMessage( i18n( "Starting KTTSD Failed: %1", error ) ); emit q->errorMessage( i18n( "Starting Jovie Failed: %1", error ) );
} }
else else
{ {
kttsdactive = true; jovieactive = true;
} }
} }
if ( kttsdactive ) if ( jovieactive )
{ {
// creating the connection to the kspeech interface // creating the connection to the kspeech interface
kspeech = new org::kde::KSpeech( "org.kde.kttsd", "/KSpeech", QDBusConnection::sessionBus() ); kspeech = new org::kde::KSpeech( "org.kde.KSpeech", "/KSpeech", QDBusConnection::sessionBus() );
kspeech->setParent( q ); kspeech->setParent( q );
kspeech->setApplicationName( "Okular" ); kspeech->setApplicationName( "Okular" );
connect( kspeech, SIGNAL( jobStateChanged( const QString &, int, int ) ), connect( kspeech, SIGNAL( jobStateChanged( const QString &, int, int ) ),
@ -117,7 +117,7 @@ void OkularTTS::stopAllSpeechs()
void OkularTTS::slotServiceUnregistered( const QString &service ) void OkularTTS::slotServiceUnregistered( const QString &service )
{ {
if ( service == QLatin1String( "org.kde.kttsd" ) ) if ( service == QLatin1String( "org.kde.KSpeech" ) )
{ {
d->teardownIface(); d->teardownIface();
} }
@ -125,7 +125,7 @@ void OkularTTS::slotServiceUnregistered( const QString &service )
void OkularTTS::slotServiceOwnerChanged( const QString &service, const QString &, const QString &newOwner ) void OkularTTS::slotServiceOwnerChanged( const QString &service, const QString &, const QString &newOwner )
{ {
if ( service == QLatin1String( "org.kde.kttsd" ) && newOwner.isEmpty() ) if ( service == QLatin1String( "org.kde.KSpeech" ) && newOwner.isEmpty() )
{ {
d->teardownIface(); d->teardownIface();
} }

Loading…
Cancel
Save