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
b11fd1d6
Commit
b11fd1d6
authored
Dec 08, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default qtlogging.ini file is copied if it doesn't exist
parent
fa69b34c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
qtlogging.ini
files/QLoggingCategory/qtlogging.ini
+0
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+3
-0
QGCApplication.cc
src/QGCApplication.cc
+30
-0
No files found.
qtlogging.ini
→
files/QLoggingCategory/
qtlogging.ini
View file @
b11fd1d6
File moved
qgroundcontrol.qrc
View file @
b11fd1d6
...
...
@@ -231,4 +231,7 @@
<qresource prefix="/unittest">
<file alias="MockLink.param">src/qgcunittest/MockLink.param</file>
</qresource>
<qresource prefix="/QLoggingCategory">
<file alias="qtlogging.ini">files/QLoggingCategory/qtlogging.ini</file>
</qresource>
</RCC>
src/QGCApplication.cc
View file @
b11fd1d6
...
...
@@ -92,6 +92,36 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) :
Q_ASSERT
(
_app
==
NULL
);
_app
=
this
;
#ifdef QT_DEBUG
// First thing we want to do is set up the qtlogging.ini file. If it doesn't already exist we copy
// it to the correct location. This way default debug builds will have logging turned off.
bool
loggingDirectoryOk
=
false
;
QDir
iniFileLocation
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericConfigLocation
));
if
(
!
iniFileLocation
.
cd
(
"QtProjects"
))
{
if
(
!
iniFileLocation
.
mkdir
(
"QtProjects"
))
{
qDebug
()
<<
"Unable to create qtlogging.ini directory"
<<
iniFileLocation
.
filePath
(
"QtProjects"
);
}
else
{
if
(
!
iniFileLocation
.
cd
(
"QtProjects"
))
{
qDebug
()
<<
"Unable to access qtlogging.ini directory"
<<
iniFileLocation
.
filePath
(
"QtProjects"
);;
}
loggingDirectoryOk
=
true
;
}
}
else
{
loggingDirectoryOk
=
true
;
}
if
(
loggingDirectoryOk
)
{
qDebug
()
<<
iniFileLocation
;
if
(
!
iniFileLocation
.
exists
(
"qtlogging.ini"
))
{
if
(
!
QFile
::
copy
(
":QLoggingCategory/qtlogging.ini"
,
iniFileLocation
.
filePath
(
"qtlogging.ini"
)))
{
qDebug
()
<<
"Unable to copy qtlogging.ini to"
<<
iniFileLocation
;
}
}
}
#endif
// Set application information
if
(
_runningUnitTests
)
{
// We don't want unit tests to use the same QSettings space as the normal app. So we tweak the app
...
...
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