@@ -52,7 +52,7 void displayHelp(GeneratorSet *generatorSet); | |||
|
52 | 52 | |
|
53 | 53 | #include <QDebug> |
|
54 | 54 | int main(int argc, char *argv[]) |
|
55 |
{ |
|
|
55 | { | |
|
56 | 56 | GeneratorSet *gs = GeneratorSet::getInstance(); |
|
57 | 57 | |
|
58 | 58 | QString default_file = ":/trolltech/generator/qtscript_masterinclude.h"; |
@@ -62,7 +62,7 int main(int argc, char *argv[]) | |||
|
62 | 62 | QString typesystemFileName; |
|
63 | 63 | QString pp_file = ".preprocessed.tmp"; |
|
64 | 64 | QStringList rebuild_classes; |
|
65 | ||
|
65 | ||
|
66 | 66 | QMap<QString, QString> args; |
|
67 | 67 | |
|
68 | 68 | int argNum = 0; |
@@ -82,12 +82,12 int main(int argc, char *argv[]) | |||
|
82 | 82 | args[QString("arg-%1").arg(argNum)] = arg; |
|
83 | 83 | } |
|
84 | 84 | } |
|
85 | ||
|
85 | ||
|
86 | 86 | if (args.contains("no-suppress-warnings")) { |
|
87 | 87 | TypeDatabase *db = TypeDatabase::instance(); |
|
88 | 88 | db->setSuppressWarnings(false); |
|
89 | 89 | } |
|
90 | ||
|
90 | ||
|
91 | 91 | if (args.contains("debug-level")) { |
|
92 | 92 | QString level = args.value("debug-level"); |
|
93 | 93 | if (level == "sparse") |
@@ -96,7 +96,7 int main(int argc, char *argv[]) | |||
|
96 | 96 | ReportHandler::setDebugLevel(ReportHandler::MediumDebug); |
|
97 | 97 | else if (level == "full") |
|
98 | 98 | ReportHandler::setDebugLevel(ReportHandler::FullDebug); |
|
99 |
} |
|
|
99 | } | |
|
100 | 100 | |
|
101 | 101 | if (args.contains("dummy")) { |
|
102 | 102 | FileOut::dummy = true; |
@@ -134,19 +134,25 int main(int argc, char *argv[]) | |||
|
134 | 134 | |
|
135 | 135 | printf("Please wait while source files are being generated...\n"); |
|
136 | 136 | |
|
137 | printf("Parsing typesystem file [%s]\n", qPrintable(typesystemFileName)); | |
|
137 | 138 | if (!TypeDatabase::instance()->parseFile(typesystemFileName)) |
|
138 | 139 | qFatal("Cannot parse file: '%s'", qPrintable(typesystemFileName)); |
|
139 | 140 | |
|
141 | printf("PreProcessing - Generate [%s] using [%s] and include-paths [%s]\n", | |
|
142 | qPrintable(pp_file), qPrintable(fileName), qPrintable(args.value("include-paths"))); | |
|
140 | 143 | if (!Preprocess::preprocess(fileName, pp_file, args.value("include-paths"))) { |
|
141 | 144 | fprintf(stderr, "Preprocessor failed on file: '%s'\n", qPrintable(fileName)); |
|
142 | 145 | return 1; |
|
143 | 146 | } |
|
144 | 147 | |
|
145 | 148 | if (args.contains("ast-to-xml")) { |
|
146 | astToXML(pp_file); | |
|
147 | return 0; | |
|
149 | printf("Running ast-to-xml on file [%s] using pp_file [%s] and include-paths [%s]\n", | |
|
150 | qPrintable(fileName), qPrintable(pp_file), qPrintable(args.value("include-paths"))); | |
|
151 | astToXML(pp_file); | |
|
152 | return 0; | |
|
148 | 153 | } |
|
149 | 154 | |
|
155 | printf("Building model using [%s]\n", qPrintable(pp_file)); | |
|
150 | 156 | gs->buildModel(pp_file); |
|
151 | 157 | if (args.contains("dump-object-tree")) { |
|
152 | 158 | gs->dumpObjectTree(); |
@@ -176,7 +182,7 void displayHelp(GeneratorSet* generatorSet) { | |||
|
176 | 182 | " --include-paths=<path>[%c<path>%c...] \n" |
|
177 | 183 | " --print-stdout \n", |
|
178 | 184 | path_splitter, path_splitter); |
|
179 | ||
|
185 | ||
|
180 | 186 | printf("%s", qPrintable( generatorSet->usage())); |
|
181 | 187 | exit(0); |
|
182 | 188 | } |
@@ -57,7 +57,7 void ReportHandler::warning(const QString &text) | |||
|
57 | 57 | if (db && db->isSuppressedWarning(warningText)) { |
|
58 | 58 | ++m_suppressed_count; |
|
59 | 59 | } else if (!m_reported_warnings.contains(warningText)) { |
|
60 | qDebug(qPrintable(warningText)); | |
|
60 | qDebug("%s", qPrintable(warningText)); | |
|
61 | 61 | ++m_warning_count; |
|
62 | 62 | |
|
63 | 63 | m_reported_warnings.insert(warningText); |
@@ -171,7 +171,9 void SetupGenerator::generate() | |||
|
171 | 171 | |
|
172 | 172 | |
|
173 | 173 | { |
|
174 |
|
|
|
174 | QString fileName(packName + "/" + packKey + "_init.cpp"); | |
|
175 | FileOut initFile(m_out_dir + "/generated_cpp/" + fileName); | |
|
176 | ReportHandler::debugSparse(QString("generating: %1").arg(fileName)); | |
|
175 | 177 | QTextStream &s = initFile.stream; |
|
176 | 178 | |
|
177 | 179 | s << "#include <PythonQt.h>" << endl; |
@@ -264,7 +266,7 QStringList SetupGenerator::writePolymorphicHandler(QTextStream &s, const QStrin | |||
|
264 | 266 | handlers.append(handler); |
|
265 | 267 | |
|
266 | 268 | s << "static void* polymorphichandler_" << handler |
|
267 | << "(const void *ptr, char **class_name)" << endl | |
|
269 | << "(const void *ptr, const char **class_name)" << endl | |
|
268 | 270 | << "{" << endl |
|
269 | 271 | << " Q_ASSERT(ptr != 0);" << endl |
|
270 | 272 | << " " << cls->qualifiedCppName() << " *object = (" |
General Comments 0
You need to be logged in to leave comments.
Login now