[Amarok] Add check for correct collection scanner version.
Kevin Funk
krf at gmx.de
Sun Jan 17 14:06:39 CET 2010
Sunday 17 January 2010, Mark Kretschmann <kretschmann at kde.org>:
> commit 0df5e45e87876943986e1eb95a83ab5ed3b352e0
> Author: Mark Kretschmann <kretschmann at kde.org>
> AuthorDate: Sun Jan 17 13:43:59 2010 +0100
> Commit: Mark Kretschmann <kretschmann at kde.org>
> CommitDate: Sun Jan 17 13:43:59 2010 +0100
>
> Add check for correct collection scanner version.
>
> If the version is wrong, Amarok now reports this with an error dialog.
> The check _almost_ works, but gets wrong results, although the version
> is correct (wrong endline truncating or so). So I've disabled it for
> now. Will fix up later (or someone else fix it, if you can spot the bug).
>
> diff --git a/src/App.cpp b/src/App.cpp
> index 586d80f..03923cb 100644
> --- a/src/App.cpp
> +++ b/src/App.cpp
> @@ -814,6 +814,34 @@ App::continueInit()
> config.writeEntry( "First Run", false );
> }
> }
> +
> +#if 0
> + if( getScannerVersion() != APP_VERSION )
> + {
> + KMessageBox::error( 0, i18n( "<p>The version of the
> 'amarokcollectionscanner' tool\n" +
> "does not match your Amarok version.</p>" +
> "<p>Please note that Collection Scanning may not work correctly.</p>"
> ) ); + }
> +#endif
> +}
> +
> +QString App::getScannerVersion()
> +{
> + DEBUG_BLOCK
> +
> + QProcess scanner;
> +
> + QStringList args;
> + args << "--version";
> +
> + scanner.execute( QString( "amarokcollectionscanner" ), args );
FYI: Be sure to check for the right path where the binary resides (best to
implement this in a global method, tbh).
See ScanManager.cpp:67-68 (already had problems with this when installing
Amarok in user space, etc).
> (snip)
--
Kevin Funk
More information about the Amarok-devel
mailing list