[Amarok] beautify

Seb Ruiz ruiz at kde.org
Sat Aug 8 03:20:06 CEST 2009


2009/8/8 Sven Krohlas <sven at getamarok.com>:
> commit ae94a5a7683e60a90d7c0a05f93cd201d52041bf
> Author:     Sven Krohlas <sven at getamarok.com>
> AuthorDate: Fri Aug 7 16:01:30 2009 +0200
> Commit:     Sven Krohlas <sven at getamarok.com>
> CommitDate: Fri Aug 7 16:09:11 2009 +0200
>
>    beautify

There is no need to move these variables into the class space, as they
are only used locally in one method.

>
> diff --git a/tests/TestDirectoryLoader.cpp b/tests/TestDirectoryLoader.cpp
> index a8969e3..e8a800c 100644
> --- a/tests/TestDirectoryLoader.cpp
> +++ b/tests/TestDirectoryLoader.cpp
> @@ -17,7 +17,6 @@
>  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
>  ***************************************************************************/
>
> -#include "DirectoryLoader.h"
>  #include "TestDirectoryLoader.h"
>
>  #include "playlist/PlaylistController.h"
> @@ -38,22 +37,28 @@ void TestDirectoryLoader::initTestCase()
>  {
>     The::playlistController()->clear(); // we need a clear playlist for those tests
>
> -    DirectoryLoader *loader1 = new DirectoryLoader;
> -    DirectoryLoader *loader2 = new DirectoryLoader;
> +    m_loader1 = new DirectoryLoader;
> +    m_loader2 = new DirectoryLoader;
>     QList<QUrl> testList;
>     QUrl testUrl;
>
>     testUrl = QUrl::fromLocalFile( KStandardDirs::installPath( "data" ) + "amarok/testdata/audio/" );
>     testList.append( testUrl );
>
> -    loader1->insertAtRow( 1 ); // TODO: negative values always seem to append at the beginning. is that correct?
> -    loader1->init( testList );
> +    m_loader1->insertAtRow( 1 ); // TODO: negative values always seem to append at the beginning. is that correct?
> +    m_loader1->init( testList );
>     // wait until finished... HOW? might only work with --nofork?
> -    loader2->insertAtRow( 4 );
> -    loader2->init( testList );
> +    m_loader2->insertAtRow( 4 );
> +    m_loader2->init( testList );
>     // here we should wait again
>  }
>
> +void TestDirectoryLoader::cleanupTestCase()
> +{
> +    // DirecoryLoaders delete themselves when the job is done
> +}
> +
> +
>  void TestDirectoryLoader::testInitAndInsertAtRow()
>  {
>     /* more uglyness: we test both methods at once... I don't see another way */
> diff --git a/tests/TestDirectoryLoader.h b/tests/TestDirectoryLoader.h
> index 495389e..52af408 100644
> --- a/tests/TestDirectoryLoader.h
> +++ b/tests/TestDirectoryLoader.h
> @@ -20,6 +20,8 @@
>  #ifndef TESTDIRECTORYLOADER_H
>  #define TESTDIRECTORYLOADER_H
>
> +#include "DirectoryLoader.h"
> +
>  #include <QtTest>
>
>  class TestDirectoryLoader : public QObject
> @@ -31,7 +33,11 @@ public:
>
>  private slots:
>     void initTestCase();
> +    void cleanupTestCase();
>     void testInitAndInsertAtRow();
> +
> +private:
> +    DirectoryLoader *m_loader1, *m_loader2;
>  };
>
>  #endif // TESTDIRECTORYLOADER_H
>
>
>



-- 
Seb Ruiz

http://www.sebruiz.net/
http://amarok.kde.org/


More information about the Amarok-devel mailing list