BareMetal: Remove error return value from fromMap

This was never used.

Change-Id: Ic4474fe4a7e634409523407d351529bdde89f4af
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2023-07-28 14:58:33 +02:00
parent e1211974a5
commit bc1ef0f158
20 changed files with 32 additions and 60 deletions

View File

@@ -158,16 +158,13 @@ void EBlinkGdbServerProvider::toMap(QVariantMap &data) const
data.insert(gdbNotUseCacheC, m_gdbNotUseCache);
}
bool EBlinkGdbServerProvider::fromMap(const QVariantMap &data)
void EBlinkGdbServerProvider::fromMap(const QVariantMap &data)
{
if (!GdbServerProvider::fromMap(data))
return false;
GdbServerProvider::fromMap(data);
m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC));
m_verboseLevel = data.value(verboseLevelKeyC).toInt();
m_interfaceResetOnConnect = data.value(interfaceResetOnConnectC).toBool();
m_interfaceType = static_cast<InterfaceType>(
data.value(interfaceTypeC).toInt());
m_interfaceType = static_cast<InterfaceType>(data.value(interfaceTypeC).toInt());
m_deviceScript = FilePath::fromSettings(data.value(deviceScriptC));
m_interfaceResetOnConnect = data.value(interfaceResetOnConnectC).toBool();
m_interfaceSpeed = data.value(interfaceSpeedC).toInt();
@@ -176,8 +173,6 @@ bool EBlinkGdbServerProvider::fromMap(const QVariantMap &data)
m_targetDisableStack = data.value(targetDisableStackC).toBool();
m_gdbShutDownAfterDisconnect = data.value(gdbShutDownAfterDisconnectC).toBool();
m_gdbNotUseCache = data.value(gdbNotUseCacheC).toBool();
return true;
}
bool EBlinkGdbServerProvider::operator==(const IDebugServerProvider &other) const

View File

@@ -22,7 +22,7 @@ public:
enum InterfaceType { SWD, JTAG };
void toMap(QVariantMap &data) const final;
bool fromMap(const QVariantMap &data) final;
void fromMap(const QVariantMap &data) final;
bool operator==(const IDebugServerProvider &other) const final;

View File

@@ -179,17 +179,14 @@ RunWorker *GdbServerProvider::targetRunner(RunControl *runControl) const
return new GdbServerProviderRunner(runControl, command());
}
bool GdbServerProvider::fromMap(const QVariantMap &data)
void GdbServerProvider::fromMap(const QVariantMap &data)
{
if (!IDebugServerProvider::fromMap(data))
return false;
IDebugServerProvider::fromMap(data);
m_startupMode = static_cast<StartupMode>(data.value(startupModeKeyC).toInt());
m_peripheralDescriptionFile = FilePath::fromSettings(data.value(peripheralDescriptionFileKeyC));
m_initCommands = data.value(initCommandsKeyC).toString();
m_resetCommands = data.value(resetCommandsKeyC).toString();
m_useExtendedRemote = data.value(useExtendedRemoteKeyC).toBool();
return true;
}
// GdbServerProviderConfigWidget

View File

@@ -55,7 +55,7 @@ protected:
void setResetCommands(const QString &);
void setUseExtendedRemote(bool);
bool fromMap(const QVariantMap &data) override;
void fromMap(const QVariantMap &data) override;
StartupMode m_startupMode = StartupOnNetwork;
Utils::FilePath m_peripheralDescriptionFile;

View File

@@ -130,11 +130,9 @@ void JLinkGdbServerProvider::toMap(QVariantMap &data) const
data.insert(additionalArgumentsKeyC, m_additionalArguments);
}
bool JLinkGdbServerProvider::fromMap(const QVariantMap &data)
void JLinkGdbServerProvider::fromMap(const QVariantMap &data)
{
if (!GdbServerProvider::fromMap(data))
return false;
GdbServerProvider::fromMap(data);
m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC));
m_jlinkDevice = data.value(jlinkDeviceKeyC).toString();
m_additionalArguments = data.value(additionalArgumentsKeyC).toString();
@@ -142,7 +140,6 @@ bool JLinkGdbServerProvider::fromMap(const QVariantMap &data)
m_jlinkHostAddr = data.value(jlinkHostInterfaceIPAddressKeyC).toString();
m_jlinkTargetIface = data.value(jlinkTargetInterfaceKeyC).toString();
m_jlinkTargetIfaceSpeed = data.value(jlinkTargetInterfaceSpeedKeyC).toString();
return true;
}
bool JLinkGdbServerProvider::operator==(const IDebugServerProvider &other) const

