[patch] removal of deadcode

Erik Hovland erik at hovland.org
Tue Nov 28 17:44:34 UTC 2006

I have been using amarok happily for the last 4 months. Thank you for
such a wonderful audio player. After having been happy with xmms for a
number of years I just couldn't get over the lack of integration with my
favorite desktop environment. So I gave amarok a try. The first few
attempts did not fare so well. But once 1.4.2 came around the corner
amarok was stable enough on mandriva 2006.0 for me to use exclusively.

So it is time to give back. I have been doing a little audit of the code
and have found a few bugs. This is the first one I have found (with the
help of a static analysis tool). This patch removes some code that is
never executed because the conditional that wraps it is for a variable
that never changes value.

Let me know what you think. And once again, thanks.


Erik Hovland
mail: erik AT hovland DOT org
web: http://hovland.org/
PGP/GPG public key available on request
-------------- next part --------------
This patch collects all dead code that is found in the amarok tree.

From: Erik Hovland <erik at hovland.org>


 src/collectionbrowser.cpp |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/src/collectionbrowser.cpp b/src/collectionbrowser.cpp
index 6ab945f..4a4bc14 100644
--- a/src/collectionbrowser.cpp
+++ b/src/collectionbrowser.cpp
@@ -1735,7 +1735,6 @@ CollectionView::contentsDropEvent( QDrop
         KURL::List expandedList;
         int dropped = 0;
-        int invalid = 0;
         for( KURL::List::iterator it = list.begin();
                 it != list.end();
                 ++it )
@@ -1761,13 +1760,6 @@ CollectionView::contentsDropEvent( QDrop
         if( dropped > 0 )
             msg += i18n( "One file already in collection",
                     "%n files already in collection", dropped );
-        if( invalid > 0 )
-            if( msg.isEmpty() )
-                msg += i18n( "One dropped file is invalid",
-                        "%n dropped files are invalid", invalid );
-            else
-                msg += i18n( ", one dropped file is invalid",
-                        ", %n dropped files are invalid", invalid );
         if( !msg.isEmpty() )
             Amarok::StatusBar::instance()->shortMessage( msg );
         if( cleanList.count() > 0 )

More information about the Amarok mailing list