diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/assistant/lib/fulltextsearch/qanalyzer.cpp | 10 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/bookmarkfiltermodel.cpp | 37 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/main.cpp | 3 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/mainwindow.cpp | 10 | ||||
-rw-r--r-- | tools/designer/src/components/formeditor/formwindowmanager.cpp | 1 | ||||
-rw-r--r-- | tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp | 15 | ||||
-rw-r--r-- | tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h | 18 | ||||
-rw-r--r-- | tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro | 2 | ||||
-rw-r--r-- | tools/qmeegographicssystemhelper/qmeegoswitchevent.h | 4 | ||||
-rw-r--r-- | tools/qml/qmlruntime.h | 2 | ||||
-rw-r--r-- | tools/runonphone/serenum_unix.cpp | 29 |
11 files changed, 94 insertions, 37 deletions
diff --git a/tools/assistant/lib/fulltextsearch/qanalyzer.cpp b/tools/assistant/lib/fulltextsearch/qanalyzer.cpp index 835b72e..56eae69 100644 --- a/tools/assistant/lib/fulltextsearch/qanalyzer.cpp +++ b/tools/assistant/lib/fulltextsearch/qanalyzer.cpp @@ -96,6 +96,11 @@ QCLuceneStandardAnalyzer::QCLuceneStandardAnalyzer(const QStringList &stopWords) tArray[stopWords.count()] = 0; d->analyzer = new lucene::analysis::standard::StandardAnalyzer(tArray); + + for (int i = 0; i < stopWords.count(); ++i) + delete [] tArray[i]; + + delete [] tArray; } @@ -147,6 +152,11 @@ QCLuceneStopAnalyzer::QCLuceneStopAnalyzer(const QStringList &stopWords) tArray[stopWords.count()] = 0; d->analyzer = new lucene::analysis::StopAnalyzer(tArray); + + for (int i = 0; i < stopWords.count(); ++i) + delete [] tArray[i]; + + delete [] tArray; } QStringList QCLuceneStopAnalyzer::englishStopWords() const diff --git a/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp b/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp index fe510a5..d60e537 100644 --- a/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp +++ b/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp @@ -54,25 +54,24 @@ void BookmarkFilterModel::setSourceModel(QAbstractItemModel *_sourceModel) { beginResetModel(); - disconnect(sourceModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, - SLOT(changed(QModelIndex, QModelIndex))); - - disconnect(sourceModel, SIGNAL(rowsInserted(QModelIndex, int, int)), - this, SLOT(rowsInserted(QModelIndex, int, int))); - - disconnect(sourceModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), - this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); - disconnect(sourceModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, - SLOT(rowsRemoved(QModelIndex, int, int))); - - disconnect(sourceModel, SIGNAL(layoutAboutToBeChanged()), this, - SLOT(layoutAboutToBeChanged())); - disconnect(sourceModel, SIGNAL(layoutChanged()), this, - SLOT(layoutChanged())); - - disconnect(sourceModel, SIGNAL(modelAboutToBeReset()), this, - SLOT(modelAboutToBeReset())); - disconnect(sourceModel, SIGNAL(modelReset()), this, SLOT(modelReset())); + if (sourceModel) { + disconnect(sourceModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), + this, SLOT(changed(QModelIndex, QModelIndex))); + disconnect(sourceModel, SIGNAL(rowsInserted(QModelIndex, int, int)), + this, SLOT(rowsInserted(QModelIndex, int, int))); + disconnect(sourceModel, + SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), this, + SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); + disconnect(sourceModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), + this, SLOT(rowsRemoved(QModelIndex, int, int))); + disconnect(sourceModel, SIGNAL(layoutAboutToBeChanged()), this, + SLOT(layoutAboutToBeChanged())); + disconnect(sourceModel, SIGNAL(layoutChanged()), this, + SLOT(layoutChanged())); + disconnect(sourceModel, SIGNAL(modelAboutToBeReset()), this, + SLOT(modelAboutToBeReset())); + disconnect(sourceModel, SIGNAL(modelReset()), this, SLOT(modelReset())); + } QAbstractProxyModel::setSourceModel(sourceModel); sourceModel = qobject_cast<BookmarkModel*> (_sourceModel); diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index e3eef34..5883f7b 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -292,7 +292,8 @@ void setupTranslation(const QString &fileName, const QString &dir) QTranslator *translator = new QTranslator(QCoreApplication::instance()); if (translator->load(fileName, dir)) { QCoreApplication::installTranslator(translator); - } else if (!fileName.endsWith(QLatin1String("en_US"))) { + } else if (!fileName.endsWith(QLatin1String("en_US")) + && !fileName.endsWith(QLatin1String("_C"))) { qWarning("Could not load translation file %s in directory %s.", qPrintable(fileName), qPrintable(dir)); } diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index d7d01da..7852104 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -106,7 +106,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) TRACE_OBJ setToolButtonStyle(Qt::ToolButtonFollowStyle); - setDockOptions(ForceTabbedDocks); // Has no effect; Qt bug? + setDockOptions(dockOptions() | AllowNestedDocks); QString collectionFile; if (usesDefaultCollection()) { @@ -199,6 +199,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) } QToolBar *toolBar = addToolBar(tr("Bookmark Toolbar")); + toolBar->setObjectName(QLatin1String("Bookmark Toolbar")); bookMarkManager->setBookmarksToolbar(toolBar); // Show the widget here, otherwise the restore geometry and state won't work @@ -218,8 +219,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) } else { tabifyDockWidget(contentDock, indexDock); tabifyDockWidget(indexDock, bookmarkDock); - tabifyDockWidget(bookmarkDock, openPagesDock); - tabifyDockWidget(openPagesDock, searchDock); + tabifyDockWidget(bookmarkDock, searchDock); contentDock->raise(); const QRect screen = QApplication::desktop()->screenGeometry(); resize(4*screen.width()/5, 4*screen.height()/5); @@ -460,10 +460,6 @@ void MainWindow::setupActions() menu->addAction(globalActions->printAction()); menu->addSeparator(); - m_closeTabAction = menu->addAction(tr("&Close Tab"), m_centralWidget, - SLOT(closeTab())); - m_closeTabAction->setShortcuts(QKeySequence::Close); - QIcon appExitIcon = QIcon::fromTheme("application-exit"); QAction *tmp; #ifdef Q_OS_WIN diff --git a/tools/designer/src/components/formeditor/formwindowmanager.cpp b/tools/designer/src/components/formeditor/formwindowmanager.cpp index ce809ff..ed854cf 100644 --- a/tools/designer/src/components/formeditor/formwindowmanager.cpp +++ b/tools/designer/src/components/formeditor/formwindowmanager.cpp @@ -192,6 +192,7 @@ bool FormWindowManager::eventFilter(QObject *o, QEvent *e) case QEvent::ToolTip: case QEvent::WhatsThis: case QEvent::WhatsThisClicked: + case QEvent::WinIdChange: case QEvent::DynamicPropertyChange: case QEvent::HoverEnter: case QEvent::HoverLeave: diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp index b660eb3..37cc417 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp @@ -45,6 +45,7 @@ #include <private/qapplication_p.h> #include <private/qgraphicssystem_runtime_p.h> #include <private/qpixmap_raster_p.h> +#include <private/qwindowsurface_gl_p.h> #include "qmeegoruntime.h" #include "qmeegoswitchevent.h" @@ -153,3 +154,17 @@ void QMeeGoGraphicsSystemHelper::setTranslucent(bool translucent) ENSURE_RUNNING_MEEGO; QMeeGoRuntime::setTranslucent(translucent); } + +void QMeeGoGraphicsSystemHelper::setSwapBehavior(SwapMode mode) +{ + ENSURE_RUNNING_MEEGO; + + if (mode == AutomaticSwap) + QGLWindowSurface::swapBehavior = QGLWindowSurface::AutomaticSwap; + else if (mode == AlwaysFullSwap) + QGLWindowSurface::swapBehavior = QGLWindowSurface::AlwaysFullSwap; + else if (mode == AlwaysPartialSwap) + QGLWindowSurface::swapBehavior = QGLWindowSurface::AlwaysPartialSwap; + else if (mode == KillSwap) + QGLWindowSurface::swapBehavior = QGLWindowSurface::KillSwap; +} diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h index 6df3c22..c8dccc2 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h @@ -186,6 +186,24 @@ public: on the top-level widget *before* you show it instead. */ static void setTranslucent(bool translucent); + + //! Used to specify the mode for swapping buffers in double-buffered GL rendering. + enum SwapMode { + AutomaticSwap, /**< Automatically choose netween full and partial updates (25% threshold) */ + AlwaysFullSwap, /**< Always do a full swap even if partial updates support present */ + AlwaysPartialSwap, /**< Always do a partial swap (if support present) no matter what threshold */ + KillSwap /**< Do not perform buffer swapping at all (no picture) */ + }; + + //! Sets the buffer swapping mode. + /*! + This can be only called when running with the meego graphics system. + The KillSwap mode can be specififed to effectively block painting. + + This functionality should be used only by applications counting on a specific behavior. + Most applications should use the default automatic behavior. + */ + static void setSwapBehavior(SwapMode mode); }; #endif diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro index 360847e..7639ad7 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro @@ -3,7 +3,7 @@ TARGET = QtMeeGoGraphicsSystemHelper include(../../src/qbase.pri) -QT += gui +QT += gui opengl INCLUDEPATH += '../../src/plugins/graphicssystems/meego' HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegoswitchevent.h diff --git a/tools/qmeegographicssystemhelper/qmeegoswitchevent.h b/tools/qmeegographicssystemhelper/qmeegoswitchevent.h index 0ddbd3d..462182f 100644 --- a/tools/qmeegographicssystemhelper/qmeegoswitchevent.h +++ b/tools/qmeegographicssystemhelper/qmeegoswitchevent.h @@ -52,7 +52,7 @@ when going to software mode. */ -class QMeeGoSwitchEvent : public QEvent +class Q_DECL_EXPORT QMeeGoSwitchEvent : public QEvent { public: @@ -83,7 +83,7 @@ public: The type is registered on first access. Use this to detect incoming QMeeGoSwitchEvents. */ - QEvent::Type eventNumber(); + static QEvent::Type eventNumber(); private: QString name; diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h index b43aa54..a70ffc9 100644 --- a/tools/qml/qmlruntime.h +++ b/tools/qml/qmlruntime.h @@ -188,8 +188,6 @@ private: ScriptOptions m_scriptOptions; QDeclarativeTester *tester; - QNetworkReply *wgtreply; - QString wgtdir; NetworkAccessManagerFactory *namFactory; bool useQmlFileBrowser; diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp index f5b2521..f5b616b 100644 --- a/tools/runonphone/serenum_unix.cpp +++ b/tools/runonphone/serenum_unix.cpp @@ -82,7 +82,7 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) for (struct usb_bus *bus = usb_get_busses(); bus; bus = bus->next) { for (struct usb_device *device = bus->devices; device; device = device->next) { - for (int n = 0; n < device->descriptor.bNumConfigurations; ++n) { + for (int n = 0; n < device->descriptor.bNumConfigurations && device->config; ++n) { struct usb_config_descriptor &usbConfig =device->config[n]; QList<int> usableInterfaces; for (int m = 0; m < usbConfig.bNumInterfaces; ++m) { @@ -146,6 +146,10 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) // second loop to find the actual data interface. foreach (int i, usableInterfaces) { +#ifdef Q_OS_MAC + eligibleInterfaces << QString("^cu\\.usbmodem.*%1$") + .arg(QString("%1").arg(descriptor.bInterfaceNumber, 1, 16).toUpper()); +#else // ### manufacturer and product strings are only readable as root :( if (!manufacturerString.isEmpty() && !productString.isEmpty()) { eligibleInterfaces << QString("usb-%1_%2-if%3") @@ -155,6 +159,7 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) } else { eligibleInterfaces << QString("if%1").arg(i, 2, 16, QChar('0')); // fix! } +#endif } eligibleInterfacesInfo << InterfaceInfo(manufacturerString, productString, device->descriptor.idVendor, device->descriptor.idProduct); } @@ -164,14 +169,24 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) if (loglevel > 1) qDebug() << " searching for interfaces:" << eligibleInterfaces; +#ifdef Q_OS_MAC + QDir dir("/dev/"); + bool allowAny = false; +#else QDir dir("/dev/serial/by-id/"); - foreach (const QFileInfo &info, dir.entryInfoList()) { + bool allowAny = eligibleInterfaces.isEmpty(); +#endif + foreach (const QFileInfo &info, dir.entryInfoList(QDir::System)) { if (!info.isDir()) { - bool usable = eligibleInterfaces.isEmpty(); + bool usable = allowAny; + QString friendlyName = info.fileName(); foreach (const QString &iface, eligibleInterfaces) { - if (info.fileName().contains(iface)) { + if (info.fileName().contains(QRegExp(iface))) { if (loglevel > 1) qDebug() << " found device file:" << info.fileName() << endl; +#ifdef Q_OS_MAC + friendlyName = eligibleInterfacesInfo[eligibleInterfaces.indexOf(iface)].product; +#endif usable = true; break; } @@ -180,7 +195,7 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) continue; SerialPortId id; - id.friendlyName = info.fileName(); + id.friendlyName = friendlyName; id.portName = info.canonicalFilePath(); list << id; } @@ -193,11 +208,15 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) << iface.manufacturer << "Product:" << iface.product +#ifdef Q_OS_LINUX << endl << " Load generic driver using:" << QString("sudo modprobe usbserial vendor=0x%1 product=0x%2") .arg(iface.manufacturerid, 4, 16, QChar('0')) .arg(iface.productid, 4, 16, QChar('0')); +#else + ; +#endif } } return list; |