View File

@@ -19,7 +19,7 @@ class JLinkGdbServerProvider final : public GdbServerProvider
{
public:
void toMap(QVariantMap &data) const final;
bool fromMap(const QVariantMap &data) final;
void fromMap(const QVariantMap &data) final;
bool operator==(const IDebugServerProvider &other) const final;

View File

@@ -134,16 +134,13 @@ void OpenOcdGdbServerProvider::toMap(QVariantMap &data) const
data.insert(additionalArgumentsKeyC, m_additionalArguments);
}
bool OpenOcdGdbServerProvider::fromMap(const QVariantMap &data)
void OpenOcdGdbServerProvider::fromMap(const QVariantMap &data)
{
if (!GdbServerProvider::fromMap(data))
return false;
GdbServerProvider::fromMap(data);
m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC));
m_rootScriptsDir = FilePath::fromSettings(data.value(rootScriptsDirKeyC));
m_configurationFile = FilePath::fromSettings(data.value(configurationFileKeyC));
m_additionalArguments = data.value(additionalArgumentsKeyC).toString();
return true;
}
bool OpenOcdGdbServerProvider::operator==(const IDebugServerProvider &other) const

View File

@@ -19,7 +19,7 @@ class OpenOcdGdbServerProvider final : public GdbServerProvider
{
public:
void toMap(QVariantMap &data) const final;
bool fromMap(const QVariantMap &data) final;
void fromMap(const QVariantMap &data) final;
bool operator==(const IDebugServerProvider &other) const final;

View File

@@ -124,11 +124,9 @@ void StLinkUtilGdbServerProvider::toMap(QVariantMap &data) const
data.insert(connectUnderResetKeyC, m_connectUnderReset);
}
bool StLinkUtilGdbServerProvider::fromMap(const QVariantMap &data)
void StLinkUtilGdbServerProvider::fromMap(const QVariantMap &data)
{
if (!GdbServerProvider::fromMap(data))
return false;
GdbServerProvider::fromMap(data);
m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC));
m_verboseLevel = data.value(verboseLevelKeyC).toInt();
m_extendedMode = data.value(extendedModeKeyC).toBool();
@@ -136,7 +134,6 @@ bool StLinkUtilGdbServerProvider::fromMap(const QVariantMap &data)
m_transport = static_cast<TransportLayer>(
data.value(transportLayerKeyC).toInt());
m_connectUnderReset = data.value(connectUnderResetKeyC).toBool();
return true;
}
bool StLinkUtilGdbServerProvider::operator==(const IDebugServerProvider &other) const

View File

@@ -22,7 +22,7 @@ public:
enum TransportLayer { ScsiOverUsb = 1, RawUsb = 2, UnspecifiedTransport };
void toMap(QVariantMap &data) const final;
bool fromMap(const QVariantMap &data) final;
void fromMap(const QVariantMap &data) final;
bool operator==(const IDebugServerProvider &other) const final;

View File

@@ -164,12 +164,10 @@ void JLinkUvscServerProvider::toMap(QVariantMap &data) const
data.insert(adapterOptionsKeyC, m_adapterOpts.toMap());
}
bool JLinkUvscServerProvider::fromMap(const QVariantMap &data)
void JLinkUvscServerProvider::fromMap(const QVariantMap &data)
{
if (!UvscServerProvider::fromMap(data))
return false;
UvscServerProvider::fromMap(data);
m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).toMap());
return true;
}
bool JLinkUvscServerProvider::operator==(const IDebugServerProvider &other) const

View File

