Device Support: Fix device restoring.

The S60Manager instantiated the device manager, which then tried
to restore the devices with not all factories being present, resulting
in most saved devices being lost.
That instantiation is now moved to a point in time when all plugins
have been initialized.

Change-Id: I15145bddde89dd6109e092a7b8e03bb92934a29a
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Christian Kandeler
2012-04-18 12:04:14 +02:00
committed by Tobias Hunger
parent e59d06ba00
commit 53702d5dcc
4 changed files with 15 additions and 3 deletions

View File

@@ -130,9 +130,6 @@ S60Manager::S60Manager(QObject *parent) : QObject(parent)
addAutoReleasedObject(new Internal::SymbianIDeviceFactory); addAutoReleasedObject(new Internal::SymbianIDeviceFactory);
ProjectExplorer::IDevice::Ptr dev(new SymbianIDevice);
ProjectExplorer::DeviceManager::instance()->addDevice(dev);
connect(Core::ICore::mainWindow(), SIGNAL(deviceChange()), connect(Core::ICore::mainWindow(), SIGNAL(deviceChange()),
SymbianUtils::SymbianDeviceManager::instance(), SLOT(update())); SymbianUtils::SymbianDeviceManager::instance(), SLOT(update()));
@@ -160,6 +157,12 @@ QString S60Manager::platform(const ProjectExplorer::ToolChain *tc)
return target.right(target.lastIndexOf(QLatin1Char('-'))); return target.right(target.lastIndexOf(QLatin1Char('-')));
} }
void S60Manager::addDevice()
{
ProjectExplorer::IDevice::Ptr dev(new SymbianIDevice);
ProjectExplorer::DeviceManager::instance()->addDevice(dev);
}
void S60Manager::symbianDeviceRemoved(const SymbianUtils::SymbianDevice &d) void S60Manager::symbianDeviceRemoved(const SymbianUtils::SymbianDevice &d)
{ {
handleSymbianDeviceStateChange(d, ProjectExplorer::IDevice::DeviceUnavailable); handleSymbianDeviceStateChange(d, ProjectExplorer::IDevice::DeviceUnavailable);

View File

@@ -53,6 +53,8 @@ public:
static QString platform(const ProjectExplorer::ToolChain *tc); static QString platform(const ProjectExplorer::ToolChain *tc);
void addDevice();
private slots: private slots:
void symbianDeviceRemoved(const SymbianUtils::SymbianDevice &d); void symbianDeviceRemoved(const SymbianUtils::SymbianDevice &d);
void symbianDeviceAdded(const SymbianUtils::SymbianDevice &d); void symbianDeviceAdded(const SymbianUtils::SymbianDevice &d);

View File

@@ -293,6 +293,12 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
return true; return true;
} }
bool Qt4ProjectManagerPlugin::delayedInitialize()
{
S60Manager::instance()->addDevice();
return true;
}
void Qt4ProjectManagerPlugin::extensionsInitialized() void Qt4ProjectManagerPlugin::extensionsInitialized()
{ {
m_qt4ProjectManager->init(); m_qt4ProjectManager->init();

View File

@@ -67,6 +67,7 @@ public:
Qt4ProjectManagerPlugin(); Qt4ProjectManagerPlugin();
~Qt4ProjectManagerPlugin(); ~Qt4ProjectManagerPlugin();
bool initialize(const QStringList &arguments, QString *errorMessage); bool initialize(const QStringList &arguments, QString *errorMessage);
bool delayedInitialize();
void extensionsInitialized(); void extensionsInitialized();
private slots: private slots: