mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 23:57:34 +02:00
Fix compile on clang
This commit is contained in:
@@ -38,11 +38,11 @@ TomahawkSettings* TomahawkSettings::s_instance = 0;
|
|||||||
|
|
||||||
|
|
||||||
inline QDataStream&
|
inline QDataStream&
|
||||||
operator<<(QDataStream& out, const PlaylistUpdaterInterface::SerializedUpdaters& updaters)
|
operator<<(QDataStream& out, const SerializedUpdaters& updaters)
|
||||||
{
|
{
|
||||||
out << TOMAHAWK_SETTINGS_VERSION;
|
out << TOMAHAWK_SETTINGS_VERSION;
|
||||||
out << (quint32)updaters.count();
|
out << (quint32)updaters.count();
|
||||||
PlaylistUpdaterInterface::SerializedUpdaters::const_iterator iter = updaters.begin();
|
SerializedUpdaters::const_iterator iter = updaters.begin();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for ( ; iter != updaters.end(); ++iter )
|
for ( ; iter != updaters.end(); ++iter )
|
||||||
{
|
{
|
||||||
@@ -55,7 +55,7 @@ operator<<(QDataStream& out, const PlaylistUpdaterInterface::SerializedUpdaters&
|
|||||||
|
|
||||||
|
|
||||||
inline QDataStream&
|
inline QDataStream&
|
||||||
operator>>(QDataStream& in, PlaylistUpdaterInterface::SerializedUpdaters& updaters)
|
operator>>(QDataStream& in, SerializedUpdaters& updaters)
|
||||||
{
|
{
|
||||||
quint32 count = 0, version = 0;
|
quint32 count = 0, version = 0;
|
||||||
in >> version;
|
in >> version;
|
||||||
@@ -68,7 +68,7 @@ operator>>(QDataStream& in, PlaylistUpdaterInterface::SerializedUpdaters& update
|
|||||||
in >> key;
|
in >> key;
|
||||||
in >> type;
|
in >> type;
|
||||||
in >> customData;
|
in >> customData;
|
||||||
updaters.insert( key, PlaylistUpdaterInterface::SerializedUpdater( type, customData ) );
|
updaters.insert( key, SerializedUpdater( type, customData ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
@@ -490,7 +490,7 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
|||||||
beginGroup( "playlistupdaters" );
|
beginGroup( "playlistupdaters" );
|
||||||
const QStringList playlists = childGroups();
|
const QStringList playlists = childGroups();
|
||||||
|
|
||||||
PlaylistUpdaterInterface::SerializedUpdaters updaters;
|
SerializedUpdaters updaters;
|
||||||
foreach ( const QString& playlist, playlists )
|
foreach ( const QString& playlist, playlists )
|
||||||
{
|
{
|
||||||
beginGroup( playlist );
|
beginGroup( playlist );
|
||||||
@@ -505,7 +505,7 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
|||||||
extraData[ key ] = value( key );
|
extraData[ key ] = value( key );
|
||||||
}
|
}
|
||||||
|
|
||||||
updaters.insert( playlist, PlaylistUpdaterInterface::SerializedUpdater( type, extraData ) );
|
updaters.insert( playlist, SerializedUpdater( type, extraData ) );
|
||||||
|
|
||||||
endGroup();
|
endGroup();
|
||||||
}
|
}
|
||||||
@@ -1248,24 +1248,24 @@ TomahawkSettings::setImportXspfPath( const QString& path )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PlaylistUpdaterInterface::SerializedUpdaters
|
SerializedUpdaters
|
||||||
TomahawkSettings::playlistUpdaters() const
|
TomahawkSettings::playlistUpdaters() const
|
||||||
{
|
{
|
||||||
return value( "playlists/updaters" ).value< PlaylistUpdaterInterface::SerializedUpdaters >();
|
return value( "playlists/updaters" ).value< SerializedUpdaters >();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
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
|
void
|
||||||
TomahawkSettings::registerCustomSettingsHandlers()
|
TomahawkSettings::registerCustomSettingsHandlers()
|
||||||
{
|
{
|
||||||
qRegisterMetaType< Tomahawk::PlaylistUpdaterInterface::SerializedUpdater >( "Tomahawk::PlaylistUpdaterInterface::SerializedUpdater" );
|
qRegisterMetaType< Tomahawk::SerializedUpdater >( "Tomahawk::SerializedUpdater" );
|
||||||
qRegisterMetaType< Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters >( "Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters" );
|
qRegisterMetaType< Tomahawk::SerializedUpdaters >( "Tomahawk::SerializedUpdaters" );
|
||||||
qRegisterMetaTypeStreamOperators< Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters >( "Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters" );
|
qRegisterMetaTypeStreamOperators< Tomahawk::SerializedUpdaters >( "Tomahawk::SerializedUpdaters" );
|
||||||
}
|
}
|
||||||
|
@@ -203,8 +203,8 @@ public:
|
|||||||
void setImportXspfPath( const QString& path );
|
void setImportXspfPath( const QString& path );
|
||||||
QString importXspfPath() const;
|
QString importXspfPath() const;
|
||||||
|
|
||||||
Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters playlistUpdaters() const;
|
Tomahawk::SerializedUpdaters playlistUpdaters() const;
|
||||||
void setPlaylistUpdaters( const Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters& updaters );
|
void setPlaylistUpdaters( const Tomahawk::SerializedUpdaters& updaters );
|
||||||
|
|
||||||
static void registerCustomSettingsHandlers();
|
static void registerCustomSettingsHandlers();
|
||||||
|
|
||||||
|
@@ -19,17 +19,19 @@
|
|||||||
#include "PlaylistUpdaterInterface.h"
|
#include "PlaylistUpdaterInterface.h"
|
||||||
#include "TomahawkSettings.h"
|
#include "TomahawkSettings.h"
|
||||||
|
|
||||||
using namespace Tomahawk;
|
namespace Tomahawk {
|
||||||
|
|
||||||
QMap< QString, PlaylistUpdaterFactory* > PlaylistUpdaterInterface::s_factories = QMap< QString, PlaylistUpdaterFactory* >();
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
operator==( const Tomahawk::PlaylistUpdaterInterface::SerializedUpdater& one, const Tomahawk::PlaylistUpdaterInterface::SerializedUpdater& two )
|
operator==( const SerializedUpdater& one, const SerializedUpdater& two )
|
||||||
{
|
{
|
||||||
return one.type == two.type;
|
return one.type == two.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
using namespace Tomahawk;
|
||||||
|
|
||||||
|
QMap< QString, PlaylistUpdaterFactory* > PlaylistUpdaterInterface::s_factories = QMap< QString, PlaylistUpdaterFactory* >();
|
||||||
|
|
||||||
void
|
void
|
||||||
PlaylistUpdaterInterface::registerUpdaterFactory( PlaylistUpdaterFactory* f )
|
PlaylistUpdaterInterface::registerUpdaterFactory( PlaylistUpdaterFactory* f )
|
||||||
|
@@ -39,22 +39,22 @@ namespace Tomahawk
|
|||||||
|
|
||||||
class PlaylistUpdaterFactory;
|
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
|
class DLLEXPORT PlaylistUpdaterInterface : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
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 );
|
explicit PlaylistUpdaterInterface( const playlist_ptr& pl );
|
||||||
|
|
||||||
virtual ~PlaylistUpdaterInterface();
|
virtual ~PlaylistUpdaterInterface();
|
||||||
@@ -114,7 +114,7 @@ public:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_DECLARE_METATYPE( Tomahawk::PlaylistUpdaterInterface::SerializedUpdater );
|
Q_DECLARE_METATYPE( Tomahawk::SerializedUpdater );
|
||||||
Q_DECLARE_METATYPE( Tomahawk::PlaylistUpdaterInterface::SerializedUpdaters );
|
Q_DECLARE_METATYPE( Tomahawk::SerializedUpdaters );
|
||||||
|
|
||||||
#endif // PLAYLISTUPDATERINTERFACE_H
|
#endif // PLAYLISTUPDATERINTERFACE_H
|
||||||
|
Reference in New Issue
Block a user