mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-21 16:29:43 +01:00
Fix compile on clang
This commit is contained in:
parent
3a8eb34e35
commit
b1210ea43f
@ -38,11 +38,11 @@ TomahawkSettings* TomahawkSettings::s_instance = 0;
|
||||
|
||||
|
||||
inline QDataStream&
|
||||
operator<<(QDataStream& out, const PlaylistUpdaterInterface::SerializedUpdaters& updaters)
|
||||
operator<<(QDataStream& out, const SerializedUpdaters& updaters)
|
||||
{
|
||||
out << TOMAHAWK_SETTINGS_VERSION;
|
||||
out << (quint32)updaters.count();
|
||||
PlaylistUpdaterInterface::SerializedUpdaters::const_iterator iter = updaters.begin();
|
||||
SerializedUpdaters::const_iterator iter = updaters.begin();
|
||||
int count = 0;
|
||||
for ( ; iter != updaters.end(); ++iter )
|
||||
{
|
||||
@ -55,7 +55,7 @@ operator<<(QDataStream& out, const PlaylistUpdaterInterface::SerializedUpdaters&
|
||||
|
||||
|
||||
inline QDataStream&
|
||||
operator>>(QDataStream& in, PlaylistUpdaterInterface::SerializedUpdaters& updaters)
|
||||
operator>>(QDataStream& in, SerializedUpdaters& updaters)
|
||||
{
|
||||
quint32 count = 0, version = 0;
|
||||
in >> version;
|
||||
@ -68,7 +68,7 @@ operator>>(QDataStream& in, PlaylistUpdaterInterface::SerializedUpdaters& update
|
||||
in >> key;
|
||||
in >> type;
|
||||
in >> customData;
|
||||
updaters.insert( key, PlaylistUpdaterInterface::SerializedUpdater( type, customData ) );
|
||||
updaters.insert( key, SerializedUpdater( type, customData ) );
|
||||
}
|
||||
|
||||
return in;
|
||||
@ -490,7 +490,7 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
||||
beginGroup( "playlistupdaters" );
|
||||
const QStringList playlists = childGroups();
|
||||
|
||||
PlaylistUpdaterInterface::SerializedUpdaters updaters;
|
||||
SerializedUpdaters updaters;
|
||||
foreach ( const QString& playlist, playlists )
|
||||
{
|
||||
beginGroup( playlist );
|
||||
@ -505,7 +505,7 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
||||
extraData[ key ] = value( key );
|
||||
}
|
||||
|
||||
updaters.insert( playlist, PlaylistUpdaterInterface::SerializedUpdater( type, extraData ) );
|
||||
updaters.insert( playlist, SerializedUpdater( type, extraData ) );
|
||||
|
||||
endGroup();
|
||||
}
|
||||
@ -1248,24 +1248,24 @@ TomahawkSettings::setImportXspfPath( const QString& path )
|
||||
}
|
||||
|
||||
|
||||
PlaylistUpdaterInterface::SerializedUpdaters
|
||||
SerializedUpdaters
|
||||
TomahawkSettings::playlistUpdaters() const
|
||||
{
|
||||
return value( "playlists/updaters" ).value< PlaylistUpdaterInterface::SerializedUpdaters >();
|
||||
return value( "playlists/updaters" ).value< SerializedUpdaters >();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkSettings::setPlaylistUpdaters( const PlaylistUpdaterInterface::SerializedUpdaters& updaters )
|
||||
TomahawkSettings::setPlaylistUpdaters( const SerializedUpdaters& updaters )
|
||||
{
|
||||
setValue( "playlists/updaters", QVariant::fromValue< PlaylistUpdaterInterface::SerializedUpdaters >( updaters ) );
|
||||
setValue( "playlists/updaters", QVariant::fromValue< SerializedUpdaters >( updaters ) );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkSettings::registerCustomSettingsHandlers()
|
||||
{
|
||||
qRegisterMetaType< Tomahawk::PlaylistUpdaterInterface::SerializedUpdater >( "Tomahawk::PlaylistUpdaterInterface::SerializedUpdater" );
|
||||
qRegisterMetaType< Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters >( "Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters" );
|
||||
qRegisterMetaTypeStreamOperators< Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters >( "Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters" );
|
||||
qRegisterMetaType< Tomahawk::SerializedUpdater >( "Tomahawk::SerializedUpdater" );
|
||||
qRegisterMetaType< Tomahawk::SerializedUpdaters >( "Tomahawk::SerializedUpdaters" );
|
||||
qRegisterMetaTypeStreamOperators< Tomahawk::SerializedUpdaters >( "Tomahawk::SerializedUpdaters" );
|
||||
}
|
||||
|
@ -203,8 +203,8 @@ public:
|
||||
void setImportXspfPath( const QString& path );
|
||||
QString importXspfPath() const;
|
||||
|
||||
Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters playlistUpdaters() const;
|
||||
void setPlaylistUpdaters( const Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters& updaters );
|
||||
Tomahawk::SerializedUpdaters playlistUpdaters() const;
|
||||
void setPlaylistUpdaters( const Tomahawk::SerializedUpdaters& updaters );
|
||||
|
||||
static void registerCustomSettingsHandlers();
|
||||
|
||||
|
@ -19,17 +19,19 @@
|
||||
#include "PlaylistUpdaterInterface.h"
|
||||
#include "TomahawkSettings.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
QMap< QString, PlaylistUpdaterFactory* > PlaylistUpdaterInterface::s_factories = QMap< QString, PlaylistUpdaterFactory* >();
|
||||
|
||||
namespace Tomahawk {
|
||||
|
||||
bool
|
||||
operator==( const Tomahawk::PlaylistUpdaterInterface::SerializedUpdater& one, const Tomahawk::PlaylistUpdaterInterface::SerializedUpdater& two )
|
||||
operator==( const SerializedUpdater& one, const SerializedUpdater& two )
|
||||
{
|
||||
return one.type == two.type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
QMap< QString, PlaylistUpdaterFactory* > PlaylistUpdaterInterface::s_factories = QMap< QString, PlaylistUpdaterFactory* >();
|
||||
|
||||
void
|
||||
PlaylistUpdaterInterface::registerUpdaterFactory( PlaylistUpdaterFactory* f )
|
||||
|
@ -39,22 +39,22 @@ namespace Tomahawk
|
||||
|
||||
class PlaylistUpdaterFactory;
|
||||
|
||||
// used when loading/saving from settings
|
||||
struct SerializedUpdater {
|
||||
QString type;
|
||||
QVariantHash customData;
|
||||
|
||||
SerializedUpdater( const QString& t, const QVariantHash cd = QVariantHash() ) : type( t ), customData( cd ) {}
|
||||
SerializedUpdater() {}
|
||||
};
|
||||
|
||||
typedef QMultiHash< QString, SerializedUpdater > SerializedUpdaters;
|
||||
typedef QList< SerializedUpdater > SerializedUpdaterList;
|
||||
|
||||
class DLLEXPORT PlaylistUpdaterInterface : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
// used when loading/saving from settings
|
||||
struct SerializedUpdater {
|
||||
QString type;
|
||||
QVariantHash customData;
|
||||
|
||||
SerializedUpdater( const QString& t, const QVariantHash cd = QVariantHash() ) : type( t ), customData( cd ) {}
|
||||
SerializedUpdater() {}
|
||||
};
|
||||
|
||||
typedef QMultiHash< QString, SerializedUpdater > SerializedUpdaters;
|
||||
typedef QList< SerializedUpdater > SerializedUpdaterList;
|
||||
|
||||
explicit PlaylistUpdaterInterface( const playlist_ptr& pl );
|
||||
|
||||
virtual ~PlaylistUpdaterInterface();
|
||||
@ -114,7 +114,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE( Tomahawk::PlaylistUpdaterInterface::SerializedUpdater );
|
||||
Q_DECLARE_METATYPE( Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters );
|
||||
Q_DECLARE_METATYPE( Tomahawk::SerializedUpdater );
|
||||
Q_DECLARE_METATYPE( Tomahawk::SerializedUpdaters );
|
||||
|
||||
#endif // PLAYLISTUPDATERINTERFACE_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user