@@ -37,7 +37,7 @@ class JLinkUvscServerProvider final : public UvscServerProvider
{
public:
void toMap(QVariantMap &data) const final;
bool fromMap(const QVariantMap &data) final;
void fromMap(const QVariantMap &data) final;
bool operator==(const IDebugServerProvider &other) const final;
Utils::FilePath optionsFilePath(Debugger::DebuggerRunTool *runTool,

View File

@@ -69,12 +69,10 @@ void SimulatorUvscServerProvider::toMap(QVariantMap &data) const
data.insert(limitSpeedKeyC, m_limitSpeed);
}
bool SimulatorUvscServerProvider::fromMap(const QVariantMap &data)
void SimulatorUvscServerProvider::fromMap(const QVariantMap &data)
{
if (!UvscServerProvider::fromMap(data))
return false;
UvscServerProvider::fromMap(data);
m_limitSpeed = data.value(limitSpeedKeyC).toBool();
return true;
}
bool SimulatorUvscServerProvider::operator==(const IDebugServerProvider &other) const

View File

@@ -17,7 +17,7 @@ class SimulatorUvscServerProvider final : public UvscServerProvider
{
public:
void toMap(QVariantMap &data) const final;
bool fromMap(const QVariantMap &data) final;
void fromMap(const QVariantMap &data) final;
bool operator==(const IDebugServerProvider &other) const final;
bool isSimulator() const final { return true; }

View File

@@ -120,12 +120,10 @@ void StLinkUvscServerProvider::toMap(QVariantMap &data) const
data.insert(adapterOptionsKeyC, m_adapterOpts.toMap());
}
bool StLinkUvscServerProvider::fromMap(const QVariantMap &data)
void StLinkUvscServerProvider::fromMap(const QVariantMap &data)
{
if (!UvscServerProvider::fromMap(data))
return false;
UvscServerProvider::fromMap(data);
m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).toMap());
return true;
}
bool StLinkUvscServerProvider::operator==(const IDebugServerProvider &other) const

View File

@@ -40,7 +40,7 @@ class StLinkUvscServerProvider final : public UvscServerProvider
{
public:
void toMap(QVariantMap &data) const final;
bool fromMap(const QVariantMap &data) final;
void fromMap(const QVariantMap &data) final;
bool operator==(const IDebugServerProvider &other) const final;
Utils::FilePath optionsFilePath(Debugger::DebuggerRunTool *runTool,

View File

@@ -219,14 +219,12 @@ ProjectExplorer::RunWorker *UvscServerProvider::targetRunner(RunControl *runCont
return new UvscServerProviderRunner(runControl, r);
}
bool UvscServerProvider::fromMap(const QVariantMap &data)
void UvscServerProvider::fromMap(const QVariantMap &data)
{
if (!IDebugServerProvider::fromMap(data))
return false;
IDebugServerProvider::fromMap(data);
m_toolsIniFile = FilePath::fromSettings(data.value(toolsIniKeyC));
m_deviceSelection.fromMap(data.value(deviceSelectionKeyC).toMap());
m_driverSelection.fromMap(data.value(driverSelectionKeyC).toMap());
return true;
}
FilePath UvscServerProvider::projectFilePath(DebuggerRunTool *runTool, QString &errorMessage) const

View File

@@ -69,7 +69,7 @@ protected:
Utils::FilePath buildProjectFilePath(Debugger::DebuggerRunTool *runTool) const;
Utils::FilePath buildOptionsFilePath(Debugger::DebuggerRunTool *runTool) const;
bool fromMap(const QVariantMap &data) override;
void fromMap(const QVariantMap &data) override;
// uVision specific stuff.
virtual Utils::FilePath projectFilePath(Debugger::DebuggerRunTool *runTool,

View File

@@ -166,7 +166,7 @@ void IDebugServerProvider::resetId()
m_id = createId(m_id);
}
bool IDebugServerProvider::fromMap(const QVariantMap &data)
void IDebugServerProvider::fromMap(const QVariantMap &data)
{
m_id = data.value(idKeyC).toString();
m_displayName = data.value(displayNameKeyC).toString();
@@ -174,7 +174,6 @@ bool IDebugServerProvider::fromMap(const QVariantMap &data)
data.value(engineTypeKeyC, NoEngineType).toInt());
m_channel.setHost(data.value(hostKeyC).toString());
m_channel.setPort(data.value(portKeyC).toInt());
return true;
}
void IDebugServerProvider::setConfigurationWidgetCreator(const std::function<IDebugServerProviderConfigWidget *()> &configurationWidgetCreator)
@@ -209,10 +208,8 @@ IDebugServerProvider *IDebugServerProviderFactory::create() const
IDebugServerProvider *IDebugServerProviderFactory::restore(const QVariantMap &data) const
{
IDebugServerProvider *p = m_creator();
if (p->fromMap(data))
return p;
delete p;
return nullptr;
p->fromMap(data);
return p;
}
bool IDebugServerProviderFactory::canRestore(const QVariantMap &data) const

View File

@@ -66,7 +66,7 @@ public:
(const std::function<IDebugServerProviderConfigWidget *()> &configurationWidgetCreator);
virtual void toMap(QVariantMap &data) const;
virtual bool fromMap(const QVariantMap &data);
virtual void fromMap(const QVariantMap &data);
virtual bool aboutToRun(Debugger::DebuggerRunTool *runTool,
QString &errorMessage) const = 0;