summaryrefslogtreecommitdiffstats
path: root/src/tools/uic/cpp/cppwriteicondata.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-30 06:25:31 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-30 06:25:31 (GMT)
commit08072b17a19bf9a99fbc8a494baa5528725fec1a (patch)
tree900485e613e11149b6138667ef2626bb869d0cc1 /src/tools/uic/cpp/cppwriteicondata.cpp
parentc4f59859a589b76419e9133110eda850223f03dd (diff)
parentb353f98da10f4b8b80f6be70951f147d580999e8 (diff)
downloadQt-08072b17a19bf9a99fbc8a494baa5528725fec1a.zip
Qt-08072b17a19bf9a99fbc8a494baa5528725fec1a.tar.gz
Qt-08072b17a19bf9a99fbc8a494baa5528725fec1a.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: (23 commits) Fix compile error on mingw. MONILITY-645 Do not override alternate background color in Plastique Fix QComboBox ignoring foreground role in some styles Fix compilation on HP-UXi: _SC_MONOTONIC_CLOCK isn't defined Fix compilation with Sun CC: Ensure that we return QPair<long,long> in all cases. Update PLATFORM(SPARC64) to CPU(SPARC64) jui files are no c++ ... scan some more file types by default Support EtchDisabledText with spin box on Windows style QNAM HTTP: Fix invoking a method when being destructed right now Fixed a typo in the QDoubleValidotor doc. Trivial fix to JavaScriptCore to fix building with MSVC 2010 Autotest: oops, fix oops: remove qguard from auto.pro Autotests: oops, remove last traces of QGuard Remove QGuard. Unskip test that used to crash QtScript: Add yet more missing API shims QtScript: Make sure the old identifier table is restored ...
Diffstat (limited to 'src/tools/uic/cpp/cppwriteicondata.cpp')
-rw-r--r--src/tools/uic/cpp/cppwriteicondata.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/tools/uic/cpp/cppwriteicondata.cpp b/src/tools/uic/cpp/cppwriteicondata.cpp
index 81ef56b..7e4b5c8 100644
--- a/src/tools/uic/cpp/cppwriteicondata.cpp
+++ b/src/tools/uic/cpp/cppwriteicondata.cpp
@@ -114,10 +114,12 @@ void WriteIconData::acceptImages(DomImages *images)
void WriteIconData::acceptImage(DomImage *image)
{
- writeImage(output, option.indent, image);
+ // Limit line length when writing code.
+ writeImage(output, option.indent, true, image);
}
-void WriteIconData::writeImage(QTextStream &output, const QString &indent, DomImage *image)
+void WriteIconData::writeImage(QTextStream &output, const QString &indent,
+ bool limitXPM_LineLength, const DomImage *image)
{
QString img = image->attributeName() + QLatin1String("_data");
QString data = image->elementData()->text();
@@ -133,7 +135,8 @@ void WriteIconData::writeImage(QTextStream &output, const QString &indent, DomIm
int a = 0;
int column = 0;
bool inQuote = false;
- output << indent << "static const char* const " << img << "[] = { \n";
+ output << indent << "/* XPM */\n"
+ << indent << "static const char* const " << img << "[] = { \n";
while (baunzip[a] != '\"')
a++;
for (; a < (int) length; a++) {
@@ -144,7 +147,8 @@ void WriteIconData::writeImage(QTextStream &output, const QString &indent, DomIm
inQuote = !inQuote;
}
- if (column++ >= 511 && inQuote) {
+ column++;
+ if (limitXPM_LineLength && column >= 512 && inQuote) {
output << "\"\n\""; // be nice with MSVC & Co.
column = 1;
}