Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor plugins refactoring #611

Merged
merged 6 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
BasedOnStyle: LLVM
ColumnLimit: 100
IndentWidth: 4
ReferenceAlignment: Pointer
PointerAlignment: Left
...
3 changes: 1 addition & 2 deletions plugin/dltdbusplugin/dltdbusplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,8 @@ bool DltDBusPlugin::initControl(QDltControl *control)
}


bool DltDBusPlugin::initConnections(QStringList list)
bool DltDBusPlugin::initConnections(QStringList)
{
Q_UNUSED(list);
return true;
}

Expand Down
15 changes: 4 additions & 11 deletions plugin/dlttestrobotplugin/dlttestrobotplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,12 @@ DltTestRobotPlugin::DltTestRobotPlugin()
counterVerboseMessages = 0;
dltFile = 0;
dltControl = 0;
ecuList = 0;

tcpSocket = 0;

port = 4490;
}

DltTestRobotPlugin::~DltTestRobotPlugin()
{

}

QString DltTestRobotPlugin::name()
{
return QString("DLT Test Robot Plugin");
Expand Down Expand Up @@ -98,7 +92,7 @@ bool DltTestRobotPlugin::initControl(QDltControl *control)

bool DltTestRobotPlugin::initConnections(QStringList list)
{
ecuList = new QStringList(list);
ecuList = std::move(list);

return false;
}
Expand Down Expand Up @@ -196,12 +190,12 @@ void DltTestRobotPlugin::readyRead()

QStringList list = text.split(' ');

if(list[0]=="injection" && ecuList)
if(list[0]=="injection")
{
QString ecuId = list[1];
for(int num=0;num<ecuList->length();num++)
for(int num=0;num<ecuList.length();num++)
{
if(ecuList->at(num).contains(ecuId) && dltControl)
if(ecuList.at(num).contains(ecuId) && dltControl)
{
list.removeAt(0);
list.removeAt(0);
Expand Down Expand Up @@ -296,7 +290,6 @@ void DltTestRobotPlugin::newConnection()

void DltTestRobotPlugin::connected()
{

}

void DltTestRobotPlugin::disconnected()
Expand Down
4 changes: 2 additions & 2 deletions plugin/dlttestrobotplugin/dlttestrobotplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DltTestRobotPlugin : public QObject, QDLTPluginInterface, QDltPluginViewer

public:
DltTestRobotPlugin();
~DltTestRobotPlugin();
~DltTestRobotPlugin() = default;

/* QDLTPluginInterface interface */
QString name();
Expand Down Expand Up @@ -101,7 +101,7 @@ private slots:
private:
QDltFile *dltFile;
QString errorText;
QStringList *ecuList;
QStringList ecuList;

QTcpServer tcpServer;
QTcpSocket *tcpSocket;
Expand Down
3 changes: 1 addition & 2 deletions plugin/filetransferplugin/filetransferplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,8 @@ bool FiletransferPlugin::initControl(QDltControl *control)
}


bool FiletransferPlugin::initConnections(QStringList list)
bool FiletransferPlugin::initConnections(QStringList)
{
Q_UNUSED(list);
return true;
}

Expand Down
4 changes: 1 addition & 3 deletions plugin/nonverboseplugin/nonverboseplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,10 +666,8 @@ bool NonverbosePlugin::initControl(QDltControl *control)
return true;
}

bool NonverbosePlugin::initConnections(QStringList list)
bool NonverbosePlugin::initConnections(QStringList)
{
Q_UNUSED(list);

return false;
}

Expand Down
2 changes: 1 addition & 1 deletion qdlt/qdltplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ bool QDltPlugin::isCommand()
}

// generic plugin interfaces
QString QDltPlugin::name()
QString QDltPlugin::name() const
{
if(plugininterface)
return plugininterface->name();
Expand Down
2 changes: 1 addition & 1 deletion qdlt/qdltplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class QDLT_EXPORT QDltPlugin
bool isCommand();

// generic plugin interfaces
QString name();
QString name() const;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

many of the methods here should actually be const, but I do not change that because I do not know what promise we have to hold for plugins implementers

QString pluginVersion();
QString pluginInterfaceVersion();
QString error();
Expand Down
Loading