Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gamera_videos_no_ui
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liusq
gamera_videos_no_ui
Commits
5603d29d
Commit
5603d29d
authored
Oct 10, 2024
by
“liusq”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改ping命令
parent
f5f5f61d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
VidesData.h
+7
-6
No files found.
VidesData.h
View file @
5603d29d
...
@@ -488,20 +488,21 @@ inline bool pingAddress(const QString &address) {
...
@@ -488,20 +488,21 @@ inline bool pingAddress(const QString &address) {
#ifdef Q_OS_WIN
#ifdef Q_OS_WIN
// Windows 指令 "ping IP -n 1 -w 超时(ms)"
// Windows 指令 "ping IP -n 1 -w 超时(ms)"
QString
cmdstr
=
QString
(
"ping %1 -n 1 -w %2"
)
QString
List
arguments
;
.
arg
(
address
).
arg
(
1000
)
;
arguments
<<
"-c"
<<
"ping "
+
address
+
" -n 1 -w 1000"
;
#else
#else
// Linux 指令 "ping -c 1 IP"
// Linux 指令 "ping -c 1 IP"
QString
cmdstr
=
QString
(
"ping -c 1 %1"
)
QString
List
arguments
;
.
arg
(
address
)
;
arguments
<<
"-c"
<<
"ping -c 1 "
+
address
;
#endif
#endif
// 启动进程
// 启动进程
cmd
.
start
(
cmdstr
);
cmd
.
start
(
"bash"
,
arguments
);
// 等待进程准备好读取
// 等待进程准备好读取
if
(
!
cmd
.
waitForStarted
())
{
if
(
!
cmd
.
waitForStarted
())
{
qWarning
()
<<
"Failed to start 'ping' process for"
<<
address
;
qWarning
()
<<
"无法启动的‘ping’进程"
<<
address
;
qWarning
()
<<
"命令: "
<<
arguments
.
join
(
" "
);
return
false
;
return
false
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment