From 2c8f8c8553d11dc31e0c8b8d5eb39efefd8cfc21 Mon Sep 17 00:00:00 2001 From: axis Date: Thu, 4 Nov 2010 13:51:44 +0100 Subject: Fixed elf2e32_qtwrapper when not using def files. RevBy: Liang Qi Task: QTBUG-14952 --- bin/elf2e32_qtwrapper.pl | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/bin/elf2e32_qtwrapper.pl b/bin/elf2e32_qtwrapper.pl index c51c409..4eeb098 100755 --- a/bin/elf2e32_qtwrapper.pl +++ b/bin/elf2e32_qtwrapper.pl @@ -80,7 +80,9 @@ while (1) { my $newDefFile; my $origDefFile; my $savedNewDefFileLine = ""; - open($origDefFile, "< $definput[1]") or die("Could not open $definput[1]"); + if ($definput[1]) { + open($origDefFile, "< $definput[1]") or die("Could not open $definput[1]"); + } open($newDefFile, "< $defoutput[1]") or die("Could not open $defoutput[1]"); open($tmpDefFile, "> $defoutput[1].tmp") or die("Could not open $defoutput[1].tmp"); print($tmpDefFile "EXPORTS\n"); @@ -98,19 +100,21 @@ while (1) { my $sym; my $ordinal; my $extraData; - # Read from original def file, and skip non-symbol lines - while (1) { - $origDefLine = <$origDefFile>; - if (defined($origDefLine)) { - $origDefLine =~ s/[\n\r]//; - if ($origDefLine =~ /([a-z0-9_]+) +\@ ([0-9]+) (.*)/i) { - $origSym = $1; - $origOrdinal = $2; - $origExtraData = $3; + if ($definput[1]) { + # Read from original def file, and skip non-symbol lines + while (1) { + $origDefLine = <$origDefFile>; + if (defined($origDefLine)) { + $origDefLine =~ s/[\n\r]//; + if ($origDefLine =~ /([a-z0-9_]+) +\@ ([0-9]+) (.*)/i) { + $origSym = $1; + $origOrdinal = $2; + $origExtraData = $3; + last; + } + } else { last; } - } else { - last; } } @@ -169,7 +173,7 @@ while (1) { print($tmpDefFile "\t$sym \@ $ordinal $extraData\n"); } print($tmpDefFile "\n"); - close($origDefFile); + close($origDefFile) if ($definput[1]); close($newDefFile); close($tmpDefFile); -- cgit v0.12 From da8b7c8587a6d3c3214355f3d85a09c8693ceeee Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Thu, 4 Nov 2010 15:19:03 +0100 Subject: Fix compilation issue for the Carbon build. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The unified toolbar with the raster engine is Cocoa specific. Reviewed-by: Samuel Rødal --- src/gui/widgets/qmainwindowlayout_mac.mm | 3 +++ src/gui/widgets/qmainwindowlayout_p.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm index dfde799..9e26423 100644 --- a/src/gui/widgets/qmainwindowlayout_mac.mm +++ b/src/gui/widgets/qmainwindowlayout_mac.mm @@ -474,6 +474,7 @@ void QMainWindowLayout::insertIntoMacToolbar(QToolBar *before, QToolBar *toolbar #endif } +#ifdef QT_MAC_USE_COCOA void QMainWindowLayout::updateUnifiedToolbarOffset() { QPoint offset(0, 0); @@ -483,6 +484,8 @@ void QMainWindowLayout::updateUnifiedToolbarOffset() qtoolbarsInUnifiedToolbarList.at(i)->d_func()->toolbar_offset = offset; } } +#endif // QT_MAC_USE_COCOA + void QMainWindowLayout::removeFromMacToolbar(QToolBar *toolbar) { diff --git a/src/gui/widgets/qmainwindowlayout_p.h b/src/gui/widgets/qmainwindowlayout_p.h index e457cbc..661d49d 100644 --- a/src/gui/widgets/qmainwindowlayout_p.h +++ b/src/gui/widgets/qmainwindowlayout_p.h @@ -335,7 +335,6 @@ public: QHash toolbarSaveState; QHash cocoaItemIDToToolbarHash; void insertIntoMacToolbar(QToolBar *before, QToolBar *after); - void updateUnifiedToolbarOffset(); void removeFromMacToolbar(QToolBar *toolbar); void cleanUpMacToolbarItems(); void fixSizeInUnifiedToolbar(QToolBar *tb) const; @@ -346,6 +345,7 @@ public: #ifdef QT_MAC_USE_COCOA QUnifiedToolbarSurface *unifiedSurface; + void updateUnifiedToolbarOffset(); #endif // QT_MAC_USE_COCOA #endif // Q_WS_MAC -- cgit v0.12 From 0d6991e3219de48429109dc272e9598acf45d5df Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 5 Nov 2010 14:20:42 +0100 Subject: Fix detection of N95 with linux 2.6.34+ Linux cdc-acm driver detects the debug port on some Nokia phones automatically When it does, it creates two ttyACMx devices and the symlink in /dev/serial/by-id contains the CDC master interface number. In contrast the generic usbserial driver creates a symlink containing the CDC slave interface number. This is because it knows nothing about CDC and is just looking for BULK IN/OUT interfaces that might be serial ports. This change creates match strings for both the master and slave interfaces, so the phone is detected if either driver is loaded. Reviewed-By: axis --- tools/runonphone/serenum_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp index db6375e..4491bd0 100644 --- a/tools/runonphone/serenum_unix.cpp +++ b/tools/runonphone/serenum_unix.cpp @@ -100,7 +100,7 @@ QList enumerateSerialPorts(int loglevel) // data transmission. // the extra info stores that as a index for the interface if (buf[0] >= 5 && buf[1] == 36 && buf[2] == 6) { // CDC Union - for (int i = 4; i < buf[0]; i++) + for (int i = 3; i < buf[0]; i++) usableInterfaces.append((int) buf[i]); } size -= buf[0]; -- cgit v0.12 From 763f3acd879648648465475aef773fe0876934a9 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 5 Nov 2010 14:27:48 +0100 Subject: Prevent multiple modprobe messages for the same phone Cleaned up some unnecessary code in the serenum_unix file. Add the device only once to the list used for printing info about devices with no serial drivers. Add each ACM interface ID, trusting the numbers given in the master interface. The existing code of searching for the slave interface would have been appropriate for a user-mode device driver, but we only need the interface numbers as we are going to use existing device drivers via the tty devices Reviewed-By: axis --- tools/runonphone/serenum_unix.cpp | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp index 4491bd0..f5b2521 100644 --- a/tools/runonphone/serenum_unix.cpp +++ b/tools/runonphone/serenum_unix.cpp @@ -146,32 +146,17 @@ QList enumerateSerialPorts(int loglevel) // second loop to find the actual data interface. foreach (int i, usableInterfaces) { - for (int m = 0; m < usbConfig.bNumInterfaces; ++m) { - for (int o = 0; o < usbConfig.interface[m].num_altsetting; ++o) { - struct usb_interface_descriptor &descriptor = usbConfig.interface[m].altsetting[o]; - if (descriptor.bInterfaceNumber != i) - continue; - if (descriptor.bInterfaceClass == 10) { // "CDC Data" - if (loglevel > 1) { - qDebug() << " found the data port" - << "bus:" << bus->dirname - << "device" << device->filename - << "interface" << descriptor.bInterfaceNumber; - } - // ### manufacturer and product strings are only readable as root :( - if (!manufacturerString.isEmpty() && !productString.isEmpty()) { - eligibleInterfaces << QString("usb-%1_%2-if%3") - .arg(manufacturerString.replace(QChar(' '), QChar('_'))) - .arg(productString.replace(QChar(' '), QChar('_'))) - .arg(i, 2, 16, QChar('0')); - } else { - eligibleInterfaces << QString("if%1").arg(i, 2, 16, QChar('0')); // fix! - } - eligibleInterfacesInfo << InterfaceInfo(manufacturerString, productString, device->descriptor.idVendor, device->descriptor.idProduct); - } - } + // ### manufacturer and product strings are only readable as root :( + if (!manufacturerString.isEmpty() && !productString.isEmpty()) { + eligibleInterfaces << QString("usb-%1_%2-if%3") + .arg(manufacturerString.replace(QChar(' '), QChar('_'))) + .arg(productString.replace(QChar(' '), QChar('_'))) + .arg(i, 2, 16, QChar('0')); + } else { + eligibleInterfaces << QString("if%1").arg(i, 2, 16, QChar('0')); // fix! } } + eligibleInterfacesInfo << InterfaceInfo(manufacturerString, productString, device->descriptor.idVendor, device->descriptor.idProduct); } } } -- cgit v0.12