Changeset View
Changeset View
Standalone View
Standalone View
src/statsyncing/Controller.cpp
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Line(s) | 143 | { | |||
---|---|---|---|---|---|
144 | m_config->updateProvider( provider->id(), provider->prettyName(), | 144 | m_config->updateProvider( provider->id(), provider->prettyName(), | ||
145 | provider->icon(), /* online */ false ); | 145 | provider->icon(), /* online */ false ); | ||
146 | m_config->save(); | 146 | m_config->save(); | ||
147 | } | 147 | } | ||
148 | m_providers.removeAll( provider ); | 148 | m_providers.removeAll( provider ); | ||
149 | } | 149 | } | ||
150 | 150 | | |||
151 | void | 151 | void | ||
152 | Controller::setFactories( const QList<Plugins::PluginFactory*> &factories ) | 152 | Controller::setFactories( const QList<QSharedPointer<Plugins::PluginFactory> > &factories ) | ||
153 | { | 153 | { | ||
154 | foreach( Plugins::PluginFactory *pFactory, factories ) | 154 | for( const auto &pFactory : factories ) | ||
155 | { | 155 | { | ||
156 | ProviderFactory *factory = qobject_cast<ProviderFactory*>( pFactory ); | 156 | auto factory = qobject_cast<ProviderFactory*>( pFactory ); | ||
157 | if( !factory ) | 157 | if( !factory ) | ||
158 | continue; | 158 | continue; | ||
159 | 159 | | |||
160 | if( m_providerFactories.contains( factory->type() ) ) // we have it already | 160 | if( m_providerFactories.contains( factory->type() ) ) // we have it already | ||
161 | continue; | 161 | continue; | ||
162 | 162 | | |||
163 | m_providerFactories.insert( factory->type(), factory ); | 163 | m_providerFactories.insert( factory->type(), factory ); | ||
164 | } | 164 | } | ||
Show All 30 Lines | 182 | { | |||
195 | 195 | | |||
196 | return dialog; | 196 | return dialog; | ||
197 | } | 197 | } | ||
198 | 198 | | |||
199 | QWidget* | 199 | QWidget* | ||
200 | Controller::providerCreationDialog() const | 200 | Controller::providerCreationDialog() const | ||
201 | { | 201 | { | ||
202 | CreateProviderDialog *dialog = new CreateProviderDialog( The::mainWindow() ); | 202 | CreateProviderDialog *dialog = new CreateProviderDialog( The::mainWindow() ); | ||
203 | foreach( ProviderFactory * const factory, m_providerFactories ) | 203 | for( const auto &factory : m_providerFactories ) | ||
204 | dialog->addProviderType( factory->type(), factory->prettyName(), | 204 | dialog->addProviderType( factory->type(), factory->prettyName(), | ||
205 | factory->icon(), factory->createConfigWidget() ); | 205 | factory->icon(), factory->createConfigWidget() ); | ||
206 | 206 | | |||
207 | connect( dialog, &StatSyncing::CreateProviderDialog::providerConfigured, | 207 | connect( dialog, &StatSyncing::CreateProviderDialog::providerConfigured, | ||
208 | this, &Controller::createProvider ); | 208 | this, &Controller::createProvider ); | ||
209 | connect( dialog, &StatSyncing::CreateProviderDialog::finished, | 209 | connect( dialog, &StatSyncing::CreateProviderDialog::finished, | ||
210 | dialog, &StatSyncing::CreateProviderDialog::deleteLater ); | 210 | dialog, &StatSyncing::CreateProviderDialog::deleteLater ); | ||
211 | 211 | | |||
▲ Show 20 Lines • Show All 238 Lines • Show Last 20 Lines |