Device support: Make device testing a "well-known" concept.

This entails the following:
    - Rename AbstractLinuxDeviceTester to DeviceTester and
      move it up into ProjectExplorer. The class stays
      unchanged, as there was nothing Linux-specific about it.
      The same goes for the associated dialog.
    - Move the createDeviceTester() function from LinuxDevice
      to IDevice and introduce IDevice::hasDeviceTester() to
      enable generic code to make use of this feature.
    - Move device testing out of the list of opaque
      device-specific actions; instead, the device settings widget
      now uses the device tester directly, if applicable.
Rationale:
    - Device testing, just like remote process listing (if not more so),
      is a general concept that implementors of device classes will
      probably want to implement (and they should be encouraged to do so).
      Without the mechanism provided here, they would all need to put
      basically the same code into the actionIds(), displayNameForActionId()
      and executeAction() functions.

This patch is the natural extension of b90e3bbd8b.

Change-Id: I94f2badb4ceeda9f5cd3b066c13626bb4f65505d
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
Christian Kandeler
2013-06-27 17:12:08 +02:00
parent d6062643c3
commit 5bca241afb
27 changed files with 122 additions and 130 deletions

View File

@@ -38,7 +38,7 @@ using namespace Qnx;
using namespace Qnx::Internal;
QnxDeviceTester::QnxDeviceTester(QObject *parent)
: RemoteLinux::AbstractLinuxDeviceTester(parent)
: ProjectExplorer::DeviceTester(parent)
, m_result(TestSuccess)
, m_state(Inactive)
, m_currentCommandIndex(-1)
@@ -70,8 +70,8 @@ void QnxDeviceTester::testDevice(const ProjectExplorer::IDevice::ConstPtr &devic
connect(m_genericTester, SIGNAL(progressMessage(QString)), SIGNAL(progressMessage(QString)));
connect(m_genericTester, SIGNAL(errorMessage(QString)), SIGNAL(errorMessage(QString)));
connect(m_genericTester, SIGNAL(finished(RemoteLinux::AbstractLinuxDeviceTester::TestResult)),
SLOT(handleGenericTestFinished(RemoteLinux::AbstractLinuxDeviceTester::TestResult)));
connect(m_genericTester, SIGNAL(finished(ProjectExplorer::DeviceTester::TestResult)),
SLOT(handleGenericTestFinished(ProjectExplorer::DeviceTester::TestResult)));
m_state = GenericTest;
m_genericTester->testDevice(deviceConfiguration);
@@ -96,7 +96,7 @@ void QnxDeviceTester::stopTest()
setFinished();
}
void QnxDeviceTester::handleGenericTestFinished(RemoteLinux::AbstractLinuxDeviceTester::TestResult result)
void QnxDeviceTester::handleGenericTestFinished(TestResult result)
{
QTC_ASSERT(m_state == GenericTest, return);