[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdemultimedia/kmix
From:       Christian Esken <esken () kde ! org>
Date:       2005-04-20 22:10:46
Message-ID: 20050420221046.559BE650 () office ! kde ! org
[Download RAW message or body]

CVS commit by esken: 

Cleanup: Replace outdated mixerNum() by simpler id()


  M +13 -10    kmixapplet.cpp   1.65
  M +1 -1      kmixapplet.h   1.28


--- kdemultimedia/kmix/kmixapplet.cpp  #1.64:1.65
@@ -179,9 +179,15 @@ KMixApplet::KMixApplet( const QString& c
     /********** find out to use which mixer \
****************************************/  _mixer = 0;
-    if ( _mixerNum>=0 ) {
       for (_mixer= Mixer::mixers().first(); _mixer!=0; \
_mixer=Mixer::mixers().next())  {
-            // Name and number must match with the configuration
-            if ( _mixer->mixerName() == _mixerName && _mixer->mixerNum()==_mixerNum \
) break; +      if ( _mixer->id() == _mixerId ) break;
+    }
+    if ( _mixer == 0 ) {
+      /* Until KMix V3.4-0 the mixerNumber (int) was stored. This was too \
complicated to handle, so we use an +       * unique ID (_mixer->mixerId(). But in \
case when the user changes soundcards (or when upgrading from +       * KMix 3.4-0 to \
a 3.4-1 or newer), we scan also for the soundcard name */ +      for (_mixer= \
Mixer::mixers().first(); _mixer!=0; _mixer=Mixer::mixers().next()) +      {
+        if ( _mixer->mixerName() == _mixerName ) break;
         }
     }
@@ -192,7 +198,4 @@ KMixApplet::KMixApplet( const QString& c
     }
         
-    //  Find out wether the applet should be reversed
-    //reversedDir = cfg->readBoolEntry("ReversedDirection", false);
-
 
 
@@ -235,5 +238,5 @@ void KMixApplet::saveConfig()
         //kdDebug(67100) << "KMixApplet::saveConfig() save cfg=" << cfg << endl;
         cfg->setGroup( 0 );
-        cfg->writeEntry( "Mixer", _mixer->mixerNum() );
+        cfg->writeEntry( "Mixer", _mixer->id() );
         cfg->writeEntry( "MixerName", _mixer->mixerName() );
 
@@ -262,5 +265,5 @@ void KMixApplet::loadConfig()
     cfg->setGroup(0);
         
-    _mixerNum = cfg->readNumEntry( "Mixer", -1 );
+    _mixerId = cfg->readEntry( "Mixer", "undef" );
     _mixerName = cfg->readEntry( "MixerName", QString::null );
 

--- kdemultimedia/kmix/kmixapplet.h  #1.27:1.28
@@ -122,5 +122,5 @@ private:
    QLayout* _layout;
 
-   int     _mixerNum;
+   QString _mixerId;
    QString _mixerName;
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic