Permalink
Browse files

Move implementations to source files in app

  • Loading branch information...
1 parent ecf0e67 commit 443d7519ac10329fb0c5c1a93d455d648199284b @dschmidt dschmidt committed Nov 3, 2012
View
@@ -0,0 +1,25 @@
+/*
+ Copyright (C) 2011 Leo Franchi <leo.franchi@kdab.com>
+
+ 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "ConfigDelegateBase.h"
+
+
+QList< int >
+ConfigDelegateBase::extraCheckRoles() const
+{
+ return QList<int>();
+}
View
@@ -40,7 +40,7 @@ class Q_DECL_EXPORT ConfigDelegateBase : public QStyledItemDelegate
// if you want to use a config wrench, you need to have this say where to paint it
virtual QRect configRectForIndex( const QStyleOptionViewItem& option, const QModelIndex& idx ) const = 0;
- virtual QList<int> extraCheckRoles() const { return QList<int>(); }
+ virtual QList<int> extraCheckRoles() const;
signals:
void configPressed( const QModelIndex& idx );
View
@@ -266,3 +266,17 @@ SocialWidget::eventFilter( QObject* object, QEvent* event )
return QObject::eventFilter( object, event );
}
+
+
+Tomahawk::query_ptr
+SocialWidget::query() const
+{
+ return m_query;
+}
+
+
+QPoint
+SocialWidget::position() const
+{
+ return m_position;
+}
View
@@ -39,10 +39,10 @@ Q_OBJECT
SocialWidget( QWidget* parent );
~SocialWidget();
- Tomahawk::query_ptr query() const { return m_query; }
+ Tomahawk::query_ptr query() const;
void setQuery( const Tomahawk::query_ptr& query );
- QPoint position() const { return m_position; }
+ QPoint position() const;
void setPosition( QPoint position );
bool shown() const;
View
@@ -782,3 +782,17 @@ TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
else
activate();
}
+
+
+TomahawkWindow*
+TomahawkApp::mainWindow() const
+{
+ return m_mainwindow;
+}
+
+
+bool
+TomahawkApp::isTomahawkLoaded() const
+{
+ return m_loaded;
+}
View
@@ -46,7 +46,6 @@ class ScanManager;
class Servent;
class SipHandler;
class TomahawkSettings;
-class XMPPBot;
class AudioControls;
namespace Tomahawk
@@ -87,17 +86,15 @@ Q_OBJECT
void init();
static TomahawkApp* instance();
- XMPPBot* xmppBot() { return m_xmppBot.data(); }
-
#ifndef ENABLE_HEADLESS
AudioControls* audioControls();
- TomahawkWindow* mainWindow() const { return m_mainwindow; }
+ TomahawkWindow* mainWindow() const;
#endif
// PlatformInterface
virtual bool loadUrl( const QString& url );
- bool isTomahawkLoaded() const { return m_loaded; }
+ bool isTomahawkLoaded() const;
// reimplemented from QApplication/QCoreApplication
virtual bool notify( QObject* receiver, QEvent* e );
@@ -133,7 +130,6 @@ private slots:
QWeakPointer<AudioEngine> m_audioEngine;
QWeakPointer<Servent> m_servent;
QWeakPointer<Tomahawk::InfoSystem::InfoSystem> m_infoSystem;
- QWeakPointer<XMPPBot> m_xmppBot;
QWeakPointer<Tomahawk::ShortcutHandler> m_shortcutHandler;
QWeakPointer< Tomahawk::Accounts::AccountManager > m_accountManager;
bool m_scrubFriendlyName;
View
@@ -1318,3 +1318,17 @@ TomahawkWindow::toggleMenuBar() //SLOT
saveSettings();
#endif
}
+
+
+AudioControls*
+TomahawkWindow::audioControls()
+{
+ return m_audioControls;
+}
+
+
+SourceTreeView*
+TomahawkWindow::sourceTreeView() const
+{
+ return m_sourcetree;
+}
View
@@ -76,8 +76,8 @@ Q_OBJECT
TomahawkWindow( QWidget* parent = 0 );
~TomahawkWindow();
- AudioControls* audioControls() { return m_audioControls; }
- SourceTreeView* sourceTreeView() const { return m_sourcetree; }
+ AudioControls* audioControls();
+ SourceTreeView* sourceTreeView() const;
void setWindowTitle( const QString& title );
@@ -128,3 +128,17 @@ void AnimationHelper::collapseAnimationFinished()
{
emit finished( m_index );
}
+
+
+QSize
+AnimationHelper::originalSize() const
+{
+ return m_startSize;
+}
+
+
+QSize
+AnimationHelper::size() const
+{
+ return m_size;
+}
@@ -34,8 +34,8 @@ class AnimationHelper: public QObject
public:
AnimationHelper( const QModelIndex& index, QObject *parent = 0 );
- QSize originalSize() const { return m_startSize; }
- QSize size() const { return m_size; }
+ QSize originalSize() const;
+ QSize size() const;
bool initialized() const;
void initialize( const QSize& startValue, const QSize& endValue, int duration );
@@ -674,3 +674,10 @@ SourcesModel::itemToggleExpandRequest( SourceTreeItem *item )
{
emit toggleExpandRequest( QPersistentModelIndex( indexFromItem( item ) ) );
}
+
+
+QList< source_ptr >
+SourcesModel::sourcesWithViewPage() const
+{
+ return m_sourcesWithViewPage;
+}
@@ -108,7 +108,7 @@ class SourcesModel : public QAbstractItemModel
QModelIndex indexFromItem( SourceTreeItem* item ) const;
- QList< Tomahawk::source_ptr > sourcesWithViewPage() const { return m_sourcesWithViewPage; }
+ QList< Tomahawk::source_ptr > sourcesWithViewPage() const;
public slots:
void loadSources();
@@ -378,3 +378,31 @@ CategoryItem::activate()
{
emit toggleExpandRequest( this );
}
+
+
+QString
+CategoryItem::text() const
+{
+ switch( m_category )
+ {
+ case SourcesModel::PlaylistsCategory:
+ return tr( "Playlists" );
+ case SourcesModel::StationsCategory:
+ return tr( "Stations" );
+ }
+ return QString();
+}
+
+
+Qt::ItemFlags
+CategoryItem::flags() const
+{
+ return Qt::ItemIsEnabled;
+}
+
+
+SourcesModel::CategoryType
+CategoryItem::categoryType()
+{
+ return m_category;
+}
@@ -56,25 +56,16 @@ class CategoryItem : public SourceTreeItem
public:
CategoryItem( SourcesModel* model, SourceTreeItem* parent, SourcesModel::CategoryType category, bool showAddItem );
- virtual QString text() const {
- switch( m_category )
- {
- case SourcesModel::PlaylistsCategory:
- return tr( "Playlists" );
- case SourcesModel::StationsCategory:
- return tr( "Stations" );
- }
- return QString();
- }
+ virtual QString text() const;
virtual void activate();
virtual int peerSortValue() const;
- virtual Qt::ItemFlags flags() const { return Qt::ItemIsEnabled; }
+ virtual Qt::ItemFlags flags() const;
// inserts an item at the end, but before the category add item
void insertItem( SourceTreeItem* item );
void insertItems( QList< SourceTreeItem* > item );
- SourcesModel::CategoryType categoryType() { return m_category; }
+ SourcesModel::CategoryType categoryType();
private:
SourcesModel::CategoryType m_category;
@@ -99,3 +99,17 @@ GenericPageItem::isBeingPlayed() const
return false;
}
+
+
+int
+GenericPageItem::peerSortValue() const
+{
+ return m_sortValue;
+}
+
+
+void
+GenericPageItem::setSortValue(int value)
+{
+ m_sortValue = value;
+}
@@ -37,11 +37,11 @@ class GenericPageItem : public SourceTreeItem
virtual void activate();
virtual bool willAcceptDrag( const QMimeData* data ) const;
virtual QIcon icon() const;
- virtual int peerSortValue() const { return m_sortValue; } // How to sort relative to peers in the tree.
+ virtual int peerSortValue() const; // How to sort relative to peers in the tree.
virtual bool isBeingPlayed() const;
void setText( const QString& text );
- void setSortValue( int value ) { m_sortValue = value; }
+ void setSortValue( int value );
signals:
void activated();
@@ -71,3 +71,33 @@ GroupItem::text() const
{
return m_text;
}
+
+
+bool
+GroupItem::willAcceptDrag(const QMimeData* data) const
+{
+ Q_UNUSED( data );
+ return false;
+}
+
+
+QIcon
+GroupItem::icon() const
+{
+ return QIcon();
+}
+
+
+bool
+GroupItem::isBeingPlayed() const
+{
+ return false;
+}
+
+
+void
+GroupItem::setDefaultExpanded(bool b)
+{
+ m_defaultExpanded = b;
+}
+
@@ -34,12 +34,12 @@ class GroupItem : public SourceTreeItem
virtual ~GroupItem();
virtual QString text() const;
- virtual bool willAcceptDrag( const QMimeData* data ) const { Q_UNUSED( data ); return false; }
- virtual QIcon icon() const { return QIcon(); }
- virtual bool isBeingPlayed() const { return false; }
+ virtual bool willAcceptDrag( const QMimeData* data ) const;
+ virtual QIcon icon() const;
+ virtual bool isBeingPlayed() const;
void checkExpandedState();
- void setDefaultExpanded( bool b ) { m_defaultExpanded = b; }
+ void setDefaultExpanded( bool b );
public slots:
virtual void activate();
@@ -57,6 +57,13 @@ LovedTracksItem::text() const
}
+QIcon
+LovedTracksItem::icon() const
+{
+ return QIcon( RESPATH "images/loved_playlist.png" );
+}
+
+
void
LovedTracksItem::activate()
{
@@ -134,10 +141,23 @@ LovedTracksItem::dropMimeData( const QMimeData* data, Qt::DropAction action )
}
+int
+LovedTracksItem::peerSortValue() const
+{
+ return m_sortValue;
+}
+
+
+void
+LovedTracksItem::setSortValue(int value)
+{
+ m_sortValue = value;
+}
+
+
void
LovedTracksItem::loveDroppedTracks( QList< Tomahawk::query_ptr > qrys )
{
foreach( Tomahawk::query_ptr qry, qrys )
qry->setLoved( true );
}
-
@@ -34,15 +34,15 @@ class LovedTracksItem : public SourceTreeItem
virtual ~LovedTracksItem();
virtual QString text() const;
- virtual QIcon icon() const { return QIcon( RESPATH "images/loved_playlist.png" ); }
- virtual int peerSortValue() const { return m_sortValue; }
+ virtual QIcon icon() const;
+ virtual int peerSortValue() const;
virtual void activate();
virtual bool willAcceptDrag( const QMimeData* data ) const;
virtual DropTypes supportedDropTypes( const QMimeData* data ) const;
virtual bool dropMimeData( const QMimeData* data, Qt::DropAction action );
- void setSortValue( int value ) { m_sortValue = value; }
+ void setSortValue( int value );
private slots:
void loveDroppedTracks( QList< Tomahawk::query_ptr > qrys );
Oops, something went wrong.

0 comments on commit 443d751

Please sign in to comment.