Skip to content

Commit 3bdc25f

Browse files
committed
remove unused method and field
1 parent 145ccab commit 3bdc25f

4 files changed

Lines changed: 67 additions & 16 deletions

File tree

QPingSF/QPing.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*
2+
The MIT License
3+
SPDX short identifier: MIT https://opensource.org/licenses/MIT
4+
Copyright 2018-. j2doll https://github.com/j2doll
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8+
*/
9+
110
// QPing.cpp
211

312
#include <QtGlobal>

QPingSF/QPing.h

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
77
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8-
98
*/
9+
1010
// QPing.h
1111

1212
#ifndef QPING_H
@@ -29,14 +29,29 @@
2929
class QPing : public QObject
3030
{
3131
Q_OBJECT
32-
Q_PROPERTY(QString iniFile READ iniFile WRITE setIniFile)
3332

3433
public:
34+
35+
/**
36+
* @brief QPing
37+
* @param constructor
38+
*/
3539
explicit QPing(QObject *parent = nullptr);
3640

3741
public:
42+
43+
/**
44+
* @brief set ini file for os and os language
45+
* @param iniFile : ini file name
46+
*/
3847
void setIniFile(QString iniFile);
48+
49+
/**
50+
* @brief ini file name
51+
* @return return ini file name
52+
*/
3953
QString iniFile() const;
54+
4055
public:
4156
/**
4257
* @brief ping reult
@@ -55,14 +70,14 @@ class QPing : public QObject
5570
* @param iniFile : name of ini file for config. if you set ini file name, you may not set this param.
5671
* @return true: success to load ini file. false: failed to load ini file.
5772
*/
58-
bool loadIniFile(QString iniFile = QString(""));
73+
bool loadIniFile( QString iniFile = QString("") );
5974

6075
/**
6176
* @brief ping function.
6277
* @param destIpAddress : destination ip address
6378
* @return returns ping result
6479
*/
65-
QPing::pingResult ping(QString destIpAddress);
80+
QPing::pingResult ping( QString destIpAddress );
6681

6782
protected:
6883
/**

QPingSF/QPingSF.pro

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1+
#
2+
# QPingSF.pro
3+
#
4+
# The MIT License
5+
# SPDX short identifier: MIT https://opensource.org/licenses/MIT
6+
# Copyright 2018-. j2doll https://github.com/j2doll
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and # to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10+
111
QT -= gui
212

3-
CONFIG += c++11 console
13+
CONFIG += c++11
14+
CONFIG += console
415
CONFIG -= app_bundle
516

617
# The following define makes your compiler emit warnings if you use
@@ -14,8 +25,11 @@ DEFINES += QT_DEPRECATED_WARNINGS
1425
# You can also select to disable deprecated APIs only up to a certain version of Qt.
1526
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
1627

17-
SOURCES += main.cpp \
18-
QPing.cpp
19-
2028
HEADERS += \
21-
QPing.h
29+
QPing.h
30+
31+
SOURCES += \
32+
main.cpp \
33+
QPing.cpp
34+
35+

QPingSF/main.cpp

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*
2+
The MIT License
3+
SPDX short identifier: MIT https://opensource.org/licenses/MIT
4+
Copyright 2018-. j2doll https://github.com/j2doll
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8+
*/
9+
110
// main.cpp
211

312
#include <QtGlobal>
@@ -16,24 +25,24 @@ int main(int argc, char *argv[])
1625
{
1726
QCoreApplication a(argc, argv);
1827

19-
QString destIpAddress = "192.168.0.1";
28+
QString destIpAddress = "192.168.0.10";
2029
if ( argc == 2 )
2130
{
2231
// You can use application first parameter
23-
// For example) QPingSF 192.168.100.10
32+
// For example) QPingSF 192.168.200.50
2433
QString strArg = argv[1];
2534
destIpAddress = strArg;
2635
}
2736

28-
// see sample of *.ini for OS (You can
37+
// Define your OS and OS language.
38+
// See sample of *.ini for OS. (You can define your own INI file)
2939
QString iniFilePath = "./ping-config-win-en.ini"; // Windows, English
3040
// QString iniFilePath = "./ping-config-win-kr.ini"; // Windows, Korean
3141
// QString iniFilePath = "./ping-config-linux-en.ini"; // Linux, English
3242

33-
QPing qp;
43+
QPing qp; // main class
3444

35-
// set configuration file
36-
qp.setIniFile( iniFilePath );
45+
qp.setIniFile( iniFilePath ); // set configuration file
3746
if ( ! qp.loadIniFile() )
3847
{
3948
std::cout << "[ERROR] Failed to load ini file" << std::endl;
@@ -60,8 +69,12 @@ int main(int argc, char *argv[])
6069
case QPing::notFound: // something wrong
6170
std::cout << "[ERROR] Result is not found" << std::endl;
6271
break;
72+
73+
default:
74+
std::cout << "Undefined result : " << ((quint32)result) << std::endl;
75+
break;
6376
}
6477

65-
return 0; // return a.exec();
78+
return 0;
6679
}
6780

0 commit comments

Comments
 (0)