mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
knotify: use knotify for player ID
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
66ef179678
commit
d2b0cbeb96
2 changed files with 6 additions and 11 deletions
|
@ -18,11 +18,13 @@
|
|||
#include "knotifyconfigactionswidget.h"
|
||||
#include "knotifyconfigelement.h"
|
||||
|
||||
#include <QtDBus/QDBusInterface>
|
||||
|
||||
#include <kstandarddirs.h>
|
||||
#include <kiconloader.h>
|
||||
|
||||
KNotifyConfigActionsWidget::KNotifyConfigActionsWidget( QWidget * parent )
|
||||
: QWidget(parent), m_sound_player(Q_NULLPTR)
|
||||
: QWidget(parent)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
|
||||
|
@ -62,9 +64,6 @@ KNotifyConfigActionsWidget::KNotifyConfigActionsWidget( QWidget * parent )
|
|||
|
||||
KNotifyConfigActionsWidget::~KNotifyConfigActionsWidget()
|
||||
{
|
||||
if (m_sound_player) {
|
||||
m_sound_player->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
void KNotifyConfigActionsWidget::setConfigElement( KNotifyConfigElement * config )
|
||||
|
@ -140,11 +139,9 @@ void KNotifyConfigActionsWidget::slotPlay( )
|
|||
if ( search.isEmpty() )*/
|
||||
soundURL = KUrl::fromPath( KStandardDirs::locate( "sound", soundString ) );
|
||||
}
|
||||
// create the player if missing
|
||||
if (!m_sound_player) {
|
||||
m_sound_player = new QDBusInterface("org.kde.kded", "/modules/kaudioplayer", "org.kde.kaudioplayer");
|
||||
}
|
||||
m_sound_player->call("play", soundURL.prettyUrl());
|
||||
// same ID as the one used in kde-workspace/knotify/notifybysound.cpp
|
||||
QDBusInterface kaudioplayer("org.kde.kded", "/modules/kaudioplayer", "org.kde.kaudioplayer");
|
||||
kaudioplayer.call("play", soundURL.prettyUrl(), QString::fromLatin1("knotify"));
|
||||
}
|
||||
|
||||
void KNotifyConfigActionsWidget::slotKTTSComboChanged()
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#define KNOTIFYCONFIGACTIONSWIDGET_H
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtDBus/QDBusInterface>
|
||||
|
||||
#include "ui_knotifyconfigactionswidgetbase.h"
|
||||
|
||||
|
@ -48,7 +47,6 @@ class KNotifyConfigActionsWidget : public QWidget
|
|||
void slotKTTSComboChanged();
|
||||
private:
|
||||
Ui::KNotifyConfigActionsWidgetBase m_ui;
|
||||
QDBusInterface* m_sound_player;
|
||||
};
|
||||
|
||||
#endif // KNOTIFYCONFIGACTIONSWIDGET_H
|
||||
|
|
Loading…
Add table
Reference in a new issue