summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-11-06 00:00:10 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-11-06 00:00:10 (GMT)
commit1f7fe30841f6bd3557c9c5d90faeaeb162c4a967 (patch)
tree6fe99fd907e3a416da68a7933b8839e3c7f8cbd2
parent0943eb0ac24d4d3b362805c020139b09f0f43f8c (diff)
parent84c519862aa3a089471af6fd2174b16a88c10844 (diff)
downloadQt-1f7fe30841f6bd3557c9c5d90faeaeb162c4a967.zip
Qt-1f7fe30841f6bd3557c9c5d90faeaeb162c4a967.tar.gz
Qt-1f7fe30841f6bd3557c9c5d90faeaeb162c4a967.tar.bz2
Merge branch 'master-upstream' into master-water
-rwxr-xr-xbin/elf2e32_qtwrapper.pl30
-rw-r--r--src/gui/widgets/qmainwindowlayout_mac.mm3
-rw-r--r--src/gui/widgets/qmainwindowlayout_p.h2
-rw-r--r--tools/runonphone/serenum_unix.cpp35
4 files changed, 31 insertions, 39 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);
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<QToolBar *, ToolBarSaveState> toolbarSaveState;
QHash<QString, QToolBar *> 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
diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp
index db6375e..f5b2521 100644
--- a/tools/runonphone/serenum_unix.cpp
+++ b/tools/runonphone/serenum_unix.cpp
@@ -100,7 +100,7 @@ QList<SerialPortId> 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];
@@ -146,32 +146,17 @@ QList<SerialPortId> 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);
}
}
}