From ed2f6ae0250f98c4e4568bdee792fd885dccf32c Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Tue, 24 Sep 2013 22:02:41 +0200 Subject: [PATCH 1/1] Remove volume control from KNotify Basically is KNotify's volume controlling ineffective, however with phonon 4.7 it triggeres a bad side-effect, thus we remove the option completely Reference bug: kde#324975 --- kcontrol/knotify/knotify.cpp | 3 -- kcontrol/knotify/playersettings.ui | 79 -------------------------------------- knotify/notifybysound.cpp | 16 ++++---- knotify/notifybysound.h | 2 +- 4 files changed, 9 insertions(+), 91 deletions(-) diff --git a/kcontrol/knotify/knotify.cpp b/kcontrol/knotify/knotify.cpp index 0c1b34e..cb7d724 100644 --- a/kcontrol/knotify/knotify.cpp +++ b/kcontrol/knotify/knotify.cpp @@ -225,7 +225,6 @@ PlayerSettingsDialog::PlayerSettingsDialog( QWidget *parent ) connect( m_ui->cbArts, SIGNAL(clicked(bool)), this, SLOT(slotChanged())); connect( m_ui->cbExternal, SIGNAL(clicked(bool)), this, SLOT(slotChanged())); connect( m_ui->cbNone, SIGNAL(clicked(bool)), this, SLOT(slotChanged())); - connect( m_ui->volumeSlider, SIGNAL( valueChanged ( int ) ), this, SLOT( slotChanged() ) ); connect( m_ui->reqExternal, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotChanged() ) ); m_ui->reqExternal->setMode(KFile::File|KFile::ExistingOnly|KFile::LocalOnly); } @@ -237,7 +236,6 @@ void PlayerSettingsDialog::load() bool useExternal = config.readEntry( "Use external player", false ); m_ui->cbExternal->setChecked( useExternal ); m_ui->reqExternal->setUrl( config.readPathEntry( "External player", QString() ) ); - m_ui->volumeSlider->setValue( config.readEntry( "Volume", 100 ) ); if ( !m_ui->cbExternal->isChecked() ) { @@ -258,7 +256,6 @@ void PlayerSettingsDialog::save() config.writePathEntry( "External player", m_ui->reqExternal->url().path() ); config.writeEntry( "Use external player", m_ui->cbExternal->isChecked() ); - config.writeEntry( "Volume", m_ui->volumeSlider->value() ); config.writeEntry( "No sound", m_ui->cbNone->isChecked() ); config.sync(); diff --git a/kcontrol/knotify/playersettings.ui b/kcontrol/knotify/playersettings.ui index 54bb627..58c9826 100644 --- a/kcontrol/knotify/playersettings.ui +++ b/kcontrol/knotify/playersettings.ui @@ -22,85 +22,6 @@ - - - 0 - - - - - 100% - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 261 - 16 - - - - - - - - 0% - - - - - - - &Volume: - - - volumeSlider - - - - - - - 100 - - - 10 - - - 100 - - - Qt::Horizontal - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 41 - - - - - - - &Use an external player diff --git a/knotify/notifybysound.cpp b/knotify/notifybysound.cpp index 0f5cc50..7136bc2 100644 --- a/knotify/notifybysound.cpp +++ b/knotify/notifybysound.cpp @@ -62,7 +62,7 @@ struct Player inline void play(const QString &file) { media->setCurrentSource(file); media->enqueue(Phonon::MediaSource()); media->play(); } inline void stop() { media->stop(); } - inline void setVolume(float volume) { output->setVolume(volume); } + //inline void setVolume(float volume) { output->setVolume(volume); } ~Player() { @@ -83,7 +83,7 @@ class PlayerPool void returnPlayer(Player *); void clear(); - void setVolume(float volume); + //void setVolume(float volume); private: Player *m_idlePlayer; @@ -100,7 +100,7 @@ Player *PlayerPool::getPlayer() p = m_idlePlayer; m_idlePlayer = 0; } - p->setVolume(m_volume); + //p->setVolume(m_volume); m_playersInUse << p; return p; } @@ -120,7 +120,7 @@ void PlayerPool::clear() delete m_idlePlayer; m_idlePlayer = 0; } - +/* void PlayerPool::setVolume(float v) { m_volume = v; @@ -128,7 +128,7 @@ void PlayerPool::setVolume(float v) p->setVolume(v); } } - +*/ class NotifyBySound::Private { public: @@ -188,7 +188,7 @@ void NotifyBySound::loadConfig() d->playerMode = Private::NoSound; } // load default volume - setVolume( cg.readEntry( "Volume", 100 ) ); + //setVolume( cg.readEntry( "Volume", 100 ) ); } @@ -258,7 +258,7 @@ void NotifyBySound::notify( int eventId, KNotifyConfig * config ) } } - +/* void NotifyBySound::setVolume( int volume ) { if ( volume<0 ) volume=0; @@ -266,7 +266,7 @@ void NotifyBySound::setVolume( int volume ) d->volume = volume; d->playerPool.setVolume(d->volume / 100.0); } - +*/ void NotifyBySound::timerEvent(QTimerEvent *e) { diff --git a/knotify/notifybysound.h b/knotify/notifybysound.h index 44f6463..6f591ec 100644 --- a/knotify/notifybysound.h +++ b/knotify/notifybysound.h @@ -42,7 +42,7 @@ class NotifyBySound : public KNotifyPlugin void loadConfig(); public: - void setVolume( int v ); + //void setVolume( int v ); protected: void timerEvent(QTimerEvent *); -- 1.8.4