1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 08:19:42 +01:00

Auto-create zeroconf plugin with new installs

Actually save no-config-widget plugins to settings too
This commit is contained in:
Leo Franchi 2011-05-03 19:17:00 -04:00
parent 81fe1c8061
commit ea5cefd2d4
4 changed files with 11 additions and 11 deletions

View File

@ -47,6 +47,7 @@ TomahawkSettings::TomahawkSettings( QObject* parent )
if( !contains( "configversion") )
{
setValue( "configversion", VERSION );
doInitialSetup();
}
else if( value( "configversion" ).toUInt() != VERSION )
{
@ -72,6 +73,14 @@ TomahawkSettings::~TomahawkSettings()
s_instance = 0;
}
void
TomahawkSettings::doInitialSetup()
{
// by default we add a local network resolver
addSipPlugin( "sipzeroconf_autocreated" );
}
void
TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
{
@ -104,10 +113,6 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
remove( "jabber/autoconnect" );
remove( "jabber/server" );
remove( "jabber/port" );
// will be auto-added in the appropriate places
// SipPlugin* p = SipHandler::instance()->loadPlugin( "sipjabber_legacy" );
// SipHandler::instance()->enablePlugin( p );
}
if( contains( "twitter/ScreenName" ) && contains( "twitter/OAuthToken" ) )
{
@ -127,14 +132,9 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
remove( "twitter/CachedFriendsSinceID" );
remove( "twitter/CachedMentionsSinceID" );
remove( "twitter/CachedDirectMessagesSinceID" );
// SipPlugin* p = SipHandler::instance()->loadPlugin( "siptwitter_legacy" );
// SipHandler::instance()->enablePlugin( p );
}
// create a zeroconf plugin too
addSipPlugin( "sipzeroconf_legacy" );
// SipPlugin* p = SipHandler::instance()->createPlugin( "sipzeroconf" );
// SipHandler::instance()->enablePlugin( p );
}
}

View File

@ -162,6 +162,7 @@ signals:
void recentlyPlayedPlaylistAdded( const Tomahawk::playlist_ptr& playlist );
private:
void doInitialSetup();
void doUpgrade( int oldVersion, int newVersion );
static TomahawkSettings* s_instance;

View File

@ -542,6 +542,7 @@ SettingsDialog::sipFactoryClicked( SipPluginFactory* factory )
} else {
// no config, so just add it
added = true;
TomahawkSettings::instance()->addSipPlugin( p->pluginId() );
SipHandler::instance()->addSipPlugin( p );
}

View File

@ -26,8 +26,6 @@ ZeroconfFactory::createPlugin( const QString& pluginId )
return new ZeroconfPlugin( pluginId.isEmpty() ? generateId() : pluginId );
}
const QString
ZeroconfPlugin::name() const
{