mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 09:04:33 +02:00
Add PeerInfo to Source and SourceItem tooltips.
This commit is contained in:
committed by
Dominik Schmidt
parent
259f496985
commit
352dd7588d
@@ -85,6 +85,14 @@ Source::setControlConnection( ControlConnection* cc )
|
|||||||
m_cc = cc;
|
m_cc = cc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QSet<peerinfo_ptr>
|
||||||
|
Source::peerInfos() const
|
||||||
|
{
|
||||||
|
if( controlConnection() )
|
||||||
|
return controlConnection()->peerInfos();
|
||||||
|
return QSet< Tomahawk::peerinfo_ptr >();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
collection_ptr
|
collection_ptr
|
||||||
Source::collection() const
|
Source::collection() const
|
||||||
|
@@ -77,6 +77,8 @@ public:
|
|||||||
ControlConnection* controlConnection() const { return m_cc; }
|
ControlConnection* controlConnection() const { return m_cc; }
|
||||||
void setControlConnection( ControlConnection* cc );
|
void setControlConnection( ControlConnection* cc );
|
||||||
|
|
||||||
|
const QSet< Tomahawk::peerinfo_ptr > peerInfos() const;
|
||||||
|
|
||||||
void scanningProgress( unsigned int files );
|
void scanningProgress( unsigned int files );
|
||||||
void scanningFinished( bool updateGUI );
|
void scanningFinished( bool updateGUI );
|
||||||
|
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
|
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
|
||||||
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -33,6 +34,7 @@
|
|||||||
#include "playlist/RecentlyAddedModel.h"
|
#include "playlist/RecentlyAddedModel.h"
|
||||||
#include "playlist/RecentlyPlayedModel.h"
|
#include "playlist/RecentlyPlayedModel.h"
|
||||||
#include "playlist/PlaylistLargeItemDelegate.h"
|
#include "playlist/PlaylistLargeItemDelegate.h"
|
||||||
|
#include "sip/PeerInfo.h"
|
||||||
#include "utils/ImageRegistry.h"
|
#include "utils/ImageRegistry.h"
|
||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
@@ -143,10 +145,21 @@ SourceItem::text() const
|
|||||||
QString
|
QString
|
||||||
SourceItem::tooltip() const
|
SourceItem::tooltip() const
|
||||||
{
|
{
|
||||||
if ( !m_source.isNull() && !m_source->currentTrack().isNull() )
|
if ( m_source.isNull() || m_source->peerInfos().isEmpty() )
|
||||||
return m_source->textStatus();
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user