bool showHelp = false;
bool showVersion = false;
bool checkLinks = false;
+ bool silent = false;
// don't require a window manager even though we're a QGuiApplication
qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("minimal"));
showHelp = true;
} else if (arg == QLatin1String("-c")) {
checkLinks = true;
+ } else if (arg == QLatin1String("-s")) {
+ silent = true;
} else {
QFileInfo fi(arg);
projectFile = fi.absoluteFilePath();
" a default name will be used.\n"
" -c Checks whether all links in HTML files\n"
" point to files in this help project.\n"
+ " -s Suppresses status messages.\n"
" -v Displays the version of \n"
" qhelpgenerator.\n\n");
return -1;
}
- HelpGenerator generator;
+ HelpGenerator generator(silent);
bool success = true;
if (checkLinks)
success = generator.checkLinks(*helpData);
QT_BEGIN_NAMESPACE
-HelpGenerator::HelpGenerator()
+HelpGenerator::HelpGenerator(bool silent)
{
generator = new QHelpGenerator(this);
- connect(generator, SIGNAL(statusChanged(QString)),
- this, SLOT(printStatus(QString)));
+ if (!silent) {
+ connect(generator, SIGNAL(statusChanged(QString)),
+ this, SLOT(printStatus(QString)));
+ }
connect(generator, SIGNAL(warning(QString)),
this, SLOT(printWarning(QString)));
}
Q_OBJECT
public:
- HelpGenerator();
+ HelpGenerator(bool silent = false);
bool generate(QHelpDataInterface *helpData,
const QString &outputFileName);
bool checkLinks(const QHelpDataInterface &helpData);