Skip to content

Commit

Permalink
tray-monitor: refactor usage message
Browse files Browse the repository at this point in the history
This used snprintf and then asprintf. The patch now uses arg() as Qt
recommends for formatting QString.
  • Loading branch information
arogge committed Nov 13, 2019
1 parent 3f33d70 commit 038e682
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/src/qt-tray-monitor/tray-monitor.cc
Expand Up @@ -46,8 +46,8 @@ static void usage()
{
char copyright[500];
kBareosVersion.formatCopyright(copyright, 500, 2004);
QString out = QString::asprintf(
_("%s"
QString out = QString(
_("%1"
"Usage: tray-monitor [options]\n"
" -c <path> use <path> as configuration file or directory\n"
" -d <nn> set debug level to <nn>\n"
Expand All @@ -58,8 +58,7 @@ static void usage()
" -xs print configuration file schema in JSON format "
"and exit\n"
" -? print this message.\n"
"\n"),
copyright);
"\n")).arg(copyright);

#if HAVE_WIN32
QMessageBox::information(0, "Help", out);
Expand Down

0 comments on commit 038e682

Please sign in to comment.