diff options
author | Eike Ziller <[email protected]> | 2012-11-27 11:50:56 +0100 |
---|---|---|
committer | Eike Ziller <[email protected]> | 2012-11-27 11:50:56 +0100 |
commit | ba1d5f2cdf7d31eb862f02bd42885cdba13a7f15 (patch) | |
tree | 5c9d0551e67612724a2ca0328636b091653c1f00 /src | |
parent | c384f52b49f0eddc7a7f8e622e1485ebb1018028 (diff) | |
parent | deeef5308f1b3d59581aa1a65e781d434719a40d (diff) |
Merge remote-tracking branch 'origin/2.6'
Conflicts:
share/share.qbs
src/plugins/cpptools/cppchecksymbols.cpp
src/plugins/texteditor/behaviorsettingswidget.cpp
Change-Id: Ia34060984f9c036b2f28a6411d796d41f55a3e37
Diffstat (limited to 'src')
25 files changed, 80 insertions, 60 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp index a963816ae9d..c25affca026 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -359,7 +359,11 @@ int main(int argc, char **argv) const QString &creatorTrPath = QCoreApplication::applicationDirPath() + QLatin1String(SHARE_PATH "/translations"); foreach (QString locale, uiLanguages) { +#if (QT_VERSION >= 0x050000) + locale = QLocale(locale).name(); +#else locale.replace(QLatin1Char('-'), QLatin1Char('_')); // work around QTBUG-25973 +#endif if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) { const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); const QString &qtTrFile = QLatin1String("qt_") + locale; diff --git a/src/libs/utils/basetreeview.cpp b/src/libs/utils/basetreeview.cpp index cce091d75dd..4de87425623 100644 --- a/src/libs/utils/basetreeview.cpp +++ b/src/libs/utils/basetreeview.cpp @@ -70,6 +70,8 @@ BaseTreeView::BaseTreeView(QWidget *parent) connect(this, SIGNAL(activated(QModelIndex)), SLOT(rowActivatedHelper(QModelIndex))); + connect(this, SIGNAL(clicked(QModelIndex)), + SLOT(rowClickedHelper(QModelIndex))); connect(header(), SIGNAL(sectionClicked(int)), SLOT(headerSectionClicked(int))); diff --git a/src/libs/utils/basetreeview.h b/src/libs/utils/basetreeview.h index 46fd24b609c..d2694972bec 100644 --- a/src/libs/utils/basetreeview.h +++ b/src/libs/utils/basetreeview.h @@ -49,6 +49,7 @@ public: void setModel(QAbstractItemModel *model); virtual void rowActivated(const QModelIndex &) {} + virtual void rowClicked(const QModelIndex &) {} void mousePressEvent(QMouseEvent *ev); public slots: @@ -61,6 +62,7 @@ protected slots: private slots: void rowActivatedHelper(const QModelIndex &index) { rowActivated(index); } + void rowClickedHelper(const QModelIndex &index) { rowClicked(index); } void headerSectionClicked(int logicalIndex); private: diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 7fb9569e574..afa16144146 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1274,9 +1274,13 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri qDebug() << Q_FUNC_INFO << fileName << editorId.name(); QString fn = fileName; + QFileInfo fi(fn); int lineNumber = -1; - if (flags && EditorManager::CanContainLineNumber) + if ((flags & EditorManager::CanContainLineNumber) && !fi.exists()) { lineNumber = extractLineNumber(&fn); + if (lineNumber != -1) + fi.setFile(fn); + } if (fn.isEmpty()) return 0; @@ -1287,13 +1291,12 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri const QList<IEditor *> editors = editorsForFileName(fn); if (!editors.isEmpty()) { IEditor *editor = editors.first(); - if (flags && EditorManager::CanContainLineNumber) + if (flags & EditorManager::CanContainLineNumber) editor->gotoLine(lineNumber, -1); return activateEditor(view, editor, flags); } QString realFn = autoSaveName(fn); - QFileInfo fi(fn); QFileInfo rfi(realFn); if (!fi.exists() || !rfi.exists() || fi.lastModified() >= rfi.lastModified()) { QFile::remove(realFn); @@ -1327,7 +1330,7 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri if (editor == result) restoreEditorState(editor); - if (flags && EditorManager::CanContainLineNumber) + if (flags & EditorManager::CanContainLineNumber) editor->gotoLine(lineNumber, -1); QApplication::restoreOverrideCursor(); diff --git a/src/plugins/cpptools/cppchecksymbols.cpp b/src/plugins/cpptools/cppchecksymbols.cpp index 13f06b87bb7..5ccd79f9097 100644 --- a/src/plugins/cpptools/cppchecksymbols.cpp +++ b/src/plugins/cpptools/cppchecksymbols.cpp @@ -509,9 +509,11 @@ bool CheckSymbols::visit(SimpleDeclarationAST *ast) // Add a diagnostic message if non-virtual function has override/final marker if ((_usages.back().kind != SemanticInfo::VirtualMethodUse)) { if (funTy->isOverride()) - warning(declrIdNameAST, QCoreApplication::translate("CPlusplus::CheckSymbols", "Only virtual methods can be marked `override'")); + warning(declrIdNameAST, QCoreApplication::translate( + "CPlusplus::CheckSymbols", "Only virtual methods can be marked `override'")); else if (funTy->isFinal()) - warning(declrIdNameAST, QCoreApplication::translate("CPlusPlus::CheckSymbols", "Only virtual methods can be marked `final'")); + warning(declrIdNameAST, QCoreApplication::translate( + "CPlusPlus::CheckSymbols", "Only virtual methods can be marked `final'")); } } } diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 33b3c52197d..287b20c10b5 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -1415,6 +1415,10 @@ void DebuggerEngine::updateWatchData(const WatchData &, const WatchUpdateFlags & { } +void DebuggerEngine::watchDataSelected(const QByteArray &iname) +{ +} + void DebuggerEngine::watchPoint(const QPoint &) { } diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 3067bbe793e..563e19ba566 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -149,6 +149,8 @@ public: virtual void updateWatchData(const Internal::WatchData &data, const Internal::WatchUpdateFlags & flags = Internal::WatchUpdateFlags()); + virtual void watchDataSelected(const QByteArray &iname); + virtual void startDebugger(DebuggerRunControl *runControl); virtual void watchPoint(const QPoint &); diff --git a/src/plugins/debugger/qml/qmlcppengine.cpp b/src/plugins/debugger/qml/qmlcppengine.cpp index f1e789d55c8..f1eb0ed5191 100644 --- a/src/plugins/debugger/qml/qmlcppengine.cpp +++ b/src/plugins/debugger/qml/qmlcppengine.cpp @@ -34,6 +34,7 @@ #include "stackhandler.h" #include "qmlengine.h" #include "watchdata.h" +#include "watchhandler.h" #include <coreplugin/icore.h> #include <utils/qtcassert.h> @@ -135,6 +136,13 @@ void QmlCppEngine::updateWatchData(const WatchData &data, d->m_activeEngine->updateWatchData(data, flags); } +void QmlCppEngine::watchDataSelected(const QByteArray &iname) +{ + const WatchData *wd = watchHandler()->findData(iname); + if (wd && wd->isInspect()) + d->m_qmlEngine->watchDataSelected(iname); +} + void QmlCppEngine::watchPoint(const QPoint &point) { d->m_cppEngine->watchPoint(point); diff --git a/src/plugins/debugger/qml/qmlcppengine.h b/src/plugins/debugger/qml/qmlcppengine.h index 64f531277d8..a1c9534b752 100644 --- a/src/plugins/debugger/qml/qmlcppengine.h +++ b/src/plugins/debugger/qml/qmlcppengine.h @@ -50,6 +50,7 @@ public: TextEditor::ITextEditor * editor, const DebuggerToolTipContext &); void updateWatchData(const WatchData &data, const WatchUpdateFlags &flags); + void watchDataSelected(const QByteArray &iname); void watchPoint(const QPoint &); void fetchMemory(MemoryAgent *, QObject *, quint64 addr, quint64 length); diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index c2274c5e683..6e2885694b5 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -1026,6 +1026,13 @@ void QmlEngine::updateWatchData(const WatchData &data, watchHandler()->insertData(data); } +void QmlEngine::watchDataSelected(const QByteArray &iname) +{ + const WatchData *wd = watchHandler()->findData(iname); + if (wd && wd->isInspect()) + m_inspectorAdapter.agent()->watchDataSelected(wd); +} + void QmlEngine::synchronizeWatchers() { QStringList watchedExpressions = watchHandler()->watchedExpressions(); diff --git a/src/plugins/debugger/qml/qmlengine.h b/src/plugins/debugger/qml/qmlengine.h index fa1f3123838..befb33d5b6e 100644 --- a/src/plugins/debugger/qml/qmlengine.h +++ b/src/plugins/debugger/qml/qmlengine.h @@ -162,6 +162,7 @@ private: bool supportsThreads() const { return false; } void updateWatchData(const WatchData &data, const WatchUpdateFlags &flags); + void watchDataSelected(const QByteArray &iname); void executeDebuggerCommand(const QString &command, DebuggerLanguages languages); bool evaluateScript(const QString &expression); diff --git a/src/plugins/debugger/qml/qmlinspectoradapter.cpp b/src/plugins/debugger/qml/qmlinspectoradapter.cpp index aac3a9da834..092a6fb2f50 100644 --- a/src/plugins/debugger/qml/qmlinspectoradapter.cpp +++ b/src/plugins/debugger/qml/qmlinspectoradapter.cpp @@ -81,6 +81,8 @@ QmlInspectorAdapter::QmlInspectorAdapter(QmlAdapter *debugAdapter, { connect(m_agent, SIGNAL(objectFetched(QmlDebug::ObjectReference)), SLOT(onObjectFetched(QmlDebug::ObjectReference))); + connect(m_agent, SIGNAL(jumpToObjectDefinition(QmlDebug::FileReference)), + SLOT(jumpToObjectDefinitionInEditor(QmlDebug::FileReference))); QmlDebugConnection *connection = m_debugAdapter->connection(); DeclarativeEngineDebugClient *engineClient1 @@ -473,7 +475,7 @@ void QmlInspectorAdapter::showConnectionStatusMessage(const QString &message) m_engine->showMessage(_("QML Inspector: ") + message, LogStatus); } -void QmlInspectorAdapter::gotoObjectReferenceDefinition( +void QmlInspectorAdapter::jumpToObjectDefinitionInEditor( const FileReference &objSource) { if (m_cursorPositionChangedExternally) { @@ -508,7 +510,7 @@ void QmlInspectorAdapter::selectObject(const ObjectReference &obj, QList<ObjectReference>() << obj); if (target == EditorTarget) - gotoObjectReferenceDefinition(obj.source()); + jumpToObjectDefinitionInEditor(obj.source()); agent()->selectObjectInTree(obj.debugId()); } diff --git a/src/plugins/debugger/qml/qmlinspectoradapter.h b/src/plugins/debugger/qml/qmlinspectoradapter.h index 11833e31732..9f8e76032e0 100644 --- a/src/plugins/debugger/qml/qmlinspectoradapter.h +++ b/src/plugins/debugger/qml/qmlinspectoradapter.h @@ -96,6 +96,7 @@ private slots: void onReload(); void onReloaded(); void onDestroyedObject(int); + void jumpToObjectDefinitionInEditor(const QmlDebug::FileReference &objSource); private: void setActiveEngineClient(QmlDebug::BaseEngineDebugClient *client); @@ -103,8 +104,6 @@ private: void initializePreviews(); void showConnectionStatusMessage(const QString &message); - void gotoObjectReferenceDefinition(const QmlDebug::FileReference &objSource); - enum SelectionTarget { NoTarget, ToolTarget, EditorTarget }; void selectObject( const QmlDebug::ObjectReference &objectReference, diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp index cafbe8d243a..98ce44f9b74 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.cpp +++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp @@ -121,6 +121,17 @@ void QmlInspectorAgent::updateWatchData(const WatchData &data) } } +void QmlInspectorAgent::watchDataSelected(const WatchData *data) +{ + if (debug) + qDebug() << __FUNCTION__ << '(' << data->id << ')'; + + if (data->id) { + QTC_ASSERT(m_debugIdLocations.keys().contains(data->id), return); + emit jumpToObjectDefinition(m_debugIdLocations.value(data->id)); + } +} + bool QmlInspectorAgent::selectObjectInTree(int debugId) { if (debug) { diff --git a/src/plugins/debugger/qml/qmlinspectoragent.h b/src/plugins/debugger/qml/qmlinspectoragent.h index 7f60e5cd8f3..2bc2f1ba64c 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.h +++ b/src/plugins/debugger/qml/qmlinspectoragent.h @@ -60,6 +60,7 @@ public: void assignValue(const WatchData *data, const QString &expression, const QVariant &valueV); void updateWatchData(const WatchData &data); + void watchDataSelected(const WatchData *data); bool selectObjectInTree(int debugId); quint32 setBindingForObject(int objectDebugId, @@ -101,6 +102,7 @@ signals: void propertyChanged(int debugId, const QByteArray &propertyName, const QVariant &propertyValue); void automaticUpdateFailed(); + void jumpToObjectDefinition(const QmlDebug::FileReference &objSource); private slots: void updateStatus(); diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 89c66839acd..36295a91120 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -992,6 +992,11 @@ void WatchTreeView::setModel(QAbstractItemModel *model) SLOT(handleItemIsExpanded(QModelIndex))); } +void WatchTreeView::rowClicked(const QModelIndex &index) +{ + currentEngine()->watchDataSelected(currentEngine()->watchHandler()->watchData(index)->iname); +} + void WatchTreeView::handleItemIsExpanded(const QModelIndex &idx) { bool on = idx.data(LocalsExpandedRole).toBool(); diff --git a/src/plugins/debugger/watchwindow.h b/src/plugins/debugger/watchwindow.h index 16aaf5c9e2c..c284332a7b8 100644 --- a/src/plugins/debugger/watchwindow.h +++ b/src/plugins/debugger/watchwindow.h @@ -51,6 +51,7 @@ public: explicit WatchTreeView(Type type, QWidget *parent = 0); Type type() const { return m_type; } void setModel(QAbstractItemModel *model); + void rowClicked(const QModelIndex &index); void reset(); public slots: diff --git a/src/plugins/madde/maemoinstalltosysrootstep.cpp b/src/plugins/madde/maemoinstalltosysrootstep.cpp index 885c5764a52..eb145536d9d 100644 --- a/src/plugins/madde/maemoinstalltosysrootstep.cpp +++ b/src/plugins/madde/maemoinstalltosysrootstep.cpp @@ -341,14 +341,14 @@ bool MaemoMakeInstallToSysrootStep::init() const Qt4BuildConfiguration * const bc = qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration()); if (!bc) { - addOutput("Cannot deploy: No active build dconfiguration.", + addOutput(tr("Cannot deploy: No active build dconfiguration."), ErrorMessageOutput); return false; } const QtSupport::BaseQtVersion *const qtVersion = QtSupport::QtKitInformation::qtVersion(target()->kit()); if (!qtVersion) { - addOutput("Cannot deploy: Unusable build configuration.", + addOutput(tr("Cannot deploy: Unusable build configuration."), ErrorMessageOutput); return false; diff --git a/src/plugins/madde/maemoqemumanager.cpp b/src/plugins/madde/maemoqemumanager.cpp index eddcb42ab9d..1a569e3932e 100644 --- a/src/plugins/madde/maemoqemumanager.cpp +++ b/src/plugins/madde/maemoqemumanager.cpp @@ -87,7 +87,7 @@ MaemoQemuManager::MaemoQemuManager(QObject *parent) m_qemuStarterIcon.addFile(":/qt-maemo/images/qemu-stop.png", iconSize, QIcon::Normal, QIcon::On); - m_qemuAction = new QAction("MeeGo Emulator", this); + m_qemuAction = new QAction(tr("MeeGo Emulator"), this); m_qemuAction->setIcon(m_qemuStarterIcon.pixmap(iconSize)); m_qemuAction->setToolTip(tr("Start MeeGo Emulator")); connect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime())); diff --git a/src/plugins/qmljseditor/qmljspreviewrunner.cpp b/src/plugins/qmljseditor/qmljspreviewrunner.cpp index 07e2a044f33..54b84b1ce18 100644 --- a/src/plugins/qmljseditor/qmljspreviewrunner.cpp +++ b/src/plugins/qmljseditor/qmljspreviewrunner.cpp @@ -68,7 +68,7 @@ void QmlJSPreviewRunner::run(const QString &filename) Utils::QtcProcess::quoteArg(filename)); } else { - errorMessage = "No file specified."; + errorMessage = tr("No file specified."); } if (!errorMessage.isEmpty()) diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp index 10a66cc4c15..e7801c77cb8 100644 --- a/src/plugins/remotelinux/linuxdevicetester.cpp +++ b/src/plugins/remotelinux/linuxdevicetester.cpp @@ -124,7 +124,7 @@ void GenericLinuxDeviceTester::handleConnected() d->process = d->connection->createRemoteProcess("uname -rsm"); connect(d->process.data(), SIGNAL(closed(int)), SLOT(handleProcessFinished(int))); - emit progressMessage("Checking kernel version..."); + emit progressMessage(tr("Checking kernel version...")); d->state = RunningUname; d->process->start(); } @@ -172,7 +172,7 @@ void GenericLinuxDeviceTester::handlePortListReady() QTC_ASSERT(d->state == TestingPorts, return); if (d->portsGatherer.usedPorts().isEmpty()) { - emit progressMessage("All specified ports are available.\n"); + emit progressMessage(tr("All specified ports are available.\n")); } else { QString portList; foreach (const int port, d->portsGatherer.usedPorts()) diff --git a/src/plugins/remotelinux/packageuploader.cpp b/src/plugins/remotelinux/packageuploader.cpp index 1e27435f49c..e1ace23e298 100644 --- a/src/plugins/remotelinux/packageuploader.cpp +++ b/src/plugins/remotelinux/packageuploader.cpp @@ -110,7 +110,7 @@ void PackageUploader::handleSftpChannelInitialized() setState(Inactive); emit uploadFinished(tr("Package upload failed: Could not open file.")); } else { - emit progress("Starting upload..."); + emit progress(tr("Starting upload...")); setState(Uploading); } } diff --git a/src/plugins/texteditor/behaviorsettingswidget.cpp b/src/plugins/texteditor/behaviorsettingswidget.cpp index abc9549a07a..629fbcfc3c0 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.cpp +++ b/src/plugins/texteditor/behaviorsettingswidget.cpp @@ -174,10 +174,13 @@ void BehaviorSettingsWidget::assignedStorageSettings(StorageSettings *storageSet void BehaviorSettingsWidget::updateConstrainTooltipsBoxTooltip() const { - if (d->m_ui.constrainTooltipsBox->currentIndex() == 0) - d->m_ui.constrainTooltipsBox->setToolTip(tr("Display context-sensitive help or type information on mouseover.")); - else - d->m_ui.constrainTooltipsBox->setToolTip(tr("Display context-sensitive help or type information on Shift+Mouseover.")); + if (d->m_ui.constrainTooltipsBox->currentIndex() == 0) { + d->m_ui.constrainTooltipsBox->setToolTip( + tr("Display context-sensitive help or type information on mouseover.")); + } else { + d->m_ui.constrainTooltipsBox->setToolTip( + tr("Display context-sensitive help or type information on Shift+Mouseover.")); + } } void BehaviorSettingsWidget::setAssignedBehaviorSettings(const BehaviorSettings &behaviorSettings) diff --git a/src/shared/qtsingleapplication/qtsingleapplication.cpp b/src/shared/qtsingleapplication/qtsingleapplication.cpp index 7aa14dfe19e..602b8d0d4e0 100644 --- a/src/shared/qtsingleapplication/qtsingleapplication.cpp +++ b/src/shared/qtsingleapplication/qtsingleapplication.cpp @@ -59,36 +59,6 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char * sysInit(appId); } - -QtSingleApplication::QtSingleApplication(int &argc, char **argv, Type type) - : QApplication(argc, argv, type) -{ - sysInit(); -} - - -#if defined(Q_WS_X11) -QtSingleApplication::QtSingleApplication(Display* dpy, Qt::HANDLE visual, Qt::HANDLE colormap) - : QApplication(dpy, visual, colormap) -{ - sysInit(); -} - -QtSingleApplication::QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual, Qt::HANDLE cmap) - : QApplication(dpy, argc, argv, visual, cmap) -{ - sysInit(); -} - -QtSingleApplication::QtSingleApplication(Display* dpy, const QString &appId, - int argc, char **argv, Qt::HANDLE visual, Qt::HANDLE colormap) - : QApplication(dpy, argc, argv, visual, colormap) -{ - this->appId = appId; - sysInit(appId); -} -#endif - bool QtSingleApplication::event(QEvent *event) { if (event->type() == QEvent::FileOpen) { diff --git a/src/shared/qtsingleapplication/qtsingleapplication.h b/src/shared/qtsingleapplication/qtsingleapplication.h index efe74473f6e..ce6a098753a 100644 --- a/src/shared/qtsingleapplication/qtsingleapplication.h +++ b/src/shared/qtsingleapplication/qtsingleapplication.h @@ -40,11 +40,6 @@ class QtSingleApplication : public QApplication public: QtSingleApplication(int &argc, char **argv, bool GUIenabled = true); QtSingleApplication(const QString &id, int &argc, char **argv); - QtSingleApplication(int &argc, char **argv, Type type); -#if defined(Q_WS_X11) - explicit QtSingleApplication(Display *dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); - QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0); -#endif bool isRunning(qint64 pid = -1); @@ -63,10 +58,6 @@ public Q_SLOTS: //Obsolete methods: public: void initialize(bool = true); - -#if defined(Q_WS_X11) - QtSingleApplication(Display* dpy, const QString &id, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); -#endif // end obsolete methods Q_SIGNALS: |