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
8d8d9b7e
Commit
8d8d9b7e
authored
Oct 10, 2024
by
郭峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-1007488' into 'release'
Feature 1007488 See merge request
!36
parents
6654fa06
c3dd3878
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
VidesData.h
+7
-3
No files found.
VidesData.h
View file @
8d8d9b7e
...
@@ -453,7 +453,7 @@ inline bool GetNetworkInfoByQNetworkInterface(QString &mac, QString &subnetMask,
...
@@ -453,7 +453,7 @@ inline bool GetNetworkInfoByQNetworkInterface(QString &mac, QString &subnetMask,
// 获取网关地址
// 获取网关地址
QProcess
process
;
QProcess
process
;
process
.
start
(
"
ip"
,
QStringList
()
<<
"route"
);
process
.
start
(
"
sudo"
,
QStringList
()
<<
"/sbin/ip"
<<
"route"
);
if
(
!
process
.
waitForStarted
())
{
if
(
!
process
.
waitForStarted
())
{
qInfo
()
<<
"Failed to start 'ip route' process."
;
qInfo
()
<<
"Failed to start 'ip route' process."
;
continue
;
continue
;
...
@@ -487,11 +487,13 @@ inline bool pingAddress(const QString &address) {
...
@@ -487,11 +487,13 @@ inline bool pingAddress(const QString &address) {
QProcess
process
;
QProcess
process
;
QString
program
=
"ping"
;
QString
program
=
"ping"
;
QStringList
arguments
;
QStringList
arguments
;
#ifdef Q_OS_WIN
#ifdef Q_OS_WIN
// Windows下通常不需要sudo
arguments
<<
"-n"
<<
"1"
<<
address
;
arguments
<<
"-n"
<<
"1"
<<
address
;
#else
#else
arguments
<<
"-c"
<<
"1"
<<
address
;
// 使用sudo
program
=
"sudo"
;
arguments
<<
"ping"
<<
"-c"
<<
"1"
<<
address
;
#endif
#endif
process
.
start
(
program
,
arguments
);
process
.
start
(
program
,
arguments
);
...
@@ -514,6 +516,8 @@ inline bool pingAddress(const QString &address) {
...
@@ -514,6 +516,8 @@ inline bool pingAddress(const QString &address) {
return
output
.
contains
(
"1 packets transmitted, 1 received"
);
return
output
.
contains
(
"1 packets transmitted, 1 received"
);
#endif
#endif
}
}
inline
QString
findReachableIp
()
{
inline
QString
findReachableIp
()
{
QList
<
QHostAddress
>
ipAddressesList
=
QNetworkInterface
::
allAddresses
();
QList
<
QHostAddress
>
ipAddressesList
=
QNetworkInterface
::
allAddresses
();
for
(
const
QHostAddress
&
address
:
ipAddressesList
)
{
for
(
const
QHostAddress
&
address
:
ipAddressesList
)
{
...
...
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