1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-09 07:36:48 +02:00

* Style fixes.

This commit is contained in:
Christian Muehlhaeuser
2013-04-26 13:15:38 +02:00
parent 7bcf3e2e15
commit 69e19afbef
5 changed files with 108 additions and 97 deletions

View File

@@ -724,10 +724,9 @@ TomahawkWindow::winEvent( MSG* msg, long* result )
return false;
}
#endif // Q_OS_WIN
void
TomahawkWindow::audioStateChanged( AudioState newState, AudioState oldState )
{

View File

@@ -1,22 +1,22 @@
/*
Copyright (C) 2011 Leo Franchi <lfranchi@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
the Free Software Foundation; either version 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk 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.
*
* Tomahawk 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 Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "RecentPlaylistsModel.h"
#include "TomahawkSettings.h"

View File

@@ -1,22 +1,22 @@
/*
* Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* This program is free software; you can redistribute it and/or modify
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk 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 2 of the License, or
* 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,
* Tomahawk 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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef RECENTLPLAYLISTSMODEL_H
#define RECENTLPLAYLISTSMODEL_H

View File

@@ -1,23 +1,23 @@
/*
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
Copyright (C) 2011 Jeff Mitchell <jeff@tomahawk-player.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
the Free Software Foundation; either version 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2011, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk 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.
*
* Tomahawk 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 Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "RecentlyPlayedPlaylistsModel.h"
#include "TomahawkSettings.h"
@@ -68,7 +68,8 @@ RecentlyPlayedPlaylistsModel::loadFromSettings()
if ( pl.isNull() )
pl = Tomahawk::DynamicPlaylist::load( playlist_guids[i] );
if ( !pl.isNull() ) {
if ( !pl.isNull() )
{
m_recplaylists << pl;
if ( !m_cached.contains( playlist_guids[i] ) )
@@ -149,6 +150,7 @@ RecentlyPlayedPlaylistsModel::data( const QModelIndex& index, int role ) const
}
}
void
RecentlyPlayedPlaylistsModel::playlistRevisionLoaded()
{
@@ -169,11 +171,16 @@ RecentlyPlayedPlaylistsModel::playlistRevisionLoaded()
void
RecentlyPlayedPlaylistsModel::onSourceAdded( const Tomahawk::source_ptr& source )
{
connect( source.data(), SIGNAL( online() ), this, SLOT( sourceOnline() ) );
connect( source->dbCollection().data(), SIGNAL( playlistsAdded( QList<Tomahawk::playlist_ptr> ) ), SLOT( loadFromSettings() ) );
connect( source->dbCollection().data(), SIGNAL( playlistsDeleted( QList<Tomahawk::playlist_ptr> ) ), SLOT( onPlaylistsRemoved( QList<Tomahawk::playlist_ptr> ) ) );
connect( source.data(), SIGNAL( online() ),
SLOT( sourceOnline() ) );
connect( source->dbCollection().data(), SIGNAL( playlistsAdded( QList<Tomahawk::playlist_ptr> ) ),
SLOT( loadFromSettings() ) );
connect( source->dbCollection().data(), SIGNAL( playlistsDeleted( QList<Tomahawk::playlist_ptr> ) ),
SLOT( onPlaylistsRemoved( QList<Tomahawk::playlist_ptr> ) ) );
}
void
RecentlyPlayedPlaylistsModel::sourceOnline()
{
@@ -194,8 +201,10 @@ RecentlyPlayedPlaylistsModel::sourceOnline()
void
RecentlyPlayedPlaylistsModel::onPlaylistsRemoved( QList< playlist_ptr > playlists )
{
foreach( const playlist_ptr& pl, playlists ) {
if( m_recplaylists.contains( pl ) ) {
foreach ( const playlist_ptr& pl, playlists )
{
if ( m_recplaylists.contains( pl ) )
{
m_artists.remove( pl );
m_cached.remove( pl->guid() );
@@ -250,15 +259,18 @@ RecentlyPlayedPlaylistsModel::playlistChanged( Tomahawk::playlistinterface_ptr p
if ( pli.isNull() )
return;
if ( Playlist *pl = dynamic_cast< Playlist* >( pli.data() ) ) {
if ( Playlist *pl = dynamic_cast< Playlist* >( pli.data() ) )
{
// look for it, qsharedpointer fail
playlist_ptr ptr;
foreach( const playlist_ptr& test, m_recplaylists ) {
foreach ( const playlist_ptr& test, m_recplaylists )
{
if ( test.data() == pl )
ptr = test;
}
if( !ptr.isNull() && m_artists.contains( ptr ) ) {
if ( !ptr.isNull() && m_artists.contains( ptr ) )
{
m_artists[ ptr ] = QString();
}

View File

@@ -1,23 +1,23 @@
/*
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
Copyright (C) 2011 Jeff Mitchell <jeff@tomahawk-player.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
the Free Software Foundation; either version 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2011, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk 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.
*
* Tomahawk 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 Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef RECENTLYPLAYEDPLAYLISTSMODEL_H
#define RECENTLYPLAYEDPLAYLISTSMODEL_H