Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
bab340f7
Commit
bab340f7
authored
Jun 24, 2014
by
Fabio Bas
Browse files
Reworked a bit message handling from previous commit
parent
2953c6ba
Changes
1
Show whitespace changes
Inline
Side-by-side
servatrice/src/main.cpp
View file @
bab340f7
...
@@ -82,6 +82,7 @@ void testHash()
...
@@ -82,6 +82,7 @@ void testHash()
std
::
cerr
<<
startTime
.
secsTo
(
endTime
)
<<
"secs"
<<
std
::
endl
;
std
::
cerr
<<
startTime
.
secsTo
(
endTime
)
<<
"secs"
<<
std
::
endl
;
}
}
#if QT_VERSION < 0x050000
void
myMessageOutput
(
QtMsgType
/*type*/
,
const
char
*
msg
)
void
myMessageOutput
(
QtMsgType
/*type*/
,
const
char
*
msg
)
{
{
logger
->
logMessage
(
msg
);
logger
->
logMessage
(
msg
);
...
@@ -92,17 +93,18 @@ void myMessageOutput2(QtMsgType /*type*/, const char *msg)
...
@@ -92,17 +93,18 @@ void myMessageOutput2(QtMsgType /*type*/, const char *msg)
logger
->
logMessage
(
msg
);
logger
->
logMessage
(
msg
);
std
::
cerr
<<
msg
<<
std
::
endl
;
std
::
cerr
<<
msg
<<
std
::
endl
;
}
}
#else
void
myMessageOutput
Qt5
(
QtMsgType
/*type*/
,
const
QMessageLogContext
&
,
const
QString
&
msg
)
void
myMessageOutput
(
QtMsgType
/*type*/
,
const
QMessageLogContext
&
,
const
QString
&
msg
)
{
{
logger
->
logMessage
(
msg
);
logger
->
logMessage
(
msg
);
}
}
void
myMessageOutput2
Qt5
(
QtMsgType
/*type*/
,
const
QMessageLogContext
&
,
const
QString
&
msg
)
void
myMessageOutput2
(
QtMsgType
/*type*/
,
const
QMessageLogContext
&
,
const
QString
&
msg
)
{
{
logger
->
logMessage
(
msg
);
logger
->
logMessage
(
msg
);
std
::
cerr
<<
msg
.
toStdString
()
<<
std
::
endl
;
std
::
cerr
<<
msg
.
toStdString
()
<<
std
::
endl
;
}
}
#endif
#ifdef Q_OS_UNIX
#ifdef Q_OS_UNIX
void
sigSegvHandler
(
int
sig
)
void
sigSegvHandler
(
int
sig
)
...
@@ -155,9 +157,9 @@ int main(int argc, char *argv[])
...
@@ -155,9 +157,9 @@ int main(int argc, char *argv[])
qInstallMsgHandler
(
myMessageOutput2
);
qInstallMsgHandler
(
myMessageOutput2
);
#else
#else
if
(
logToConsole
)
if
(
logToConsole
)
qInstallMessageHandler
(
myMessageOutput
Qt5
);
qInstallMessageHandler
(
myMessageOutput
);
else
else
qInstallMessageHandler
(
myMessageOutput2
Qt5
);
qInstallMessageHandler
(
myMessageOutput2
);
#endif
#endif
#ifdef Q_OS_UNIX
#ifdef Q_OS_UNIX
...
@@ -199,7 +201,7 @@ int main(int argc, char *argv[])
...
@@ -199,7 +201,7 @@ int main(int argc, char *argv[])
#if QT_VERSION < 0x050000
#if QT_VERSION < 0x050000
qInstallMsgHandler
(
myMessageOutput
);
qInstallMsgHandler
(
myMessageOutput
);
#else
#else
qInstallMessageHandler
(
myMessageOutput
Qt5
);
qInstallMessageHandler
(
myMessageOutput
);
#endif
#endif
retval
=
app
.
exec
();
retval
=
app
.
exec
();
...
...
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