mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 08:04:25 +02:00
* Style fixes.
This commit is contained in:
@@ -724,10 +724,9 @@ TomahawkWindow::winEvent( MSG* msg, long* result )
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // Q_OS_WIN
|
#endif // Q_OS_WIN
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TomahawkWindow::audioStateChanged( AudioState newState, AudioState oldState )
|
TomahawkWindow::audioStateChanged( AudioState newState, AudioState oldState )
|
||||||
{
|
{
|
||||||
|
@@ -1,22 +1,22 @@
|
|||||||
/*
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
|
*
|
||||||
|
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
|
||||||
This program is free software; you can redistribute it and/or modify
|
* Copyright 2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
it under the terms of the GNU General Public License as published by
|
*
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
(at your option) any later version.
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
This program is distributed in the hope that it will be useful,
|
* (at your option) any later version.
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* Tomahawk is distributed in the hope that it will be useful,
|
||||||
GNU General Public License for more details.
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
You should have received a copy of the GNU General Public License along
|
* GNU General Public License for more details.
|
||||||
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/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "RecentPlaylistsModel.h"
|
#include "RecentPlaylistsModel.h"
|
||||||
|
|
||||||
#include "TomahawkSettings.h"
|
#include "TomahawkSettings.h"
|
||||||
|
@@ -1,22 +1,22 @@
|
|||||||
/*
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
* Copyright (C) 2011 Leo Franchi <lfranchi@kde.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
|
* 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.
|
* (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
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along
|
* You should have received a copy of the GNU General Public License
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef RECENTLPLAYLISTSMODEL_H
|
#ifndef RECENTLPLAYLISTSMODEL_H
|
||||||
#define RECENTLPLAYLISTSMODEL_H
|
#define RECENTLPLAYLISTSMODEL_H
|
||||||
|
|
||||||
|
@@ -1,23 +1,23 @@
|
|||||||
/*
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
|
*
|
||||||
Copyright (C) 2011 Jeff Mitchell <jeff@tomahawk-player.org>
|
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
|
||||||
|
* Copyright 2011, Jeff Mitchell <jeff@tomahawk-player.org>
|
||||||
This program is free software; you can redistribute it and/or modify
|
* Copyright 2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
it under the terms of the GNU General Public License as published by
|
*
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
(at your option) any later version.
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
This program is distributed in the hope that it will be useful,
|
* (at your option) any later version.
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* Tomahawk is distributed in the hope that it will be useful,
|
||||||
GNU General Public License for more details.
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
You should have received a copy of the GNU General Public License along
|
* GNU General Public License for more details.
|
||||||
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/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "RecentlyPlayedPlaylistsModel.h"
|
#include "RecentlyPlayedPlaylistsModel.h"
|
||||||
|
|
||||||
#include "TomahawkSettings.h"
|
#include "TomahawkSettings.h"
|
||||||
@@ -68,7 +68,8 @@ RecentlyPlayedPlaylistsModel::loadFromSettings()
|
|||||||
if ( pl.isNull() )
|
if ( pl.isNull() )
|
||||||
pl = Tomahawk::DynamicPlaylist::load( playlist_guids[i] );
|
pl = Tomahawk::DynamicPlaylist::load( playlist_guids[i] );
|
||||||
|
|
||||||
if ( !pl.isNull() ) {
|
if ( !pl.isNull() )
|
||||||
|
{
|
||||||
m_recplaylists << pl;
|
m_recplaylists << pl;
|
||||||
|
|
||||||
if ( !m_cached.contains( playlist_guids[i] ) )
|
if ( !m_cached.contains( playlist_guids[i] ) )
|
||||||
@@ -149,6 +150,7 @@ RecentlyPlayedPlaylistsModel::data( const QModelIndex& index, int role ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RecentlyPlayedPlaylistsModel::playlistRevisionLoaded()
|
RecentlyPlayedPlaylistsModel::playlistRevisionLoaded()
|
||||||
{
|
{
|
||||||
@@ -169,11 +171,16 @@ RecentlyPlayedPlaylistsModel::playlistRevisionLoaded()
|
|||||||
void
|
void
|
||||||
RecentlyPlayedPlaylistsModel::onSourceAdded( const Tomahawk::source_ptr& source )
|
RecentlyPlayedPlaylistsModel::onSourceAdded( const Tomahawk::source_ptr& source )
|
||||||
{
|
{
|
||||||
connect( source.data(), SIGNAL( online() ), this, SLOT( sourceOnline() ) );
|
connect( source.data(), SIGNAL( online() ),
|
||||||
connect( source->dbCollection().data(), SIGNAL( playlistsAdded( QList<Tomahawk::playlist_ptr> ) ), SLOT( loadFromSettings() ) );
|
SLOT( sourceOnline() ) );
|
||||||
connect( source->dbCollection().data(), SIGNAL( playlistsDeleted( QList<Tomahawk::playlist_ptr> ) ), SLOT( onPlaylistsRemoved( QList<Tomahawk::playlist_ptr> ) ) );
|
|
||||||
|
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
|
void
|
||||||
RecentlyPlayedPlaylistsModel::sourceOnline()
|
RecentlyPlayedPlaylistsModel::sourceOnline()
|
||||||
{
|
{
|
||||||
@@ -194,8 +201,10 @@ RecentlyPlayedPlaylistsModel::sourceOnline()
|
|||||||
void
|
void
|
||||||
RecentlyPlayedPlaylistsModel::onPlaylistsRemoved( QList< playlist_ptr > playlists )
|
RecentlyPlayedPlaylistsModel::onPlaylistsRemoved( QList< playlist_ptr > playlists )
|
||||||
{
|
{
|
||||||
foreach( const playlist_ptr& pl, playlists ) {
|
foreach ( const playlist_ptr& pl, playlists )
|
||||||
if( m_recplaylists.contains( pl ) ) {
|
{
|
||||||
|
if ( m_recplaylists.contains( pl ) )
|
||||||
|
{
|
||||||
m_artists.remove( pl );
|
m_artists.remove( pl );
|
||||||
m_cached.remove( pl->guid() );
|
m_cached.remove( pl->guid() );
|
||||||
|
|
||||||
@@ -250,15 +259,18 @@ RecentlyPlayedPlaylistsModel::playlistChanged( Tomahawk::playlistinterface_ptr p
|
|||||||
if ( pli.isNull() )
|
if ( pli.isNull() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( Playlist *pl = dynamic_cast< Playlist* >( pli.data() ) ) {
|
if ( Playlist *pl = dynamic_cast< Playlist* >( pli.data() ) )
|
||||||
|
{
|
||||||
// look for it, qsharedpointer fail
|
// look for it, qsharedpointer fail
|
||||||
playlist_ptr ptr;
|
playlist_ptr ptr;
|
||||||
foreach( const playlist_ptr& test, m_recplaylists ) {
|
foreach ( const playlist_ptr& test, m_recplaylists )
|
||||||
|
{
|
||||||
if ( test.data() == pl )
|
if ( test.data() == pl )
|
||||||
ptr = test;
|
ptr = test;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !ptr.isNull() && m_artists.contains( ptr ) ) {
|
if ( !ptr.isNull() && m_artists.contains( ptr ) )
|
||||||
|
{
|
||||||
m_artists[ ptr ] = QString();
|
m_artists[ ptr ] = QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,23 +1,23 @@
|
|||||||
/*
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
|
*
|
||||||
Copyright (C) 2011 Jeff Mitchell <jeff@tomahawk-player.org>
|
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
|
||||||
|
* Copyright 2011, Jeff Mitchell <jeff@tomahawk-player.org>
|
||||||
This program is free software; you can redistribute it and/or modify
|
* Copyright 2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
it under the terms of the GNU General Public License as published by
|
*
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
(at your option) any later version.
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
This program is distributed in the hope that it will be useful,
|
* (at your option) any later version.
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* Tomahawk is distributed in the hope that it will be useful,
|
||||||
GNU General Public License for more details.
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
You should have received a copy of the GNU General Public License along
|
* GNU General Public License for more details.
|
||||||
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 RECENTLYPLAYEDPLAYLISTSMODEL_H
|
#ifndef RECENTLYPLAYEDPLAYLISTSMODEL_H
|
||||||
#define RECENTLYPLAYEDPLAYLISTSMODEL_H
|
#define RECENTLYPLAYEDPLAYLISTSMODEL_H
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user