--- a/src/hbtools/docml2bin/main.cpp Thu May 27 13:10:59 2010 +0300
+++ b/src/hbtools/docml2bin/main.cpp Fri Jun 11 13:58:22 2010 +0300
@@ -23,11 +23,15 @@
**
****************************************************************************/
+#include <QCoreApplication>
+#include <QStringList>
+#include <QFile>
#include <hbdocumentloader.h>
-#include <QtGui>
#include <assert.h>
#include <iostream>
+#include <QDebug>
+
void showHelp() {
std::cout << "docml2bin.exe usage:\n\n";
@@ -50,11 +54,15 @@
int main(int argc, char *argv[])
{
- QApplication app(argc, argv, false); // GUIenabled=false
+
+ qDebug() << "docml2bin, 1";
+
+ QCoreApplication app(argc, argv);
if (argc <= 2) {
showHelp();
} else {
+ qDebug() << "docml2bin, 2";
//bool backup = false;
QString source, target;
//QStringList restore;
@@ -79,6 +87,7 @@
*/
}
}
+ qDebug() << "docml2bin, 3";
/*
if (restore.count()) {
for (int i = 0; i < restore.count(); i++) {
@@ -106,19 +115,24 @@
source = orig;
}
*/
+ qDebug() << "docml2bin, 4";
if (!QFile::exists(source)) {
std::cout << "Error: file " << source.toStdString() << " does not exist.\n";
} else {
+ qDebug() << "docml2bin, 5";
// Open file and parse lines. Each line should have three value separated with:
QFile sourceFile(source);
if (sourceFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ qDebug() << "docml2bin, 6";
if (!target.length()) {
target = source + ".bin";
}
QFile targetFile(target);
if (targetFile.open(QIODevice::WriteOnly)) {
+ qDebug() << "docml2bin, 7";
HbDocumentLoader loader;
loader.createBinary( &sourceFile, &targetFile );
+ qDebug() << "docml2bin, 8";
targetFile.close();
}
sourceFile.close();
@@ -126,6 +140,7 @@
}
}
}
+ qDebug() << "docml2bin, 9";
return 0;
}