mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 14:46:33 +02:00
Revert "add --demo parameter that strips out hostnames"
This reverts commit 194116c912
.
Hide hostname another way to try to fix J's bizarre issue
This commit is contained in:
@@ -95,6 +95,9 @@ public:
|
|||||||
virtual void activate();
|
virtual void activate();
|
||||||
virtual bool loadUrl( const QString& url );
|
virtual bool loadUrl( const QString& url );
|
||||||
|
|
||||||
|
// because QApplication::arguments() is expensive
|
||||||
|
bool scrubFriendlyName() const { return m_scrubFriendlyName; }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void setupSIP();
|
void setupSIP();
|
||||||
void messageReceived( const QString& );
|
void messageReceived( const QString& );
|
||||||
@@ -117,7 +120,8 @@ private:
|
|||||||
Servent* m_servent;
|
Servent* m_servent;
|
||||||
XMPPBot* m_xmppBot;
|
XMPPBot* m_xmppBot;
|
||||||
Tomahawk::ShortcutHandler* m_shortcutHandler;
|
Tomahawk::ShortcutHandler* m_shortcutHandler;
|
||||||
|
bool m_scrubFriendlyName;
|
||||||
|
|
||||||
#ifdef LIBLASTFM_FOUND
|
#ifdef LIBLASTFM_FOUND
|
||||||
Scrobbler* m_scrobbler;
|
Scrobbler* m_scrobbler;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
#include "database/databasecommand_sourceoffline.h"
|
#include "database/databasecommand_sourceoffline.h"
|
||||||
#include "database/databasecommand_logplayback.h"
|
#include "database/databasecommand_logplayback.h"
|
||||||
#include "database/database.h"
|
#include "database/database.h"
|
||||||
#include <QApplication>
|
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
@@ -95,21 +94,17 @@ Source::remove()
|
|||||||
QString
|
QString
|
||||||
Source::friendlyName() const
|
Source::friendlyName() const
|
||||||
{
|
{
|
||||||
QString friendly;
|
|
||||||
if ( m_friendlyname.isEmpty() )
|
if ( m_friendlyname.isEmpty() )
|
||||||
friendly = m_username;
|
return m_username;
|
||||||
|
|
||||||
//TODO: this is a terrible assumption, help me clean this up, mighty muesli!
|
//TODO: this is a terrible assumption, help me clean this up, mighty muesli!
|
||||||
if ( m_friendlyname.contains( "@conference.") )
|
if ( m_friendlyname.contains( "@conference.") )
|
||||||
friendly = QString(m_friendlyname).remove( 0, m_friendlyname.lastIndexOf( "/" )+1 ).append(" via MUC");
|
return QString(m_friendlyname).remove( 0, m_friendlyname.lastIndexOf( "/" )+1 ).append(" via MUC");
|
||||||
|
|
||||||
if ( m_friendlyname.contains( "/tomahawk" ) )
|
if ( m_friendlyname.contains( "/tomahawk" ) )
|
||||||
friendly = m_friendlyname.left( m_friendlyname.indexOf( "/tomahawk" ) );
|
return m_friendlyname.left( m_friendlyname.indexOf( "/tomahawk" ) );
|
||||||
|
|
||||||
if( qApp->arguments().contains( "--demo" ) && friendly.contains( '@' ) )
|
return m_friendlyname;
|
||||||
friendly = friendly.left( friendly.indexOf( '@' ) );
|
|
||||||
|
|
||||||
return friendly;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -43,7 +43,18 @@ SourceTreeItem::SourceTreeItem( const source_ptr& source, QObject* parent )
|
|||||||
: QObject( parent )
|
: QObject( parent )
|
||||||
, m_source( source )
|
, m_source( source )
|
||||||
{
|
{
|
||||||
QStandardItem* item = new QStandardItem( source.isNull() ? "Super Collection" : source->friendlyName() );
|
QString name;
|
||||||
|
if( source.isNull() )
|
||||||
|
name = tr( "Super Collection" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( TomahawkApp::instance()->scrubFriendlyName() && source->friendlyName().contains( '@' ) )
|
||||||
|
name = source->friendlyName().left( source->friendlyName().indexOf( '@' ) );
|
||||||
|
else
|
||||||
|
name = source->friendlyName();
|
||||||
|
}
|
||||||
|
|
||||||
|
QStandardItem* item = new QStandardItem( name );
|
||||||
item->setIcon( QIcon( RESPATH "images/user-avatar.png" ) );
|
item->setIcon( QIcon( RESPATH "images/user-avatar.png" ) );
|
||||||
item->setEditable( false );
|
item->setEditable( false );
|
||||||
item->setData( SourcesModel::CollectionSource, Type );
|
item->setData( SourcesModel::CollectionSource, Type );
|
||||||
|
@@ -145,6 +145,7 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
|||||||
, m_sipHandler( 0 )
|
, m_sipHandler( 0 )
|
||||||
, m_servent( 0 )
|
, m_servent( 0 )
|
||||||
, m_shortcutHandler( 0 )
|
, m_shortcutHandler( 0 )
|
||||||
|
, m_scrubFriendlyName( false )
|
||||||
, m_mainwindow( 0 )
|
, m_mainwindow( 0 )
|
||||||
, m_infoSystem( 0 )
|
, m_infoSystem( 0 )
|
||||||
{
|
{
|
||||||
@@ -190,6 +191,7 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
|||||||
qDebug() << "Init Echonest Factory.";
|
qDebug() << "Init Echonest Factory.";
|
||||||
GeneratorFactory::registerFactory( "echonest", new EchonestFactory );
|
GeneratorFactory::registerFactory( "echonest", new EchonestFactory );
|
||||||
|
|
||||||
|
m_scrubFriendlyName = arguments().contains( "--demo" );
|
||||||
// Register shortcut handler for this platform
|
// Register shortcut handler for this platform
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
m_shortcutHandler = new MacShortcutHandler( this );
|
m_shortcutHandler = new MacShortcutHandler( this );
|
||||||
|
Reference in New Issue
Block a user