Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
lifo
Nicolas Ollinger
OpenBoard
Commits
2484e96b
Commit
2484e96b
authored
Nov 05, 2015
by
Craig Watson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes to message handler function; removal of obsolete setCodecForTr functions
parent
4a99febb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
17 deletions
+7
-17
main.cpp
src/core/main.cpp
+7
-17
No files found.
src/core/main.cpp
View file @
2484e96b
...
...
@@ -45,21 +45,21 @@
#endif
*/
void
ub_message_output
(
QtMsgType
type
,
const
char
*
msg
)
{
void
ub_message_output
(
QtMsgType
type
,
const
QMessageLogContext
&
context
,
const
QString
&
msg
)
{
// We must temporarily remove the handler to avoid the infinite recursion of
// ub_message_output -> qt_message_output -> ub_message_output -> qt_message_output ...
QtM
sgHandler
previousHandler
=
qInstallMsg
Handler
(
0
);
QtM
essageHandler
previousHandler
=
qInstallMessage
Handler
(
0
);
#if defined(QT_NO_DEBUG)
// Suppress qDebug output in release builds
if
(
type
!=
QtDebugMsg
)
{
qt_message_output
(
type
,
msg
);
qt_message_output
(
type
,
context
,
msg
);
}
#else
// Default output in debug builds
qt_message_output
(
type
,
msg
);
qt_message_output
(
type
,
context
,
msg
);
#endif
if
(
UBApplication
::
app
()
&&
UBApplication
::
app
()
->
isVerbose
())
{
...
...
@@ -77,7 +77,7 @@ void ub_message_output(QtMsgType type, const char *msg) {
}
}
qInstallM
sg
Handler
(
previousHandler
);
qInstallM
essage
Handler
(
previousHandler
);
}
int
main
(
int
argc
,
char
*
argv
[])
...
...
@@ -93,7 +93,7 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE
(
OpenBoard
);
qInstallM
sg
Handler
(
ub_message_output
);
qInstallM
essage
Handler
(
ub_message_output
);
#if defined(Q_WS_X11)
qDebug
()
<<
"Setting GraphicsSystem to raster"
;
...
...
@@ -102,16 +102,6 @@ int main(int argc, char *argv[])
UBApplication
app
(
"OpenBoard"
,
argc
,
argv
);
//BUGFIX:
//when importing a OpenBoard file that contains a non standard character
//the codecForLocale or the codecForCString is used to convert the file path
//into a const char*. This is why in french windows setup the codec name shouldn't be
//set to UTF-8. For example, setting UTF-8, will convert "Haïti" into "HaÂ-ti.
QTextCodec
::
setCodecForTr
(
QTextCodec
::
codecForName
(
"UTF-8"
));
//QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
QTextCodec
::
setCodecForCStrings
(
QTextCodec
::
codecForName
(
"UTF-8"
));
QStringList
args
=
app
.
arguments
();
QString
dumpPath
=
UBSettings
::
userDataDirectory
()
+
"/log"
;
...
...
@@ -138,7 +128,7 @@ int main(int argc, char *argv[])
}
}
app
.
initialize
(
false
);
//app.initialize(false); // should not be needed anymore
QObject
::
connect
(
&
app
,
SIGNAL
(
messageReceived
(
const
QString
&
)),
&
app
,
SLOT
(
handleOpenMessage
(
const
QString
&
)));
...
...
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