Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
1903e1f8
Commit
1903e1f8
authored
Dec 08, 2014
by
Don Gagne
Browse files
Fix incorrect directory
parent
10d9e376
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/QGCApplication.cc
View file @
1903e1f8
...
...
@@ -97,14 +97,17 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) :
// 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.
static
const
char
*
qtProjectDir
=
"QtProject"
;
static
const
char
*
qtLoggingFile
=
"qtlogging.ini"
;
bool
loggingDirectoryOk
=
false
;
QDir
iniFileLocation
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericConfigLocation
));
if
(
!
iniFileLocation
.
cd
(
"Q
tProject
s"
))
{
if
(
!
iniFileLocation
.
mkdir
(
"Q
tProject
s"
))
{
qDebug
()
<<
"Unable to create qtlogging.ini directory"
<<
iniFileLocation
.
filePath
(
"Q
tProject
s"
);
if
(
!
iniFileLocation
.
cd
(
q
tProject
Dir
))
{
if
(
!
iniFileLocation
.
mkdir
(
q
tProject
Dir
))
{
qDebug
()
<<
"Unable to create qtlogging.ini directory"
<<
iniFileLocation
.
filePath
(
q
tProject
Dir
);
}
else
{
if
(
!
iniFileLocation
.
cd
(
"Q
tProject
s"
))
{
qDebug
()
<<
"Unable to access qtlogging.ini directory"
<<
iniFileLocation
.
filePath
(
"Q
tProject
s"
);;
if
(
!
iniFileLocation
.
cd
(
q
tProject
Dir
))
{
qDebug
()
<<
"Unable to access qtlogging.ini directory"
<<
iniFileLocation
.
filePath
(
q
tProject
Dir
);;
}
loggingDirectoryOk
=
true
;
}
...
...
@@ -114,9 +117,9 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) :
if
(
loggingDirectoryOk
)
{
qDebug
()
<<
iniFileLocation
;
if
(
!
iniFileLocation
.
exists
(
"
qt
l
ogging
.ini"
))
{
if
(
!
QFile
::
copy
(
":QLoggingCategory/qtlogging.ini"
,
iniFileLocation
.
filePath
(
"
qt
l
ogging
.ini"
)))
{
qDebug
()
<<
"Unable to copy
qt
l
ogging
.ini
to"
<<
iniFileLocation
;
if
(
!
iniFileLocation
.
exists
(
qt
L
ogging
File
))
{
if
(
!
QFile
::
copy
(
":QLoggingCategory/qtlogging.ini"
,
iniFileLocation
.
filePath
(
qt
L
ogging
File
)))
{
qDebug
()
<<
"Unable to copy
"
<<
QString
(
qt
L
ogging
File
)
<<
"
to"
<<
iniFileLocation
;
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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