1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-07 06:36:55 +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:
Leo Franchi
2011-03-21 21:13:27 -04:00
parent 194116c912
commit 2ffe51163c
4 changed files with 23 additions and 11 deletions

View File

@@ -95,6 +95,9 @@ public:
virtual void activate();
virtual bool loadUrl( const QString& url );
// because QApplication::arguments() is expensive
bool scrubFriendlyName() const { return m_scrubFriendlyName; }
private slots:
void setupSIP();
void messageReceived( const QString& );
@@ -117,6 +120,7 @@ private:
Servent* m_servent;
XMPPBot* m_xmppBot;
Tomahawk::ShortcutHandler* m_shortcutHandler;
bool m_scrubFriendlyName;
#ifdef LIBLASTFM_FOUND
Scrobbler* m_scrobbler;

View File

@@ -26,7 +26,6 @@
#include "database/databasecommand_sourceoffline.h"
#include "database/databasecommand_logplayback.h"
#include "database/database.h"
#include <QApplication>
using namespace Tomahawk;
@@ -95,21 +94,17 @@ Source::remove()
QString
Source::friendlyName() const
{
QString friendly;
if ( m_friendlyname.isEmpty() )
friendly = m_username;
return m_username;
//TODO: this is a terrible assumption, help me clean this up, mighty muesli!
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" ) )
friendly = m_friendlyname.left( m_friendlyname.indexOf( "/tomahawk" ) );
return m_friendlyname.left( m_friendlyname.indexOf( "/tomahawk" ) );
if( qApp->arguments().contains( "--demo" ) && friendly.contains( '@' ) )
friendly = friendly.left( friendly.indexOf( '@' ) );
return friendly;
return m_friendlyname;
}

View File

@@ -43,7 +43,18 @@ SourceTreeItem::SourceTreeItem( const source_ptr& source, QObject* parent )
: QObject( parent )
, 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->setEditable( false );
item->setData( SourcesModel::CollectionSource, Type );

View File

@@ -145,6 +145,7 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
, m_sipHandler( 0 )
, m_servent( 0 )
, m_shortcutHandler( 0 )
, m_scrubFriendlyName( false )
, m_mainwindow( 0 )
, m_infoSystem( 0 )
{
@@ -190,6 +191,7 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
qDebug() << "Init Echonest Factory.";
GeneratorFactory::registerFactory( "echonest", new EchonestFactory );
m_scrubFriendlyName = arguments().contains( "--demo" );
// Register shortcut handler for this platform
#ifdef Q_WS_MAC
m_shortcutHandler = new MacShortcutHandler( this );