Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
b3a849cf
Commit
b3a849cf
authored
Apr 06, 2018
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add crash logs directory to AppSettings
parent
189dc1cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
37 deletions
+43
-37
AppSettings.cc
src/Settings/AppSettings.cc
+40
-37
AppSettings.h
src/Settings/AppSettings.h
+3
-0
No files found.
src/Settings/AppSettings.cc
View file @
b3a849cf
...
...
@@ -53,30 +53,31 @@ const char* AppSettings::telemetryDirectory = "Telemetry";
const
char
*
AppSettings
::
missionDirectory
=
"Missions"
;
const
char
*
AppSettings
::
logDirectory
=
"Logs"
;
const
char
*
AppSettings
::
videoDirectory
=
"Video"
;
const
char
*
AppSettings
::
crashDirectory
=
"CrashLogs"
;
AppSettings
::
AppSettings
(
QObject
*
parent
)
:
SettingsGroup
(
appSettingsGroupName
,
QString
()
/* root settings group */
,
parent
)
,
_offlineEditingFirmwareTypeFact
(
NULL
)
,
_offlineEditingVehicleTypeFact
(
NULL
)
,
_offlineEditingCruiseSpeedFact
(
NULL
)
,
_offlineEditingHoverSpeedFact
(
NULL
)
,
_offlineEditingAscentSpeedFact
(
NULL
)
,
_offlineEditingDescentSpeedFact
(
NULL
)
,
_batteryPercentRemainingAnnounceFact
(
NULL
)
,
_defaultMissionItemAltitudeFact
(
NULL
)
,
_telemetrySaveFact
(
NULL
)
,
_telemetrySaveNotArmedFact
(
NULL
)
,
_audioMutedFact
(
NULL
)
,
_virtualJoystickFact
(
NULL
)
,
_appFontPointSizeFact
(
NULL
)
,
_indoorPaletteFact
(
NULL
)
,
_showLargeCompassFact
(
NULL
)
,
_savePathFact
(
NULL
)
,
_autoLoadMissionsFact
(
NULL
)
,
_mapboxTokenFact
(
NULL
)
,
_esriTokenFact
(
NULL
)
,
_defaultFirmwareTypeFact
(
NULL
)
,
_gstDebugFact
(
NULL
)
:
SettingsGroup
(
appSettingsGroupName
,
QString
()
/* root settings group */
,
parent
)
,
_offlineEditingFirmwareTypeFact
(
NULL
)
,
_offlineEditingVehicleTypeFact
(
NULL
)
,
_offlineEditingCruiseSpeedFact
(
NULL
)
,
_offlineEditingHoverSpeedFact
(
NULL
)
,
_offlineEditingAscentSpeedFact
(
NULL
)
,
_offlineEditingDescentSpeedFact
(
NULL
)
,
_batteryPercentRemainingAnnounceFact
(
NULL
)
,
_defaultMissionItemAltitudeFact
(
NULL
)
,
_telemetrySaveFact
(
NULL
)
,
_telemetrySaveNotArmedFact
(
NULL
)
,
_audioMutedFact
(
NULL
)
,
_virtualJoystickFact
(
NULL
)
,
_appFontPointSizeFact
(
NULL
)
,
_indoorPaletteFact
(
NULL
)
,
_showLargeCompassFact
(
NULL
)
,
_savePathFact
(
NULL
)
,
_autoLoadMissionsFact
(
NULL
)
,
_mapboxTokenFact
(
NULL
)
,
_esriTokenFact
(
NULL
)
,
_defaultFirmwareTypeFact
(
NULL
)
,
_gstDebugFact
(
NULL
)
{
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
AppSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"AppSettings"
,
"Reference only"
);
...
...
@@ -118,6 +119,7 @@ void AppSettings::_checkSavePathDirectories(void)
savePathDir
.
mkdir
(
missionDirectory
);
savePathDir
.
mkdir
(
logDirectory
);
savePathDir
.
mkdir
(
videoDirectory
);
savePathDir
.
mkdir
(
crashDirectory
);
}
}
...
...
@@ -279,67 +281,68 @@ Fact* AppSettings::savePath(void)
QString
AppSettings
::
missionSavePath
(
void
)
{
QString
fullPath
;
QString
path
=
savePath
()
->
rawValue
().
toString
();
if
(
!
path
.
isEmpty
()
&&
QDir
(
path
).
exists
())
{
QDir
dir
(
path
);
return
dir
.
filePath
(
missionDirectory
);
}
return
fullPath
;
return
QString
()
;
}
QString
AppSettings
::
parameterSavePath
(
void
)
{
QString
fullPath
;
QString
path
=
savePath
()
->
rawValue
().
toString
();
if
(
!
path
.
isEmpty
()
&&
QDir
(
path
).
exists
())
{
QDir
dir
(
path
);
return
dir
.
filePath
(
parameterDirectory
);
}
return
fullPath
;
return
QString
()
;
}
QString
AppSettings
::
telemetrySavePath
(
void
)
{
QString
fullPath
;
QString
path
=
savePath
()
->
rawValue
().
toString
();
if
(
!
path
.
isEmpty
()
&&
QDir
(
path
).
exists
())
{
QDir
dir
(
path
);
return
dir
.
filePath
(
telemetryDirectory
);
}
return
fullPath
;
return
QString
()
;
}
QString
AppSettings
::
logSavePath
(
void
)
{
QString
fullPath
;
QString
path
=
savePath
()
->
rawValue
().
toString
();
if
(
!
path
.
isEmpty
()
&&
QDir
(
path
).
exists
())
{
QDir
dir
(
path
);
return
dir
.
filePath
(
logDirectory
);
}
return
fullPath
;
return
QString
()
;
}
QString
AppSettings
::
videoSavePath
(
void
)
{
QString
fullPath
;
QString
path
=
savePath
()
->
rawValue
().
toString
();
if
(
!
path
.
isEmpty
()
&&
QDir
(
path
).
exists
())
{
QDir
dir
(
path
);
return
dir
.
filePath
(
videoDirectory
);
}
return
fullPath
;
return
QString
();
}
QString
AppSettings
::
crashSavePath
(
void
)
{
QString
path
=
savePath
()
->
rawValue
().
toString
();
if
(
!
path
.
isEmpty
()
&&
QDir
(
path
).
exists
())
{
QDir
dir
(
path
);
return
dir
.
filePath
(
crashDirectory
);
}
return
QString
();
}
Fact
*
AppSettings
::
autoLoadMissions
(
void
)
...
...
src/Settings/AppSettings.h
View file @
b3a849cf
...
...
@@ -47,6 +47,7 @@ public:
Q_PROPERTY
(
QString
telemetrySavePath
READ
telemetrySavePath
NOTIFY
savePathsChanged
)
Q_PROPERTY
(
QString
logSavePath
READ
logSavePath
NOTIFY
savePathsChanged
)
Q_PROPERTY
(
QString
videoSavePath
READ
videoSavePath
NOTIFY
savePathsChanged
)
Q_PROPERTY
(
QString
crashSavePath
READ
crashSavePath
NOTIFY
savePathsChanged
)
Q_PROPERTY
(
QString
planFileExtension
MEMBER
planFileExtension
CONSTANT
)
Q_PROPERTY
(
QString
missionFileExtension
MEMBER
missionFileExtension
CONSTANT
)
...
...
@@ -83,6 +84,7 @@ public:
QString
telemetrySavePath
(
void
);
QString
logSavePath
(
void
);
QString
videoSavePath
(
void
);
QString
crashSavePath
(
void
);
static
MAV_AUTOPILOT
offlineEditingFirmwareTypeFromFirmwareType
(
MAV_AUTOPILOT
firmwareType
);
static
MAV_TYPE
offlineEditingVehicleTypeFromVehicleType
(
MAV_TYPE
vehicleType
);
...
...
@@ -128,6 +130,7 @@ public:
static
const
char
*
missionDirectory
;
static
const
char
*
logDirectory
;
static
const
char
*
videoDirectory
;
static
const
char
*
crashDirectory
;
signals:
void
savePathsChanged
(
void
);
...
...
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