summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-09-08 03:11:12 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-09-08 03:11:12 (GMT)
commitd1b0c4a542d489a8924047c2824775b906ea5bf7 (patch)
tree17e6f8c46ae3c900dc924d7247a55791a5c152f0 /src/tools
parentff9eebaa9adb9cd41e97ac806238888546e77294 (diff)
parent190adb6dc8fe1b97d61a4cb09c77c71d7c0797b6 (diff)
downloadQt-d1b0c4a542d489a8924047c2824775b906ea5bf7.zip
Qt-d1b0c4a542d489a8924047c2824775b906ea5bf7.tar.gz
Qt-d1b0c4a542d489a8924047c2824775b906ea5bf7.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: uic: Improve messages. Tools (uic/rcc): Improve warning messages. QDir: Removed checks for existance of fileEngine QDir and QFileInfo shouldn't lose properties when detaching Another bug-o introduced in fixing QDirPrivate refactoring Reverting QDir::detach introduced earlier QFileInfo: Prepare for engine-less implementation Removed QFileInfoPrivate::initFileEngine Simplify QDir::cd QDir::makeAbsolute could self-destruct on failure QDir::operator= simplification QDirPrivate refactoring QDirPrivate refactoring QDirPrivate refactoring Removed QDirPrivate layer of indirection Refactor QFileInfoPrivate::Data (Round 2) Refactoring QDirPrivate::Data Move QFileInfoPrivate methods to QFileInfoPrivate::Data (1st Round) explicitly remove qt_webkit_version.pri when building with -no-webkit
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/rcc/rcc.cpp7
-rw-r--r--src/tools/uic/cpp/cppextractimages.cpp8
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.cpp10
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp35
-rw-r--r--src/tools/uic/driver.cpp5
-rw-r--r--src/tools/uic/option.h8
6 files changed, 52 insertions, 21 deletions
diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp
index 1f6e58f..0e3167d 100644
--- a/src/tools/rcc/rcc.cpp
+++ b/src/tools/rcc/rcc.cpp
@@ -544,8 +544,11 @@ bool RCCResourceLibrary::addFile(const QString &alias, const RCCFileInfo &file)
const QString filename = nodes.at(nodes.size()-1);
RCCFileInfo *s = new RCCFileInfo(file);
s->m_parent = parent;
- if (parent->m_children.contains(filename))
- qWarning("potential duplicate alias detected: '%s'", qPrintable(filename));
+ if (parent->m_children.contains(filename)) {
+ foreach (const QString &fileName, m_fileNames)
+ qWarning("%s: Warning: potential duplicate alias detected: '%s'",
+ qPrintable(fileName), qPrintable(filename));
+ }
parent->m_children.insertMulti(filename, s);
return true;
}
diff --git a/src/tools/uic/cpp/cppextractimages.cpp b/src/tools/uic/cpp/cppextractimages.cpp
index 52c1b9d..5809724 100644
--- a/src/tools/uic/cpp/cppextractimages.cpp
+++ b/src/tools/uic/cpp/cppextractimages.cpp
@@ -76,14 +76,14 @@ void ExtractImages::acceptUI(DomUI *node)
if (m_option.qrcOutputFile.size()) {
f.setFileName(m_option.qrcOutputFile);
if (!f.open(QIODevice::WriteOnly | QFile::Text)) {
- fprintf(stderr, "Could not create resource file\n");
+ fprintf(stderr, "%s: Error: Could not create resource file\n", qPrintable(m_option.messagePrefix()));
return;
}
QFileInfo fi(m_option.qrcOutputFile);
QDir dir = fi.absoluteDir();
if (!dir.exists(QLatin1String("images")) && !dir.mkdir(QLatin1String("images"))) {
- fprintf(stderr, "Could not create image dir\n");
+ fprintf(stderr, "%s: Error: Could not create image dir\n", qPrintable(m_option.messagePrefix()));
return;
}
dir.cd(QLatin1String("images"));
@@ -126,7 +126,9 @@ void ExtractImages::acceptImage(DomImage *image)
if (isXPM_GZ)
openMode |= QIODevice::Text;
if (!f.open(openMode)) {
- fprintf(stderr, "Could not create image file %s: %s", qPrintable(fname), qPrintable(f.errorString()));
+ fprintf(stderr, "%s: Error: Could not create image file %s: %s",
+ qPrintable(m_option.messagePrefix()),
+ qPrintable(fname), qPrintable(f.errorString()));
return;
}
diff --git a/src/tools/uic/cpp/cppwriteincludes.cpp b/src/tools/uic/cpp/cppwriteincludes.cpp
index 4e0ee4a..2dded84 100644
--- a/src/tools/uic/cpp/cppwriteincludes.cpp
+++ b/src/tools/uic/cpp/cppwriteincludes.cpp
@@ -126,8 +126,9 @@ void WriteIncludes::acceptUI(DomUI *node)
if (m_uic->hasExternalPixmap() && m_uic->pixmapFunction() == QLatin1String("qPixmapFromMimeSource")) {
#ifdef QT_NO_QT3_SUPPORT
- qWarning("Warning: The form file has external pixmaps or qPixmapFromMimeSource() set as a pixmap function. "
- "This requires Qt 3 support, which is disabled. The resulting code will not compile.");
+ qWarning("%s: Warning: The form file has external pixmaps or qPixmapFromMimeSource() set as a pixmap function. "
+ "This requires Qt 3 support, which is disabled. The resulting code will not compile.",
+ qPrintable(m_uic->option().warningsPrefix()));
#endif
add(QLatin1String("Q3MimeSourceFactory"));
}
@@ -212,8 +213,9 @@ void WriteIncludes::insertIncludeForClass(const QString &className, QString head
header = lowerClassName;
header += QLatin1String(".h");
if (warnHeaderGeneration) {
- qWarning("Warning: generated header '%s' for class '%s'.", qPrintable(header),
- qPrintable(className));
+ qWarning("%s: Warning: generated header '%s' for class '%s'.",
+ qPrintable(m_uic->option().messagePrefix()),
+ qPrintable(header), qPrintable(className));
}
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index dc1d181..b06eb7a 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -155,7 +155,7 @@ namespace {
if (const DomResourceIcon *dri = p->elementIconSet()) {
if (!isIconFormat44(dri)) {
if (dri->text().isEmpty()) {
- const QString msg = QString::fromUtf8("%1: An invalid icon property '%2' was encountered.").arg(fileName).arg(p->attributeName());
+ const QString msg = QString::fromUtf8("%1: Warning: An invalid icon property '%2' was encountered.").arg(fileName).arg(p->attributeName());
qWarning("%s", qPrintable(msg));
return false;
}
@@ -165,7 +165,7 @@ namespace {
case DomProperty::Pixmap:
if (const DomResourcePixmap *drp = p->elementPixmap())
if (drp->text().isEmpty()) {
- const QString msg = QString::fromUtf8("%1: An invalid pixmap property '%2' was encountered.").arg(fileName).arg(p->attributeName());
+ const QString msg = QString::fromUtf8("%1: Warning: An invalid pixmap property '%2' was encountered.").arg(fileName).arg(p->attributeName());
qWarning("%s", qPrintable(msg));
return false;
}
@@ -539,10 +539,14 @@ void WriteInitialization::acceptUI(DomUI *node)
const Buddy &b = m_buddies.at(i);
if (!m_registeredWidgets.contains(b.objName)) {
- fprintf(stderr, "'%s' isn't a valid widget\n", b.objName.toLatin1().data());
+ fprintf(stderr, "%s: Warning: Buddy assignment: '%s' is not a valid widget.\n",
+ qPrintable(m_option.messagePrefix()),
+ b.objName.toLatin1().data());
continue;
} else if (!m_registeredWidgets.contains(b.buddy)) {
- fprintf(stderr, "'%s' isn't a valid widget\n", b.buddy.toLatin1().data());
+ fprintf(stderr, "%s: Warning: Buddy assignment: '%s' is not a valid widget.\n",
+ qPrintable(m_option.messagePrefix()),
+ b.buddy.toLatin1().data());
continue;
}
@@ -867,7 +871,9 @@ void WriteInitialization::acceptWidget(DomWidget *node)
const QString name = zOrder.at(i);
if (!m_registeredWidgets.contains(name)) {
- fprintf(stderr, "'%s' isn't a valid widget\n", name.toLatin1().data());
+ fprintf(stderr, "%s: Warning: Z-order assignment: '%s' is not a valid widget.\n",
+ qPrintable(m_option.messagePrefix()),
+ name.toLatin1().data());
continue;
}
@@ -895,7 +901,9 @@ void WriteInitialization::addButtonGroup(const DomWidget *buttonNode, const QStr
DomButtonGroup *newGroup = new DomButtonGroup;
newGroup->setAttributeName(attributeName);
group = newGroup;
- fprintf(stderr, "Warning: Creating button group `%s'\n", attributeName.toLatin1().data());
+ fprintf(stderr, "%s: Warning: Creating button group `%s'\n",
+ qPrintable(m_option.messagePrefix()),
+ attributeName.toLatin1().data());
}
const QString groupName = m_driver->findOrInsertButtonGroup(group);
// Create on demand
@@ -1163,7 +1171,9 @@ void WriteInitialization::acceptActionRef(DomActionRef *node)
return;
}
} else if (!(m_driver->actionByName(actionName) || isSeparator)) {
- fprintf(stderr, "Warning: action `%s' not declared\n", actionName.toLatin1().data());
+ fprintf(stderr, "%s: Warning: action `%s' not declared\n",
+ qPrintable(m_option.messagePrefix()),
+ actionName.toLatin1().data());
return;
}
@@ -1853,7 +1863,9 @@ void WriteInitialization::acceptTabStops(DomTabStops *tabStops)
const QString name = l.at(i);
if (!m_registeredWidgets.contains(name)) {
- fprintf(stderr, "'%s' isn't a valid widget\n", name.toLatin1().data());
+ fprintf(stderr, "%s: Warning: Tab-stop assignment: '%s' is not a valid widget.\n",
+ qPrintable(m_option.messagePrefix()),
+ name.toLatin1().data());
continue;
}
@@ -2083,7 +2095,8 @@ QString WriteInitialization::pixCall(const DomProperty *p) const
s = p->elementPixmap()->text();
break;
default:
- qWarning() << "Warning: Unknown icon format encountered. The ui-file was generated with a too-recent version of Designer.";
+ qWarning("%s: Warning: Unknown icon format encountered. The ui-file was generated with a too-recent version of Designer.",
+ qPrintable(m_option.messagePrefix()));
return QLatin1String("QIcon()");
break;
}
@@ -2573,7 +2586,7 @@ void WriteInitialization::initializeQ3SqlDataTable(DomWidget *w)
}
if (table.isEmpty() || connection.isEmpty()) {
- fprintf(stderr, "invalid database connection\n");
+ fprintf(stderr, "%s: Warning: Invalid database connection\n", qPrintable(m_option.messagePrefix()));
return;
}
@@ -2613,7 +2626,7 @@ void WriteInitialization::initializeQ3SqlDataBrowser(DomWidget *w)
}
if (table.isEmpty() || connection.isEmpty()) {
- fprintf(stderr, "invalid database connection\n");
+ fprintf(stderr, "%s: Warning: Invalid database connection\n", qPrintable(m_option.messagePrefix()));
return;
}
diff --git a/src/tools/uic/driver.cpp b/src/tools/uic/driver.cpp
index 676388f..65d63e0 100644
--- a/src/tools/uic/driver.cpp
+++ b/src/tools/uic/driver.cpp
@@ -178,7 +178,10 @@ QString Driver::unique(const QString &instanceName, const QString &className)
}
if (alreadyUsed && className.size()) {
- fprintf(stderr, "Warning: name %s is already used\n", qPrintable(instanceName));
+ fprintf(stderr, "%s: Warning: The name '%s' (%s) is already in use, defaulting to '%s'.\n",
+ qPrintable(m_option.messagePrefix()),
+ qPrintable(instanceName), qPrintable(className),
+ qPrintable(name));
}
m_nameRepository.insert(name, true);
diff --git a/src/tools/uic/option.h b/src/tools/uic/option.h
index 8556728..011a8f8 100644
--- a/src/tools/uic/option.h
+++ b/src/tools/uic/option.h
@@ -43,6 +43,7 @@
#define OPTION_H
#include <QtCore/QString>
+#include <QtCore/QDir>
QT_BEGIN_NAMESPACE
@@ -91,6 +92,13 @@ struct Option
generator(CppGenerator),
prefix(QLatin1String("Ui_"))
{ indent.fill(QLatin1Char(' '), 4); }
+
+ QString messagePrefix() const
+ {
+ return inputFile.isEmpty() ?
+ QString(QLatin1String("stdin")) :
+ QDir::toNativeSeparators(inputFile);
+ }
};
QT_END_NAMESPACE