mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 16:44:05 +02:00
* Fixed sparkle updating and introduced TomahawkUtils::appFriendlyVersion().
This commit is contained in:
@@ -17,7 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "tomahawkutils.h"
|
#include "tomahawkutils.h"
|
||||||
|
|
||||||
#include <tomahawksettings.h>
|
#include <tomahawksettings.h>
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
@@ -55,6 +57,17 @@ appSupportFolderPath()
|
|||||||
#endif // Q_WS_MAC
|
#endif // Q_WS_MAC
|
||||||
|
|
||||||
|
|
||||||
|
QString
|
||||||
|
appFriendlyVersion()
|
||||||
|
{
|
||||||
|
QStringList l = QString( TOMAHAWK_VERSION ).split( ".", QString::SkipEmptyParts );
|
||||||
|
while ( l.count() > 3 )
|
||||||
|
l.removeLast();
|
||||||
|
|
||||||
|
return l.join( "." );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QDir
|
QDir
|
||||||
appConfigDir()
|
appConfigDir()
|
||||||
{
|
{
|
||||||
|
@@ -59,6 +59,8 @@ namespace TomahawkUtils
|
|||||||
QNetworkProxy m_proxy;
|
QNetworkProxy m_proxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DLLEXPORT QString appFriendlyVersion();
|
||||||
|
|
||||||
DLLEXPORT QDir appConfigDir();
|
DLLEXPORT QDir appConfigDir();
|
||||||
DLLEXPORT QDir appDataDir();
|
DLLEXPORT QDir appDataDir();
|
||||||
DLLEXPORT QDir appLogDir();
|
DLLEXPORT QDir appLogDir();
|
||||||
|
@@ -20,8 +20,6 @@
|
|||||||
#include "ui_tomahawkwindow.h"
|
#include "ui_tomahawkwindow.h"
|
||||||
#include "ui_searchbox.h"
|
#include "ui_searchbox.h"
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QShowEvent>
|
#include <QShowEvent>
|
||||||
@@ -171,7 +169,7 @@ TomahawkWindow::TomahawkWindow( QWidget* parent )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined( Q_OS_DARWIN ) && defined( HAVE_SPARKLE )
|
#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 );
|
checkForUpdates->setMenuRole( QAction::ApplicationSpecificRole );
|
||||||
connect( checkForUpdates, SIGNAL( triggered( bool ) ), SLOT( checkForUpdates() ) );
|
connect( checkForUpdates, SIGNAL( triggered( bool ) ), SLOT( checkForUpdates() ) );
|
||||||
#elif defined( WIN32 )
|
#elif defined( WIN32 )
|
||||||
@@ -185,10 +183,10 @@ TomahawkWindow::TomahawkWindow( QWidget* parent )
|
|||||||
qtsparkle::Updater* updater = new qtsparkle::Updater( updaterUrl, this );
|
qtsparkle::Updater* updater = new qtsparkle::Updater( updaterUrl, this );
|
||||||
Q_ASSERT( TomahawkUtils::nam() != 0 );
|
Q_ASSERT( TomahawkUtils::nam() != 0 );
|
||||||
updater->SetNetworkAccessManager( TomahawkUtils::nam() );
|
updater->SetNetworkAccessManager( TomahawkUtils::nam() );
|
||||||
updater->SetVersion( TOMAHAWK_VERSION );
|
updater->SetVersion( TomahawkUtils::appFriendlyVersion() );
|
||||||
|
|
||||||
ui->menu_Help->addSeparator();
|
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() ) );
|
connect( checkForUpdates, SIGNAL( triggered() ), updater, SLOT( CheckNow() ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -639,8 +637,9 @@ void
|
|||||||
TomahawkWindow::showAboutTomahawk()
|
TomahawkWindow::showAboutTomahawk()
|
||||||
{
|
{
|
||||||
QMessageBox::about( this, tr( "About Tomahawk" ),
|
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" )
|
"Thanks to: Leo Franchi, Jeff Mitchell, Dominik Schmidt, Jason Herskowitz, Alejandro Wainzinger, Harald Sitter and Steve Robertson" )
|
||||||
|
.arg( TomahawkUtils::appFriendlyVersion() )
|
||||||
.arg( qApp->applicationVersion() ) );
|
.arg( qApp->applicationVersion() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user