mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 23:57:34 +02:00
* Fixed sparkle updating and introduced TomahawkUtils::appFriendlyVersion().
This commit is contained in:
@@ -17,7 +17,9 @@
|
||||
*/
|
||||
|
||||
#include "tomahawkutils.h"
|
||||
|
||||
#include <tomahawksettings.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QColor>
|
||||
@@ -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()
|
||||
{
|
||||
|
@@ -59,6 +59,8 @@ namespace TomahawkUtils
|
||||
QNetworkProxy m_proxy;
|
||||
};
|
||||
|
||||
DLLEXPORT QString appFriendlyVersion();
|
||||
|
||||
DLLEXPORT QDir appConfigDir();
|
||||
DLLEXPORT QDir appDataDir();
|
||||
DLLEXPORT QDir appLogDir();
|
||||
|
@@ -20,8 +20,6 @@
|
||||
#include "ui_tomahawkwindow.h"
|
||||
#include "ui_searchbox.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QCloseEvent>
|
||||
#include <QShowEvent>
|
||||
@@ -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( "<h2><b>Tomahawk %1</h2>Copyright 2010, 2011<br/>Christian Muehlhaeuser <muesli@tomahawk-player.org><br/><br/>"
|
||||
tr( "<h2><b>Tomahawk %1<br/>(%2)</h2>Copyright 2010, 2011<br/>Christian Muehlhaeuser <muesli@tomahawk-player.org><br/><br/>"
|
||||
"Thanks to: Leo Franchi, Jeff Mitchell, Dominik Schmidt, Jason Herskowitz, Alejandro Wainzinger, Harald Sitter and Steve Robertson" )
|
||||
.arg( TomahawkUtils::appFriendlyVersion() )
|
||||
.arg( qApp->applicationVersion() ) );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user