desktop/kde-runtime/Remove-volume-control-from-KNotify.patch

229 lines
6.8 KiB
Diff

From ed2f6ae0250f98c4e4568bdee792fd885dccf32c Mon Sep 17 00:00:00 2001
From: Hrvoje Senjan <hrvoje.senjan@gmail.com>
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 @@
</widget>
</item>
<item>
- <layout class="QGridLayout">
- <property name="margin">
- <number>0</number>
- </property>
- <item row="1" column="4">
- <widget class="QLabel" name="textLabel3">
- <property name="text">
- <string>100%</string>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>261</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="textLabel2">
- <property name="text">
- <string>0%</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="textLabel4">
- <property name="text">
- <string>&amp;Volume:</string>
- </property>
- <property name="buddy">
- <cstring>volumeSlider</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="2" colspan="3">
- <widget class="QSlider" name="volumeSlider">
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="singleStep">
- <number>10</number>
- </property>
- <property name="value">
- <number>100</number>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item row="0" column="0" rowspan="2">
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>41</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
<widget class="QRadioButton" name="cbExternal">
<property name="text">
<string>&amp;Use an external player</string>
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