-
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address review (part 3): Header, Read-only, Protected, Blind casting, ..
1- Add header to abstractgnssreceiver.cpp, egeniousseeceiver.cpp, egeniousseeceiver.h. 2- Read-only socketState. 3- protected: `void setSocketState` 4- QBluetoothSocket::SocketState to QAbstractSocket::SocketState. 5- Pruning methods in sub classes.
- Loading branch information
Showing
5 changed files
with
81 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
/*************************************************************************** | ||
abstractgnssreceiver.cpp - AbstractGnssReceiver | ||
--------------------- | ||
begin : October 2024 | ||
copyright : (C) 2024 by Mohsen Dehghanzadeh | ||
email : [email protected] | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "abstractgnssreceiver.h" | ||
|
||
AbstractGnssReceiver::AbstractGnssReceiver( QObject *parent ) | ||
|
@@ -25,8 +41,12 @@ QString AbstractGnssReceiver::socketStateString() | |
void AbstractGnssReceiver::setSocketState( const QAbstractSocket::SocketState &state ) | ||
{ | ||
if ( mSocketState == state ) | ||
{ | ||
return; | ||
} | ||
|
||
mSocketState = state; | ||
|
||
emit socketStateChanged( mSocketState ); | ||
emit socketStateStringChanged( socketStateString() ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
/*************************************************************************** | ||
egeniousseeceiver.cpp - EgenioussReceiver | ||
--------------------- | ||
begin : October 2024 | ||
copyright : (C) 2024 by Mohsen Dehghanzadeh | ||
email : [email protected] | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "egenioussreceiver.h" | ||
|
||
#include <QHostAddress> | ||
|
@@ -9,9 +25,7 @@ EgenioussReceiver::EgenioussReceiver( QObject *parent ) | |
{ | ||
connect( mTcpSocket, &QTcpSocket::readyRead, this, &EgenioussReceiver::onReadyRead ); | ||
connect( mTcpSocket, &QTcpSocket::errorOccurred, this, &EgenioussReceiver::handleError ); | ||
connect( mTcpSocket, &QTcpSocket::stateChanged, this, [=]( QAbstractSocket::SocketState state ) { | ||
setSocketState( state ); | ||
} ); | ||
connect( mTcpSocket, &QTcpSocket::stateChanged, this, &AbstractGnssReceiver::setSocketState ); | ||
|
||
setValid( true ); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
/*************************************************************************** | ||
egeniousseeceiver.h - EgenioussReceiver | ||
--------------------- | ||
begin : October 2024 | ||
copyright : (C) 2024 by Mohsen Dehghanzadeh | ||
email : [email protected] | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef EGENIOUSSRECEIVER_H | ||
#define EGENIOUSSRECEIVER_H | ||
|
||
|