From e24de8996b7f3baebbc2eba288fdcfd23e71df96 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Tue, 11 Mar 2008 11:29:25 +0000 Subject: [PATCH] - 0088-fix-xinput-clash.diff, fix compile errors with Xmd.h - 0076-fix-qprocess.diff, fix a regression in QProgress::writeToStdin() - 0081-format-string-fixes.diff, fix various format string errors on Qt 3.x code base --- 0076-fix-qprocess.diff | 19 ++++ 0081-format-string-fixes.diff | 197 ++++++++++++++++++++++++++++++++++ 0088-fix-xinput-clash.diff | 55 ++++++++++ qt.spec | 9 ++ 4 files changed, 280 insertions(+) create mode 100644 0076-fix-qprocess.diff create mode 100644 0081-format-string-fixes.diff create mode 100644 0088-fix-xinput-clash.diff diff --git a/0076-fix-qprocess.diff b/0076-fix-qprocess.diff new file mode 100644 index 0000000..5a7b496 --- /dev/null +++ b/0076-fix-qprocess.diff @@ -0,0 +1,19 @@ +qt-bugs@ issue : none +bugs.kde.org number : none +applied: yes +author: from trolltech + +Fixes a regression in QProgress::writeToStdin() + + +--- src/kernel/qprocess.cpp ++++ src/kernel/qprocess.cpp +@@ -727,7 +727,7 @@ void QProcess::closeStdinLaunch() + void QProcess::writeToStdin( const QString& buf ) + { + QByteArray tmp = buf.local8Bit(); +- tmp.resize( tmp.size() - 1 ); // drop the implicit \0 ++ tmp.resize( qstrlen( tmp.data() ) ); + writeToStdin( tmp ); + } + diff --git a/0081-format-string-fixes.diff b/0081-format-string-fixes.diff new file mode 100644 index 0000000..a8f2768 --- /dev/null +++ b/0081-format-string-fixes.diff @@ -0,0 +1,197 @@ +qt-bugs@ issue : none +bugs.kde.org number : none +applied: yes +author: Dirk Mueller/TT + +Fixes various, partially exploitable format string errors on Qt 3.x code base. + + +--- src/widgets/qtextedit.cpp Mon Jul 16 10:44:40 CEST 2007 ++++ src/widgets/qtextedit.cpp Mon Jul 16 10:44:40 CEST 2007 + +@@ -6349,7 +6349,7 @@ + cur = tag->prev; + if ( !cur ) { + #ifdef QT_CHECK_RANGE +- qWarning( "QTextEdit::optimParseTags: no left-tag for '<" + tag->tag + ">' in line %d.", tag->line + 1 ); ++ qWarning( "QTextEdit::optimParseTags: no left-tag for '<%s>' in line %d.", tag->tag.ascii(), tag->line + 1 ); + #endif + return; // something is wrong - give up + } +@@ -6372,7 +6372,7 @@ + break; + } else if ( !cur->leftTag ) { + #ifdef QT_CHECK_RANGE +- qWarning( "QTextEdit::optimParseTags: mismatching %s-tag for '<" + cur->tag + ">' in line %d.", cur->tag[0] == '/' ? "left" : "right", cur->line + 1 ); ++ qWarning( "QTextEdit::optimParseTags: mismatching %s-tag for '<%s>' in line %d.", cur->tag[0] == '/' ? "left" : "right", cur->tag.ascii(), cur->line + 1 ); + #endif + return; // something is amiss - give up + } +--- src/sql/qdatatable.cpp Mon Jul 16 10:45:03 CEST 2007 ++++ src/sql/qdatatable.cpp Mon Jul 16 10:45:03 CEST 2007 + +@@ -1043,8 +1043,8 @@ + return FALSE; + if ( !sqlCursor()->canInsert() ) { + #ifdef QT_CHECK_RANGE +- qWarning("QDataTable::insertCurrent: insert not allowed for " + +- sqlCursor()->name() ); ++ qWarning("QDataTable::insertCurrent: insert not allowed for %s", ++ sqlCursor()->name().latin1() ); + #endif + endInsert(); + return FALSE; +@@ -1117,16 +1117,16 @@ + return FALSE; + if ( sqlCursor()->primaryIndex().count() == 0 ) { + #ifdef QT_CHECK_RANGE +- qWarning("QDataTable::updateCurrent: no primary index for " + +- sqlCursor()->name() ); ++ qWarning("QDataTable::updateCurrent: no primary index for %s", ++ sqlCursor()->name().latin1() ); + #endif + endUpdate(); + return FALSE; + } + if ( !sqlCursor()->canUpdate() ) { + #ifdef QT_CHECK_RANGE +- qWarning("QDataTable::updateCurrent: updates not allowed for " + +- sqlCursor()->name() ); ++ qWarning("QDataTable::updateCurrent: updates not allowed for %s", ++ sqlCursor()->name().latin1() ); + #endif + endUpdate(); + return FALSE; +@@ -1191,8 +1191,8 @@ + return FALSE; + if ( sqlCursor()->primaryIndex().count() == 0 ) { + #ifdef QT_CHECK_RANGE +- qWarning("QDataTable::deleteCurrent: no primary index " + +- sqlCursor()->name() ); ++ qWarning("QDataTable::deleteCurrent: no primary index %s", ++ sqlCursor()->name().latin1() ); + #endif + return FALSE; + } + +--- src/sql/qsqldatabase.cpp Mon Jul 16 10:45:03 CEST 2007 ++++ src/sql/qsqldatabase.cpp Mon Jul 16 10:45:03 CEST 2007 + +@@ -234,7 +234,8 @@ + db->open(); + #ifdef QT_CHECK_RANGE + if ( !db->isOpen() ) +- qWarning("QSqlDatabaseManager::database: unable to open database: " + db->lastError().databaseText() + ": " + db->lastError().driverText() ); ++ qWarning("QSqlDatabaseManager::database: unable to open database: %s: %s", ++ db->lastError().databaseText().latin1(), db->lastError().driverText().latin1() ); + #endif + } + return db; +@@ -686,7 +687,7 @@ + if ( !d->driver ) { + #ifdef QT_CHECK_RANGE + qWarning( "QSqlDatabase: %s driver not loaded", type.latin1() ); +- qWarning( "QSqlDatabase: available drivers: " + drivers().join(" ") ); ++ qWarning( "QSqlDatabase: available drivers: %s", drivers().join(" ").latin1() ); + #endif + d->driver = new QNullDriver(); + d->driver->setLastError( QSqlError( "Driver not loaded", "Driver not loaded" ) ); + +--- src/sql/qsqlindex.cpp Mon Jul 16 10:45:03 CEST 2007 ++++ src/sql/qsqlindex.cpp Mon Jul 16 10:45:03 CEST 2007 + +@@ -273,7 +273,7 @@ + if ( field ) + newSort.append( *field, desc ); + else +- qWarning( "QSqlIndex::fromStringList: unknown field: '" + f + "'" ); ++ qWarning( "QSqlIndex::fromStringList: unknown field: '%s'", f.latin1()); + } + return newSort; + } + +--- src/sql/qsqlrecord.cpp Mon Jul 16 10:45:03 CEST 2007 ++++ src/sql/qsqlrecord.cpp Mon Jul 16 10:45:03 CEST 2007 + +@@ -298,7 +298,7 @@ + return i; + } + #ifdef QT_CHECK_RANGE +- qWarning( "QSqlRecord::position: unable to find field " + name ); ++ qWarning( "QSqlRecord::position: unable to find field %s", name.latin1() ); + #endif + return -1; + } +@@ -313,7 +313,7 @@ + checkDetach(); + if ( !sh->d->contains( i ) ) { + #ifdef QT_CHECK_RANGE +- qWarning( "QSqlRecord::field: index out of range: " + QString::number( i ) ); ++ qWarning( "QSqlRecord::field: index out of range: %d", i ); + #endif + return 0; + } +@@ -344,7 +344,7 @@ + { + if ( !sh->d->contains( i ) ) { + #ifdef QT_CHECK_RANGE +- qWarning( "QSqlRecord::field: index out of range: " + QString::number( i ) ); ++ qWarning( "QSqlRecord::field: index out of range: %d", i ); + #endif // QT_CHECK_RANGE + return 0; + } + +--- src/tools/qglobal.cpp Mon Jul 16 10:45:03 CEST 2007 ++++ src/tools/qglobal.cpp Mon Jul 16 10:45:03 CEST 2007 + +@@ -680,7 +680,7 @@ + if ( code != -1 ) + qWarning( "%s\n\tError code %d - %s", msg, code, strerror( code ) ); + else +- qWarning( msg ); ++ qWarning( "%s", msg ); + #endif + #else + Q_UNUSED( msg ); + +--- src/xml/qsvgdevice.cpp Mon Jul 16 10:45:03 CEST 2007 ++++ src/xml/qsvgdevice.cpp Mon Jul 16 10:45:03 CEST 2007 + +@@ -978,7 +978,7 @@ + // ### catch references to embedded .svg files + QPixmap pix; + if ( !pix.load( href ) ) { +- qWarning( "QSvgDevice::play: Couldn't load image "+href ); ++ qWarning( "QSvgDevice::play: Couldn't load image %s", href.latin1() ); + break; + } + pt->drawPixmap( QRect( x1, y1, w, h ), pix ); +@@ -1024,8 +1024,8 @@ + break; + } + case InvalidElement: +- qWarning( "QSvgDevice::play: unknown element type " + +- node.nodeName() ); ++ qWarning( "QSvgDevice::play: unknown element type %s", ++ node.nodeName().latin1() ); + break; + }; + +@@ -1111,7 +1111,7 @@ + { + QRegExp reg( QString::fromLatin1("([+-]?\\d*\\.*\\d*[Ee]?[+-]?\\d*)(em|ex|px|%|pt|pc|cm|mm|in|)$") ); + if ( reg.search( str ) == -1 ) { +- qWarning( "QSvgDevice::parseLen: couldn't parse " + str ); ++ qWarning( "QSvgDevice::parseLen: couldn't parse %s ", str.latin1() ); + if ( ok ) + *ok = FALSE; + return 0.0; +@@ -1140,7 +1140,7 @@ + else if ( u == "pc" ) + dbl *= m.logicalDpiX() / 6.0; + else +- qWarning( "QSvgDevice::parseLen: Unknown unit " + u ); ++ qWarning( "QSvgDevice::parseLen: Unknown unit %s", u.latin1() ); + } + if ( ok ) + *ok = TRUE; diff --git a/0088-fix-xinput-clash.diff b/0088-fix-xinput-clash.diff new file mode 100644 index 0000000..61e3b55 --- /dev/null +++ b/0088-fix-xinput-clash.diff @@ -0,0 +1,55 @@ +qt-bugs@ issue : +bugs.kde.org number : +applied: no +author: Dirk Mueller + +fix compile errors with newer X.org + +--- include/private/qt_x11_p.h ++++ include/private/qt_x11_p.h +@@ -86,7 +86,7 @@ + + + // the wacom tablet (currently just the IRIX version) +-#if defined (QT_TABLET_SUPPORT) ++#if defined (QT_TABLET_SUPPORT) && defined (QT_CLEAN_NAMESPACE) + # include + #if defined (Q_OS_IRIX) + # include // wacom driver defines for IRIX (quite handy) +--- src/kernel/qtaddons_x11.cpp ++++ src/kernel/qtaddons_x11.cpp +@@ -22,6 +22,10 @@ + * PERFORMANCE OF THIS SOFTWARE. + */ + ++#ifndef QT_CLEAN_NAMESPACE ++#define QT_CLEAN_NAMESPACE ++#endif ++ + #include "qt_x11_p.h" + + #if !defined(QT_NO_XFTFREETYPE) && !defined(QT_XFT2) +--- src/kernel/qt_x11_p.h ++++ src/kernel/qt_x11_p.h +@@ -86,7 +86,7 @@ + + + // the wacom tablet (currently just the IRIX version) +-#if defined (QT_TABLET_SUPPORT) ++#if defined (QT_TABLET_SUPPORT) && defined (QT_CLEAN_NAMESPACE) + # include + #if defined (Q_OS_IRIX) + # include // wacom driver defines for IRIX (quite handy) +--- src/kernel/qwidget_x11.cpp ++++ src/kernel/qwidget_x11.cpp +@@ -38,6 +38,10 @@ + ** + **********************************************************************/ + ++#ifndef QT_CLEAN_NAMESPACE ++#define QT_CLEAN_NAMESPACE ++#endif ++ + #include "qapplication.h" + #include "qapplication_p.h" + #include "qnamespace.h" diff --git a/qt.spec b/qt.spec index 4484edd..4d7b7ca 100644 --- a/qt.spec +++ b/qt.spec @@ -52,9 +52,12 @@ Patch101: 0047-fix-kmenu-width.diff Patch102: 0048-qclipboard_hack_80072.patch Patch103: 0056-khotkeys_input_84434.patch patch105: 0073-xinerama-aware-qpopup.patch +patch106: 0076-fix-qprocess.diff Patch107: 0079-compositing-types.patch Patch108: 0080-net-wm-sync-request-2.patch +Patch109: 0081-format-string-fixes.diff Patch110: 0084-compositing-properties.patch +Patch111: 0088-fix-xinput-clash.diff # upstream patches Patch200: qt-x11-free-3.3.4-fullscreen.patch @@ -293,9 +296,12 @@ for the Qt toolkit. %patch102 -p0 -b .0048-qclipboard_hack_80072 %patch103 -p0 -b .0056-khotkeys_input_84434 %patch105 -p0 -b .0073-xinerama-aware-qpopup +%patch106 -p0 -b .0076-fix-qprocess.diff %patch107 -p0 -b .0079-compositing-types %patch108 -p0 -b .0080-net-wm-sync-request +%patch109 -p0 -b .0081-format-string-fixes %patch110 -p0 -b .0084-compositing-properties +%patch111 -p0 -b .0088-fix-xinput-clash # upstream patches %patch200 -p1 -b .fullscreen @@ -576,6 +582,9 @@ rm -rf %{buildroot} %changelog * Fri Mar 07 2008 Than Ngo 3.3.8b-6 - move qt.[c]sh in main package (#221000) +- 0088-fix-xinput-clash.diff, fix compile errors with Xmd.h +- 0076-fix-qprocess.diff, fix a regression in QProgress::writeToStdin() +- 0081-format-string-fixes.diff, fix various format string errors on Qt 3.x code base * Mon Feb 18 2008 Kevin Kofler 3.3.8b-5 - fix buildkey for GCC 4.3 (#433235)