1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

Add PeerInfo to Source and SourceItem tooltips.

This commit is contained in:
Teo Mrnjavac 2013-01-13 17:46:14 +01:00 committed by Dominik Schmidt
parent 259f496985
commit 352dd7588d
3 changed files with 26 additions and 3 deletions

View File

@ -85,6 +85,14 @@ Source::setControlConnection( ControlConnection* cc )
m_cc = cc;
}
const QSet<peerinfo_ptr>
Source::peerInfos() const
{
if( controlConnection() )
return controlConnection()->peerInfos();
return QSet< Tomahawk::peerinfo_ptr >();
}
collection_ptr
Source::collection() const

View File

@ -77,6 +77,8 @@ public:
ControlConnection* controlConnection() const { return m_cc; }
void setControlConnection( ControlConnection* cc );
const QSet< Tomahawk::peerinfo_ptr > peerInfos() const;
void scanningProgress( unsigned int files );
void scanningFinished( bool updateGUI );

View File

@ -1,6 +1,7 @@
/*
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2013, Teo Mrnjavac <teo@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -33,6 +34,7 @@
#include "playlist/RecentlyAddedModel.h"
#include "playlist/RecentlyPlayedModel.h"
#include "playlist/PlaylistLargeItemDelegate.h"
#include "sip/PeerInfo.h"
#include "utils/ImageRegistry.h"
#include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h"
@ -143,10 +145,21 @@ SourceItem::text() const
QString
SourceItem::tooltip() const
{
if ( !m_source.isNull() && !m_source->currentTrack().isNull() )
return m_source->textStatus();
if ( m_source.isNull() || m_source->peerInfos().isEmpty() )
return QString();
return QString();
QString t;
// This is kind of debug output for now.
foreach( Tomahawk::peerinfo_ptr p, m_source->peerInfos() )
{
t.append( p->id() + "<br>" );
}
if ( !m_source->currentTrack().isNull() )
t.append( m_source->textStatus() );
return t;
}