"QString::arg: Argument missing" log message

Hi,

when I start MKVToolNix using a docker build, I get the following log message:

QString::arg: Argument missing: <p>This template will be used for new chapter entries. The string '&lt;NUM&gt;' will be replaced by the chapter number. The string '&lt;START&
gt;' will be replaced by the chapter's start timestamp. The strings '&lt;FILE_NAME&gt;' and '&lt;FILE_NAME_WITH_EXT&gt;', which only work when generating chapters for appended files, will be replaced
by the appended file's name (the former leaves the extension out while the latter includes it).</p><p>The string '&lt;TITLE&gt;', which only work when generating chapters for appended files, will be r
eplaced by the appended file's title if one is set. You can specify a minimum number of places for the chapter number with '&lt;NUM:places&gt;', e.g. '&lt;NUM:3&gt;'.</p><p>The resulting number will b
e padded with leading zeroes if the number of places is less than specified. You can control the format used by the start timestamp with &lt;START:format&gt;. The format defaults to %H:%M:%S if none i
s given.</p><ul><li>Valid format codes are:</li><li>%h – hours</li><li>%H – hours zero-padded to two places</li><li>%m – minutes</li><li>%M – minutes zero-padded to two places</li><li>%s – seconds</li
><li>%S – seconds zero-padded to two places</li><li>%n – nanoseconds with nine places</li></ul>, %&lt;1-9&gt;n – nanoseconds with up to nine places (e.g. three places with %3n)

Looking at the source code I suspect the reason is in the following part of tool.cpp:

QString
Tool::chapterNameTemplateToolTip() {
  return Q("<p>%1 %2 %3 %4</p><p>%5 %6</p><p>%7 %8 %9</p><ul><li>%10</li><li>%11</li><li>%12</li><li>%13</li><li>%14</li><li>%15</li><li>%16</li><li>%17</li></ul>")
    .arg(QYH("This template will be used for new chapter entries."))
    .arg(QYH("The string '<NUM>' will be replaced by the chapter number."))
    .arg(QYH("The string '<START>' will be replaced by the chapter's start timestamp."))
    .arg(QYH("The strings '<FILE_NAME>' and '<FILE_NAME_WITH_EXT>', which only work when generating chapters for appended files, will be replaced by the appended file's name "
             "(the former leaves the extension out while the latter includes it)."))

    .arg(QYH("You can specify a minimum number of places for the chapter number with '<NUM:places>', e.g. '<NUM:3>'."))
    .arg(QYH("The resulting number will be padded with leading zeroes if the number of places is less than specified."))

    .arg(QYH("You can control the format used by the start timestamp with <START:format>."))
    .arg(QYH("The format defaults to %H:%M:%S if none is given."))
    .arg(QYH("Valid format codes are:"))

    .arg(QYH("%h – hours"))
    .arg(QYH("%H – hours zero-padded to two places"))
    .arg(QYH("%m – minutes"))
    .arg(QYH("%M – minutes zero-padded to two places"))
    .arg(QYH("%s – seconds"))
    .arg(QYH("%S – seconds zero-padded to two places"))
    .arg(QYH("%n – nanoseconds with nine places"))
    .arg(QYH("%<1-9>n – nanoseconds with up to nine places (e.g. three places with %3n)"))
  + Q("<p>%1</p>")
    .arg(QYH("If nothing is entered, chapters will be generated but no name will be set."));
}

Where the line “arg(QYH(“%<1-9>n – nanoseconds with up to nine places (e.g. three places with %3n)”))“ contains the string “%3” which may be the cause for this log message. But I’m not sure as I have no experience with Qt.

Apart from the message logged, everything works as expected (so, no bug).

Very good catch, thanks.

The actual cause of the error message was that there were only 17 placeholders (up to & including %17) but 18 calls to .arg(). That’s been fixed in 481f712.

What you were suspicious about, the %3n in the last .arg() call, could be a problem, too, though. I’ve therefore implemented a workaround for it in 8661b9c.

Can you please file such things as issues in the future? I happened to read this shortly after you posted, and I happened to have the time to deal with it right then, but in general I tend to overlook issue-like stuff that isn’t posted on Codeberg. Thanks.

Of course, I will do so in the future. I just have no account there yet. Thank you very much.