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
6298f047
Unverified
Commit
6298f047
authored
May 31, 2020
by
Don Gagne
Committed by
GitHub
May 31, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8801 from DonLakeFlyer/CherryPickiOS
Tweaks to iOS storage location to support display in Files app
parents
c83f788d
22624461
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
36 deletions
+36
-36
ChangeLog.md
ChangeLog.md
+5
-1
iOS-Info.plist
ios/iOS-Info.plist
+2
-1
AppSettings.cc
src/Settings/AppSettings.cc
+13
-9
QGCCorePlugin.cc
src/api/QGCCorePlugin.cc
+16
-25
No files found.
ChangeLog.md
View file @
6298f047
...
...
@@ -13,7 +13,11 @@ Note: This file only contains high level features or important fixes.
## 4.0
## 4.0.7 - Not yet released
## 4.0.8 - Not yet released
*
iOS: Modify QGC file storage location to support new Files app
## 4.0.7 - Stable
*
Fix video page sizing
*
Virtual Joystick: Fix right stick centering. Fix/add support for rover/sub reverse throttle support.
...
...
ios/iOS-Info.plist
View file @
6298f047
...
...
@@ -86,5 +86,6 @@
</dict>
<key>
UIFileSharingEnabled
</key>
<true/>
</dict>
<key>
LSSupportsOpeningDocumentsInPlace
</key>
<true/></dict>
</plist>
src/Settings/AppSettings.cc
View file @
6298f047
...
...
@@ -53,23 +53,27 @@ DECLARE_SETTINGGROUP(App, "")
SettingsFact
*
savePathFact
=
qobject_cast
<
SettingsFact
*>
(
savePath
());
QString
appName
=
qgcApp
()
->
applicationName
();
#ifdef __mobile__
// Mobile builds always use the runtime generated location for savePath. The reason is that for example on iOS the save path includes
// a UID for the app in it. When you then update the app that UID could change which in turn makes any saved value invalid.
if
(
true
)
{
// Mobile builds always use the runtime generated location for savePath.
bool
userHasModifiedSavePath
=
false
;
#else
if
(
savePathFact
->
rawValue
().
toString
().
isEmpty
()
&&
_nameToMetaDataMap
[
savePathName
]
->
rawDefaultValue
().
toString
().
isEmpty
())
{
bool
userHasModifiedSavePath
=
!
savePathFact
->
rawValue
().
toString
().
isEmpty
()
||
!
_nameToMetaDataMap
[
savePathName
]
->
rawDefaultValue
().
toString
().
isEmpty
();
#endif
if
(
!
userHasModifiedSavePath
)
{
#ifdef __mobile__
#ifdef __ios__
QDir
rootDir
=
QDir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppDataLocation
));
#else
#ifdef __ios__
// This will expose the directories directly to the File iOs app
QDir
rootDir
=
QDir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DocumentsLocation
));
savePathFact
->
setRawValue
(
rootDir
.
absolutePath
());
#else
QDir
rootDir
=
QDir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericDataLocation
));
#endif
savePathFact
->
setRawValue
(
rootDir
.
filePath
(
appName
));
#endif
savePathFact
->
setVisible
(
false
);
#else
QDir
rootDir
=
QDir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DocumentsLocation
));
#endif
savePathFact
->
setRawValue
(
rootDir
.
filePath
(
appName
));
#endif
}
connect
(
savePathFact
,
&
Fact
::
rawValueChanged
,
this
,
&
AppSettings
::
savePathsChanged
);
...
...
src/api/QGCCorePlugin.cc
View file @
6298f047
...
...
@@ -339,8 +339,7 @@ bool QGCCorePlugin::overrideSettingsGroupVisibility(QString name)
bool
QGCCorePlugin
::
adjustSettingMetaData
(
const
QString
&
settingsGroup
,
FactMetaData
&
metaData
)
{
if
(
settingsGroup
!=
AppSettings
::
settingsGroup
)
{
// All changes refer to AppSettings
if
(
settingsGroup
==
AppSettings
::
settingsGroup
)
{
#if !defined(QGC_ENABLE_PAIRING)
//-- If we don't support pairing, disable it.
if
(
metaData
.
name
()
==
AppSettings
::
usePairingName
)
{
...
...
@@ -349,36 +348,28 @@ bool QGCCorePlugin::adjustSettingMetaData(const QString& settingsGroup, FactMeta
return
false
;
}
#endif
return
true
;
}
//-- Default Palette
if
(
metaData
.
name
()
==
AppSettings
::
indoorPaletteName
)
{
QVariant
outdoorPalette
;
//-- Default Palette
if
(
metaData
.
name
()
==
AppSettings
::
indoorPaletteName
)
{
QVariant
outdoorPalette
;
#if defined (__mobile__)
outdoorPalette
=
0
;
outdoorPalette
=
0
;
#else
outdoorPalette
=
1
;
outdoorPalette
=
1
;
#endif
metaData
.
setRawDefaultValue
(
outdoorPalette
);
return
true
;
//-- Auto Save Telemetry Logs
}
else
if
(
metaData
.
name
()
==
AppSettings
::
telemetrySaveName
)
{
metaData
.
setRawDefaultValue
(
outdoorPalette
);
return
true
;
}
#if defined (__mobile__)
metaData
.
setRawDefaultValue
(
false
);
return
true
;
#else
metaData
.
setRawDefaultValue
(
true
);
return
true
;
#endif
#if defined(__ios__)
}
else
if
(
metaData
.
name
()
==
AppSettings
::
savePathName
)
{
QString
appName
=
qgcApp
()
->
applicationName
();
QDir
rootDir
=
QDir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DocumentsLocation
));
metaData
.
setRawDefaultValue
(
rootDir
.
filePath
(
appName
));
return
false
;
if
(
metaData
.
name
()
==
AppSettings
::
telemetrySaveName
)
{
// Mobile devices have limited storage so don't turn on telemtry saving by default
metaData
.
setRawDefaultValue
(
false
);
return
true
;
}
#endif
}
return
true
;
// Show setting in ui
}
...
...
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