diff --git a/src/libtomahawk/utils/tomahawkutils.cpp b/src/libtomahawk/utils/tomahawkutils.cpp index 6cf01c787..4a371461c 100644 --- a/src/libtomahawk/utils/tomahawkutils.cpp +++ b/src/libtomahawk/utils/tomahawkutils.cpp @@ -17,7 +17,9 @@ */ #include "tomahawkutils.h" + #include +#include "config.h" #include #include @@ -55,6 +57,17 @@ appSupportFolderPath() #endif // Q_WS_MAC +QString +appFriendlyVersion() +{ + QStringList l = QString( TOMAHAWK_VERSION ).split( ".", QString::SkipEmptyParts ); + while ( l.count() > 3 ) + l.removeLast(); + + return l.join( "." ); +} + + QDir appConfigDir() { diff --git a/src/libtomahawk/utils/tomahawkutils.h b/src/libtomahawk/utils/tomahawkutils.h index 581252bf7..d30658878 100644 --- a/src/libtomahawk/utils/tomahawkutils.h +++ b/src/libtomahawk/utils/tomahawkutils.h @@ -59,6 +59,8 @@ namespace TomahawkUtils QNetworkProxy m_proxy; }; + DLLEXPORT QString appFriendlyVersion(); + DLLEXPORT QDir appConfigDir(); DLLEXPORT QDir appDataDir(); DLLEXPORT QDir appLogDir(); diff --git a/src/tomahawkwindow.cpp b/src/tomahawkwindow.cpp index 12727f107..c9dc0c447 100644 --- a/src/tomahawkwindow.cpp +++ b/src/tomahawkwindow.cpp @@ -20,8 +20,6 @@ #include "ui_tomahawkwindow.h" #include "ui_searchbox.h" -#include "config.h" - #include #include #include @@ -171,7 +169,7 @@ TomahawkWindow::TomahawkWindow( QWidget* parent ) #endif #if defined( Q_OS_DARWIN ) && defined( HAVE_SPARKLE ) - QAction* checkForUpdates = ui->menu_Help->addAction( tr( "Check For Updates...") ); + QAction* checkForUpdates = ui->menu_Help->addAction( tr( "Check For Updates..." ) ); checkForUpdates->setMenuRole( QAction::ApplicationSpecificRole ); connect( checkForUpdates, SIGNAL( triggered( bool ) ), SLOT( checkForUpdates() ) ); #elif defined( WIN32 ) @@ -185,10 +183,10 @@ TomahawkWindow::TomahawkWindow( QWidget* parent ) qtsparkle::Updater* updater = new qtsparkle::Updater( updaterUrl, this ); Q_ASSERT( TomahawkUtils::nam() != 0 ); updater->SetNetworkAccessManager( TomahawkUtils::nam() ); - updater->SetVersion( TOMAHAWK_VERSION ); + updater->SetVersion( TomahawkUtils::appFriendlyVersion() ); ui->menu_Help->addSeparator(); - QAction* checkForUpdates = ui->menu_Help->addAction( tr( "Check For Updates...") ); + QAction* checkForUpdates = ui->menu_Help->addAction( tr( "Check For Updates..." ) ); connect( checkForUpdates, SIGNAL( triggered() ), updater, SLOT( CheckNow() ) ); #endif @@ -639,8 +637,9 @@ void TomahawkWindow::showAboutTomahawk() { QMessageBox::about( this, tr( "About Tomahawk" ), - tr( "

Tomahawk %1

Copyright 2010, 2011
Christian Muehlhaeuser <muesli@tomahawk-player.org>

" + tr( "

Tomahawk %1
(%2)

Copyright 2010, 2011
Christian Muehlhaeuser <muesli@tomahawk-player.org>

" "Thanks to: Leo Franchi, Jeff Mitchell, Dominik Schmidt, Jason Herskowitz, Alejandro Wainzinger, Harald Sitter and Steve Robertson" ) + .arg( TomahawkUtils::appFriendlyVersion() ) .arg( qApp->applicationVersion() ) ); }