Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCHNetChecker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
borsitsb
SCHNetChecker
Commits
702b4709
Commit
702b4709
authored
Aug 9, 2015
by
borsitsb
Browse files
Options
Downloads
Patches
Plain Diff
added Linux compatibility
parent
48737857
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/Diagnostic.hpp
+9
-5
9 additions, 5 deletions
include/Diagnostic.hpp
include/NetCheckerWindow.cpp
+1
-1
1 addition, 1 deletion
include/NetCheckerWindow.cpp
netchecker.pro.user
+49
-53
49 additions, 53 deletions
netchecker.pro.user
with
59 additions
and
59 deletions
include/Diagnostic.hpp
+
9
−
5
View file @
702b4709
...
...
@@ -8,11 +8,12 @@
#ifndef DIAGNOSTIC_HPP
#define DIAGNOSTIC_HPP
static
QString
gateway_ip
;
class
Diagnostic
{
typedef
QString
(
Diagnostic
::
*
diagFn_t
)();
typedef
QString
(
*
diagFn_t
)();
public:
QString
gateway_ip
;
static
const
int
funcsLen
=
3
;
diagFn_t
funcs
[
funcsLen
];
...
...
@@ -22,7 +23,7 @@ public:
funcs
[
2
]
=
getInterfaceInfo
;
}
QString
getRoutingInfo
(){
static
QString
getRoutingInfo
(){
FILE
*
cmdHandle
;
QString
ipAddr
(
"- - - Default Gateway - - -
\n
"
);
#if defined( Q_OS_WIN )
...
...
@@ -55,7 +56,7 @@ public:
return
ipAddr
.
append
(
"
\n
"
);
}
QString
getInterfaceInfo
(){
static
QString
getInterfaceInfo
(){
QList
<
QNetworkInterface
>
ifList
=
QNetworkInterface
::
allInterfaces
();
QStringList
out
;
QString
tab
(
" "
);
...
...
@@ -86,7 +87,7 @@ public:
return
QString
(
out
.
join
(
' '
));
}
QString
getPingGateway
(){
static
QString
getPingGateway
(){
QString
ping_stat
(
"- - - Pinging Default Gateway - - -
\n
"
);
if
(
gateway_ip
.
isEmpty
()
==
false
){
...
...
@@ -94,6 +95,9 @@ public:
cmdHandle
=
popen
(
#if defined( Q_OS_WIN )
QString
(
"ping -n 4 -w 1 %1"
).
arg
(
gateway_ip
).
toStdString
().
c_str
(),
"r"
#elif defined ( Q_OS_LINUX )
QString
(
"ping -c 4 -W 1 %1"
).
arg
(
gateway_ip
).
toStdString
().
c_str
(),
"r"
#else
#error "We do not support ping for this OS."
#endif
...
...
This diff is collapsed.
Click to expand it.
include/NetCheckerWindow.cpp
+
1
−
1
View file @
702b4709
...
...
@@ -195,7 +195,7 @@ void NetCheckerWindow::nextPage(){
global_w
->
setCurrentIndex
(
1
);
double
step
=
100.0
/
Diagnostic
::
funcsLen
;
for
(
int
i
=
0
;
i
<
Diagnostic
::
funcsLen
;
i
++
){
log_w
->
append
((
d
.
*
d
.
Diagnostic
::
funcs
[
i
])());
log_w
->
append
((
d
.
funcs
[
i
])());
progressbar_w
->
setValue
(
static_cast
<
int
>
(
ceil
(
step
*
(
i
+
1
))));
/*QMessageBox msg;
msg.setText(QString("[%1]").arg(d.gateway_ip));
...
...
This diff is collapsed.
Click to expand it.
netchecker.pro.user
+
49
−
53
View file @
702b4709
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment