mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
return different status based on the error from trc tool
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
db07b8b18f
commit
fb2849a589
1 changed files with 5 additions and 7 deletions
|
@ -158,7 +158,7 @@ int runTrc(int argc, char *argv[])
|
||||||
QFile outputfile(outputfilepath);
|
QFile outputfile(outputfilepath);
|
||||||
if (!outputfile.open(QFile::WriteOnly)) {
|
if (!outputfile.open(QFile::WriteOnly)) {
|
||||||
fprintf(stderr, "trc: Coult not open output %s\n", qPrintable(outputfilepath));
|
fprintf(stderr, "trc: Coult not open output %s\n", qPrintable(outputfilepath));
|
||||||
return 1;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
po_file_t gettext_file = po_file_read(
|
po_file_t gettext_file = po_file_read(
|
||||||
|
@ -167,7 +167,7 @@ int runTrc(int argc, char *argv[])
|
||||||
);
|
);
|
||||||
if (gettext_file == NULL) {
|
if (gettext_file == NULL) {
|
||||||
fprintf(stderr, "trc: Coult not open input %s\n", inputfilepath.constData());
|
fprintf(stderr, "trc: Coult not open input %s\n", inputfilepath.constData());
|
||||||
return 1;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* gettext_domain_header = po_file_domain_header(gettext_file, NULL);
|
const char* gettext_domain_header = po_file_domain_header(gettext_file, NULL);
|
||||||
|
@ -205,6 +205,7 @@ int runTrc(int argc, char *argv[])
|
||||||
gettext_message = po_next_message(gettext_iterator);
|
gettext_message = po_next_message(gettext_iterator);
|
||||||
}
|
}
|
||||||
po_message_iterator_free(gettext_iterator);
|
po_message_iterator_free(gettext_iterator);
|
||||||
|
po_file_free(gettext_file);
|
||||||
|
|
||||||
QByteArray trheaderdata;
|
QByteArray trheaderdata;
|
||||||
QDataStream trheaderstream(&trheaderdata, QIODevice::WriteOnly);
|
QDataStream trheaderstream(&trheaderdata, QIODevice::WriteOnly);
|
||||||
|
@ -214,17 +215,14 @@ int runTrc(int argc, char *argv[])
|
||||||
|
|
||||||
if (outputfile.write(trheaderdata.constData(), trheaderdata.size()) != trheaderdata.size()) {
|
if (outputfile.write(trheaderdata.constData(), trheaderdata.size()) != trheaderdata.size()) {
|
||||||
fprintf(stderr, "trc: Coult not write header %s\n", qPrintable(outputfile.errorString()));
|
fprintf(stderr, "trc: Coult not write header %s\n", qPrintable(outputfile.errorString()));
|
||||||
po_file_free(gettext_file);
|
return 4;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outputfile.write(trdata.constData(), trdata.size()) != trdata.size()) {
|
if (outputfile.write(trdata.constData(), trdata.size()) != trdata.size()) {
|
||||||
fprintf(stderr, "trc: Coult not write data %s\n", qPrintable(outputfile.errorString()));
|
fprintf(stderr, "trc: Coult not write data %s\n", qPrintable(outputfile.errorString()));
|
||||||
po_file_free(gettext_file);
|
return 5;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
po_file_free(gettext_file);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue