Merge remote branch 'origin/2.2'

Conflicts:
	src/plugins/debugger/gdb/gdbengine.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h
	src/plugins/qt4projectmanager/qt-maemo/qt4maemotargetfactory.cpp
	src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h
This commit is contained in:
con
2011-04-01 09:53:09 +02:00
140 changed files with 1139 additions and 2743 deletions
+6 -1
View File
@@ -5,7 +5,7 @@ within the logs of Qt Creator sources. Simply check it out from the public git
repository. For example:
git clone git://gitorious.org/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline origin/master...origin/2.1
git log --cherry-pick --pretty=oneline origin/2.1...origin/2.2
General
* Added support for running user defined external tools (Tools->External)
@@ -153,6 +153,11 @@ Symbian Target
* Added support for the new on-device debugging agent (CODA)
Maemo Target
* Added Meego support.
* Added a device configuration wizard.
* Added a publishing wizard for Fremantle/extras-devel.
* On-demand creation of Desktop files.
* For Fremantle, it's possible to disable packaging again.
Designer
Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 110 KiB

+32 -2
View File
@@ -1097,6 +1097,9 @@
applications: predefined QML elements, your own QML components, and other
resources.
\o \gui Canvas is the working area where you create QML components and
design applications.
\o \gui {Properties} pane organizes the properties of the selected QML element
or QML component. You can also change the properties in the code editor.
@@ -1168,11 +1171,13 @@
The \gui Items pane displays the QML elements grouped by type: your own QML
components, basic elements, interaction elements, views, and widgets.
\omit
Sets of UI components with the MeeGo and Symbian look and feel have been
defined for Qt Quick. They are based on standard QML elements. To view the
UI components in \gui {QML Components}, click
\inlineimage qtcreator-filter.png
and select \gui {MeeGo Components} or \gui {Symbian Components}.
\endomit
\image qmldesigner-qml-components.png "QML Components pane"
@@ -1437,7 +1442,13 @@
\section2 Previewing Element Size
The width and height of the root item in a QML file determine the size of
the QML element. To experiment with different sizes, enter values in the
the QML element. You can reuse elements, such as buttons, in different
sizes in other QML files and design screens for use with different device
profiles, screen resolution, or screen orientation. The component size
might also be zero (0,0) if its final size is determined by property
bindings.
To experiment with different element sizes, enter values in the
\gui Height and \gui Width fields on the canvas toolbar. The changes are
displayed in the \gui States pane and on the canvas, but the property
values are not changed permanently in the QML file. You can permanently
@@ -1445,6 +1456,22 @@
\image qmldesigner-preview-size.png "Canvas width and height"
\section1 Specifying Canvas Size
To change the canvas size, select \gui {Tools > Options... > Qt Quick} and
specify the canvas width and height in the \gui Canvas group.
\section1 Refreshing the Canvas
When you open QML files in \QMLD, the QML elements in the file are drawn on
the canvas. When you edit the element properties in \QMLD, the QML file and
the image on the canvas might get out of sync. For example, when you change
the position of an item within a column or a row, the new position might
not be displayed correctly on the canvas.
To refresh the image on the canvas, press \key R or select the \gui {Reset
View} button on the canvas toolbar.
*/
@@ -1589,7 +1616,8 @@
As you write code, Qt Creator suggests properties, IDs, and code
snippets to complete the code. It provides a list of context-sensitive
suggestions to the statement currently under your cursor.
suggestions to the statement currently under your cursor. Press \key Tab
or \key Enter to accept the selected suggestion and complete the code.
\image qtcreator-codecompletion.png
@@ -7317,6 +7345,8 @@
For a custom target, you can build your own Python-enabled gdb.
Follow the instructions on
\l{http://developer.qt.nokia.com/wiki/QtCreatorBuildGdb}{Building Gdb}.
You must use at least Python version 2.5, but we recommend that you
use version 2.6.
\row
\o Debugging tools for Windows
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>NSHumanReadableCopyright</key>
<string>(C) 2008-2011 Nokia Corporation
@@ -20,9 +20,9 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<key>CFBundleIdentifier</key>
<string>com.nokia.qtcreator.qmldump</string>
<key>CFBundleVersion</key>
<string>2.1.83</string>
<string>$$QTCREATOR_VERSION</string>
<key>CFBundleShortVersionString</key>
<string>2.1.83</string>
<string>$$QTCREATOR_VERSION</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
@@ -1,7 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.1">
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist SYSTEM \"file://localhost/System/Library/DTDs/PropertyList.dtd\">
<plist version=\"0.1\">
<dict>
<key>NSHumanReadableCopyright</key>
<string>(C) 2008-2011 Nokia Corporation
Commercial Usage
Licensees holding valid Qt Commercial licenses may use this file in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
GNU Lesser General Public License Usage
Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation and appearing in the file LICENSE.LGPL included in the packaging of this file. Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</string>
<key>CFBundleIconFile</key>
<string>@ICON@</string>
<key>CFBundleIdentifier</key>
@@ -14,6 +23,10 @@
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleVersion</key>
<string>$$QTCREATOR_VERSION</string>
<key>CFBundleShortVersionString</key>
<string>$$QTCREATOR_VERSION</string>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
@@ -60,8 +60,9 @@ symbian {
LIBS += -lavkon -lcone
}
}
OTHER_FILES+=Info.plist
mac {
QMAKE_INFO_PLIST=Info_mac.plist
QMAKE_INFO_PLIST=Info.plist
TARGET=QMLObserver
ICON=qml.icns
} else {
+55 -32
View File
@@ -39,46 +39,16 @@ DATA_DIRS = \
generic-highlighter \
glsl
# files that are to be unconditionally "deployed" to the build dir from src/share to share
defineReplace(stripSrcResourceDir) {
win32 {
!contains(1, ^.:.*):1 = $$OUT_PWD/$$1
} else {
!contains(1, ^/.*):1 = $$OUT_PWD/$$1
}
out = $$cleanPath($$1)
out ~= s|^$$re_escape($$IDE_SOURCE_TREE/src/share/qtcreator/)||$$i_flag
return($$out)
}
DATA_FILES_SRC = \
externaltools/lrelease.xml \
externaltools/lupdate.xml \
externaltools/sort.xml
linux-*:DATA_FILES_SRC += externaltools/vi.xml
macx:DATA_FILES_SRC += externaltools/vi_mac.xml
win32:DATA_FILES_SRC += externaltools/notepad_win.xml
win32:DATA_FILES_SRC ~= s|\\\\|/|g
for(file, DATA_FILES_SRC):DATA_FILES += $$IDE_SOURCE_TREE/src/share/qtcreator/$$file
macx:OTHER_FILES += $$DATA_FILES
unconditionalCopy2build.input = DATA_FILES
unconditionalCopy2build.output = $$IDE_DATA_PATH/${QMAKE_FUNC_FILE_IN_stripSrcResourceDir}
isEmpty(vcproj):unconditionalCopy2build.variable_out = PRE_TARGETDEPS
win32:unconditionalCopy2build.commands = $$QMAKE_COPY \"${QMAKE_FILE_IN}\" \"${QMAKE_FILE_OUT}\"
unix:unconditionalCopy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
unconditionalCopy2build.name = COPY ${QMAKE_FILE_IN}
unconditionalCopy2build.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += unconditionalCopy2build
# conditionally deployed data
!isEmpty(copydata) {
for(data_dir, DATA_DIRS) {
files = $$files($$PWD/$$data_dir/*, true)
win32:files ~= s|\\\\|/|g
for(file, files):!exists($$file/*):FILES += $$file
for(file, files):!contains(file, ".*/Info\\.plist\\.in$"):!exists($$file/*):FILES += $$file
}
macx:OTHER_FILES += $$FILES
OTHER_FILES += $$FILES
copy2build.input = FILES
copy2build.output = $$IDE_DATA_PATH/${QMAKE_FUNC_FILE_IN_stripSrcDir}
isEmpty(vcproj):copy2build.variable_out = PRE_TARGETDEPS
@@ -95,4 +65,57 @@ QMAKE_EXTRA_COMPILERS += unconditionalCopy2build
eval($${data_dir}.path = /share/qtcreator)
INSTALLS += $$data_dir
}
} else {
# do version magic for app bundles
dumpinfo.input = qml/qmldump/Info.plist.in
dumpinfo.output = $$IDE_DATA_PATH/qml/qmldump/Info.plist
QMAKE_SUBSTITUTES += dumpinfo
observerinfo.input = qml/qmlobserver/Info.plist.in
observerinfo.output = $$IDE_DATA_PATH/qml/qmlobserver/Info.plist
QMAKE_SUBSTITUTES += observerinfo
}
SRCRESOURCEDIR = $$IDE_SOURCE_TREE/src/share/qtcreator/
defineReplace(stripSrcResourceDir) {
win32 {
!contains(1, ^.:.*):1 = $$OUT_PWD/$$1
} else {
!contains(1, ^/.*):1 = $$OUT_PWD/$$1
}
out = $$cleanPath($$1)
out ~= s|^$$re_escape($$SRCRESOURCEDIR)||$$i_flag
return($$out)
}
# files that are to be unconditionally "deployed" to the build dir from src/share to share
DATA_DIRS = \
externaltools
DATA_FILES_SRC = \
externaltools/lrelease.xml \
externaltools/lupdate.xml \
externaltools/sort.xml
unix {
macx:DATA_FILES_SRC += externaltools/vi_mac.xml
else:DATA_FILES_SRC += externaltools/vi.xml
} else {
DATA_FILES_SRC += externaltools/notepad_win.xml
}
for(file, DATA_FILES_SRC):DATA_FILES += $${SRCRESOURCEDIR}$$file
OTHER_FILES += $$DATA_FILES
unconditionalCopy2build.input = DATA_FILES
unconditionalCopy2build.output = $$IDE_DATA_PATH/${QMAKE_FUNC_FILE_IN_stripSrcResourceDir}
isEmpty(vcproj):unconditionalCopy2build.variable_out = PRE_TARGETDEPS
win32:unconditionalCopy2build.commands = $$QMAKE_COPY \"${QMAKE_FILE_IN}\" \"${QMAKE_FILE_OUT}\"
unix:unconditionalCopy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
unconditionalCopy2build.name = COPY ${QMAKE_FILE_IN}
unconditionalCopy2build.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += unconditionalCopy2build
!macx {
for(data_dir, DATA_DIRS) {
eval($${data_dir}.files = $$IDE_DATA_PATH/$$data_dir)
eval($${data_dir}.path = /share/qtcreator)
eval($${data_dir}.CONFIG += no_check_exist)
INSTALLS += $$data_dir
}
}
+1 -1
View File
@@ -4,7 +4,7 @@ Version=1.0
Type=Application
Terminal=false
Name=thisApp
Exec=/opt/usr/bin/thisApp
Exec=/opt/thisApp/bin/thisApp
Icon=thisApp
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
@@ -31,7 +31,14 @@ symbian {
target = $$replace(target, /, \\)
!isEqual(source,$$target) {
!isEmpty(copyCommand):copyCommand += &&
isEmpty(QMAKE_SH) {
copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
} else {
source = $$replace(source, \\\\, /)
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
target = $$replace(target, \\\\, /)
copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
}
}
}
!isEmpty(copyCommand) {
@@ -50,13 +57,13 @@ symbian {
copyCommand =
for(deploymentfolder, DEPLOYMENTFOLDERS) {
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
source = $$replace(source, \\, /)
source = $$replace(source, \\\\, /)
macx {
target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
} else {
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
}
target = $$replace(target, \\, /)
target = $$replace(target, \\\\, /)
sourcePathSegments = $$split(source, /)
targetFullPath = $$target/$$last(sourcePathSegments)
!isEqual(source,$$targetFullPath) {
@@ -29,7 +29,7 @@ qmldir.files = qmldir
symbian {
# ...
} else:unix {
installPath = /usr/lib/qt4/imports/$$replace(uri, \., /)
installPath = /usr/lib/qt4/imports/$$replace(uri, \\., /)
qmldir.path = $$installPath
target.path = $$installPath
INSTALLS += target qmldir
+5 -2
View File
@@ -255,15 +255,18 @@ int main(int argc, char **argv)
}
// Make sure we honor the system's proxy settings
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
#if defined(Q_OS_UNIX)
QUrl proxyUrl(QString::fromLatin1(qgetenv("http_proxy")));
if (proxyUrl.isValid()) {
QNetworkProxy proxy(QNetworkProxy::HttpProxy, proxyUrl.host(),
proxyUrl.port(), proxyUrl.userName(), proxyUrl.password());
QNetworkProxy::setApplicationProxy(proxy);
}
#else
#if defined(Q_OS_MAC)
else {
QNetworkProxyFactory::setUseSystemConfiguration(true);
}
#endif
#endif
// Load
const QStringList pluginPaths = getPluginPaths();
+67 -5
View File
@@ -22,10 +22,17 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="name"/>
<widget class="QLabel" name="name">
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
@@ -35,10 +42,17 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="version"/>
<widget class="QLabel" name="version">
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
@@ -48,10 +62,17 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="compatVersion"/>
<widget class="QLabel" name="compatVersion">
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
@@ -61,10 +82,17 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="vendor"/>
<widget class="QLabel" name="vendor">
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_6">
@@ -74,6 +102,9 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="5" column="1">
@@ -81,6 +112,9 @@
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item row="6" column="0">
@@ -91,6 +125,9 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="6" column="1">
@@ -98,6 +135,9 @@
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item row="7" column="0">
@@ -110,6 +150,9 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
@@ -145,10 +188,17 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="copyright"/>
<widget class="QLabel" name="copyright">
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="9" column="0">
<layout class="QVBoxLayout">
@@ -160,6 +210,9 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
@@ -197,6 +250,9 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
@@ -225,6 +281,9 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="1">
@@ -232,6 +291,9 @@
<property name="text">
<string/>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
+2 -1
View File
@@ -81,7 +81,8 @@ static inline void dump64bitPointerArray(std::ostream &os, const void *a, int co
static inline std::string fixInnerType(std::string type,
const SymbolGroupValue &container)
{
const std::string stripped = SymbolGroupValue::stripClassPrefixes(type);
const std::string stripped
= SymbolGroupValue::stripConst(SymbolGroupValue::stripClassPrefixes(type));
const KnownType kt = knownType(stripped, 0);
// Resolve types unless they are POD or pointers to POD (that is, qualify 'Foo' and 'Foo*')
const bool needResolve = kt == KT_Unknown || kt == KT_PointerType || !(kt & KT_POD_Type);
@@ -1095,9 +1095,11 @@ extern "C" HRESULT CALLBACK test(CIDebugClient *client, PCSTR argsIn)
break;
case TestType: {
const KnownType kt = knownType(testType, 0);
str << testType << ' ' << kt << " [";
const std::string fixed = SymbolGroupValue::stripConst(testType);
const unsigned size = SymbolGroupValue::sizeOf(fixed.c_str());
str << '"' << testType << "\" (" << fixed << ") " << kt << " [";
formatKnownTypeFlags(str, kt);
str << ']';
str << "] size=" << size;
}
break;
case TestFixWatchExpression:
@@ -389,6 +389,31 @@ std::string SymbolGroupValue::stripClassPrefixes(const std::string &type)
return rc;
}
// Strip " const" from end of type ("XX const", "XX const *[*]"
std::string SymbolGroupValue::stripConst(const std::string &type)
{
const std::string::size_type constPos = type.rfind(" const");
if (constPos == std::string::npos)
return type;
// Strip 'const' only if it is at the end 'QString const'
// or of some pointer like 'foo ***'
std::string rc = type;
const std::string::size_type size = rc.size();
std::string::size_type nextPos = constPos + 6;
if (nextPos == size) { // Ends with - easy.
rc.erase(constPos, nextPos - constPos);
return rc;
}
// Ensure it ends with ' ****'.
if (rc.at(nextPos) != ' ')
return rc;
for (std::string::size_type i = nextPos + 1; i < size; ++i)
if (rc.at(i) != '*')
return rc;
rc.erase(constPos, nextPos - constPos);
return rc;
}
std::string SymbolGroupValue::addPointerType(const std::string &t)
{
// 'char' -> 'char *' -> 'char **'
@@ -105,6 +105,9 @@ public:
static std::string stripPointerType(const std::string &);
// Strip "class ", "struct "
static std::string stripClassPrefixes(const std::string &);
// Strip " const" from "char const*", (map key), "QString const", etc.
// which otherwise causes GetTypeSize to fail.
static std::string stripConst(const std::string &type);
static std::string addPointerType(const std::string &);
static std::string stripArrayType(const std::string &);
static std::string stripModuleFromType(const std::string &type);
+5
View File
@@ -65,6 +65,11 @@ QString ConsoleProcess::msgCannotCreateTempFile(const QString &why)
return tr("Cannot create temporary file: %1").arg(why);
}
QString ConsoleProcess::msgCannotWriteTempFile()
{
return tr("Cannot write temporary file. Disk full?");
}
QString ConsoleProcess::msgCannotCreateTempDir(const QString & dir, const QString &why)
{
return tr("Cannot create temporary directory '%1': %2").arg(dir, why);
+1
View File
@@ -104,6 +104,7 @@ private:
static QString msgCommChannelFailed(const QString &error);
static QString msgPromptToClose();
static QString msgCannotCreateTempFile(const QString &why);
static QString msgCannotWriteTempFile();
static QString msgCannotCreateTempDir(const QString & dir, const QString &why);
static QString msgUnexpectedOutput(const QByteArray &what);
static QString msgCannotChangeToWorkDir(const QString & dir, const QString &why);
+10 -3
View File
@@ -173,11 +173,18 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
d->m_tempFile = 0;
return false;
}
QByteArray contents;
foreach (const QString &var, env) {
d->m_tempFile->write(var.toLocal8Bit());
d->m_tempFile->write("", 1);
QByteArray l8b = var.toLocal8Bit();
contents.append(l8b.constData(), l8b.size() + 1);
}
if (d->m_tempFile->write(contents) != contents.size() || !d->m_tempFile->flush()) {
stubServerShutdown();
emit processMessage(msgCannotWriteTempFile(), true);
delete d->m_tempFile;
d->m_tempFile = 0;
return false;
}
d->m_tempFile->flush();
}
xtermArgs
+10
View File
@@ -157,6 +157,16 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
foreach (const QString &var, fixWinEnvironment(env))
out << var << QChar(0);
out << QChar(0);
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
out.flush();
if (out.status() != QTextStream::Ok) {
stubServerShutdown();
emit processMessage(msgCannotWriteTempFile(), true);
delete d->m_tempFile;
d->m_tempFile = 0;
return false;
}
#endif
}
STARTUPINFO si;
+4 -2
View File
@@ -178,7 +178,8 @@ void runFileSearch(QFutureInterface<FileSearchResultList> &future,
}
++numFilesSearched;
if (future.isProgressUpdateNeeded()) {
if (future.isProgressUpdateNeeded()
|| future.progressValue() == 0 /*workaround for regression in Qt*/) {
if (!results.isEmpty()) {
future.reportResult(results);
results.clear();
@@ -256,7 +257,8 @@ void runFileSearchRegExp(QFutureInterface<FileSearchResultList> &future,
++lineNr;
}
++numFilesSearched;
if (future.isProgressUpdateNeeded()) {
if (future.isProgressUpdateNeeded()
|| future.progressValue() == 0 /*workaround for regression in Qt*/) {
if (!results.isEmpty()) {
future.reportResult(results);
results.clear();
+8 -2
View File
@@ -61,8 +61,8 @@ NavigationTreeView::NavigationTreeView(QWidget *parent)
setAttribute(Qt::WA_MacShowFocusRect, false);
setHeaderHidden(true);
// show horizontal scrollbar
// We let the column adjust to contents, but note
// the setting of a minimum size in resizeEvent()
header()->setResizeMode(QHeaderView::ResizeToContents);
header()->setStretchLastSection(false);
}
@@ -82,6 +82,12 @@ void NavigationTreeView::focusOutEvent(QFocusEvent *event)
QTreeView::focusOutEvent(event);
}
void NavigationTreeView::resizeEvent(QResizeEvent *event)
{
header()->setMinimumSectionSize(viewport()->width());
QTreeView::resizeEvent(event);
}
#ifdef Q_WS_MAC
void NavigationTreeView::keyPressEvent(QKeyEvent *event)
{
+1
View File
@@ -49,6 +49,7 @@ public:
protected:
void focusInEvent(QFocusEvent *event);
void focusOutEvent(QFocusEvent *event);
void resizeEvent(QResizeEvent *event);
#ifdef Q_WS_MAC
void keyPressEvent(QKeyEvent *event);
+11 -3
View File
@@ -34,10 +34,7 @@
#include "qtcprocess.h"
#include "stringutils.h"
#ifdef Q_OS_WIN
#include <QtCore/QDir>
#endif
#include <QtCore/QDebug>
using namespace Utils;
@@ -311,6 +308,16 @@ QStringList QtcProcess::splitArgs(const QString &args, bool abortOnMeta, SplitEr
} while (c.isSpace());
QString cret;
bool hadWord = false;
if (c == QLatin1Char('~')) {
if (pos >= args.length()
|| args.unicode()[pos].isSpace() || args.unicode()[pos] == QLatin1Char('/')) {
cret = QDir::homePath();
hadWord = true;
goto getc;
} else if (abortOnMeta) {
goto metaerr;
}
}
do {
if (c == QLatin1Char('\'')) {
int spos = pos;
@@ -449,6 +456,7 @@ QStringList QtcProcess::splitArgs(const QString &args, bool abortOnMeta, SplitEr
cret += c;
hadWord = true;
}
getc:
if (pos >= args.length())
break;
c = args.unicode()[pos++];
+12 -3
View File
@@ -453,12 +453,21 @@ void AnalyzerManager::AnalyzerManagerPrivate::startTool()
ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance();
ProjectExplorer::Project *pro = pe->startupProject();
// ### not sure if we're supposed to check if the RunConFiguration isEnabled
if (!pro || !pro->activeTarget()->activeRunConfiguration()->isEnabled())
ProjectExplorer::Project *pro = pe->startupProject();
const ProjectExplorer::RunConfiguration *runConfig = 0;
ProjectExplorer::BuildConfiguration::BuildType buildType = ProjectExplorer::BuildConfiguration::Unknown;
if (pro) {
if (const ProjectExplorer::Target *target = pro->activeTarget()) {
runConfig = target->activeRunConfiguration();
// Build configuration is 0 for QML projects.
if (const ProjectExplorer::BuildConfiguration *buildConfig = target->activeBuildConfiguration())
buildType = buildConfig->buildType();
}
}
if (!runConfig || !runConfig->isEnabled())
return;
ProjectExplorer::BuildConfiguration::BuildType buildType = pro->activeTarget()->activeBuildConfiguration()->buildType();
IAnalyzerTool::ToolMode toolMode = q->currentTool()->mode();
// check the project for whether the build config is in the correct mode
@@ -83,7 +83,6 @@ NavigationWidget::NavigationWidget(QWidget *parent) :
// tree model
d_ptr->treeModel = new TreeItemModel(this);
d_ptr->ui->treeView->header()->setStretchLastSection(true);
d_ptr->ui->treeView->setModel(d_ptr->treeModel);
// connect signal/slots
@@ -292,23 +292,23 @@ void CMakeRunPage::initWidgets()
if (m_cmakeWizard->cmakeManager()->isCMakeExecutableValid()) {
m_cmakeExecutable = 0;
} else {
QString text = tr("Please specify the path to the CMake executable. No CMake executable was found in the path.");
QString text = tr("Please specify the path to the cmake executable. No cmake executable was found in the path.");
QString cmakeExecutable = m_cmakeWizard->cmakeManager()->cmakeExecutable();
if (!cmakeExecutable.isEmpty()) {
QFileInfo fi(cmakeExecutable);
if (!fi.exists())
text += tr(" The CMake executable (%1) does not exist.").arg(cmakeExecutable);
text += tr(" The cmake executable (%1) does not exist.").arg(cmakeExecutable);
else if (!fi.isExecutable())
text += tr(" The path %1 is not a executable.").arg(cmakeExecutable);
else
text += tr(" The path %1 is not a valid CMake.").arg(cmakeExecutable);
text += tr(" The path %1 is not a valid cmake.").arg(cmakeExecutable);
}
fl->addRow(new QLabel(text, this));
// Show a field for the user to enter
m_cmakeExecutable = new Utils::PathChooser(this);
m_cmakeExecutable->setExpectedKind(Utils::PathChooser::ExistingCommand);
fl->addRow("CMake Executable", m_cmakeExecutable);
fl->addRow("cmake Executable", m_cmakeExecutable);
}
// Run CMake Line (with arguments)
@@ -479,7 +479,7 @@ void CMakeRunPage::runCMake()
m_runCMake->setEnabled(true);
m_argumentsLineEdit->setEnabled(true);
m_generatorComboBox->setEnabled(true);
m_output->appendPlainText(tr("No valid CMake executable specified."));
m_output->appendPlainText(tr("No valid cmake executable specified."));
}
}
@@ -523,7 +523,7 @@ void CMakeRunPage::cmakeFinished()
if (m_cmakeProcess->exitCode() != 0) {
m_exitCodeLabel->setVisible(true);
m_exitCodeLabel->setText(tr("CMake exited with errors. Please check cmake output."));
m_exitCodeLabel->setText(tr("CMake exited with errors. Please check CMake output."));
m_complete = false;
} else {
m_exitCodeLabel->setVisible(false);
@@ -79,13 +79,13 @@ CMakeManager::CMakeManager(CMakeSettingsPage *cmakeSettingsPage)
Core::ActionContainer *msubproject =
am->actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT);
m_runCMakeAction = new QAction(QIcon(), tr("Run cmake"), this);
m_runCMakeAction = new QAction(QIcon(), tr("Run CMake"), this);
Core::Command *command = am->registerAction(m_runCMakeAction, Constants::RUNCMAKE, m_projectContext);
command->setAttribute(Core::Command::CA_Hide);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_PROJECT);
connect(m_runCMakeAction, SIGNAL(triggered()), this, SLOT(runCMake()));
m_runCMakeActionContextMenu = new QAction(QIcon(), tr("Run cmake"), this);
m_runCMakeActionContextMenu = new QAction(QIcon(), tr("Run CMake"), this);
command = am->registerAction(m_runCMakeActionContextMenu, Constants::RUNCMAKECONTEXTMENU, m_projectContext);
command->setAttribute(Core::Command::CA_Hide);
mproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
@@ -318,6 +318,8 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
// The order of the slot connection matters here, the filter slot
// opens the matching page after the model has filtered.
connect(m_filterLineEdit, SIGNAL(filterChanged(QString)),
this, SLOT(ensureAllCategoryWidgets()));
connect(m_filterLineEdit, SIGNAL(filterChanged(QString)),
m_proxyModel, SLOT(setFilterFixedString(QString)));
connect(m_filterLineEdit, SIGNAL(filterChanged(QString)), this, SLOT(filter(QString)));
@@ -88,6 +88,7 @@ private slots:
void currentChanged(const QModelIndex &current);
void currentTabChanged(int);
void filter(const QString &text);
void ensureAllCategoryWidgets();
private:
SettingsDialog(QWidget *parent);
@@ -98,7 +99,6 @@ private:
void showPage(const QString &categoryId, const QString &pageId);
void updateEnabledTabs(Category *category, const QString &searchText);
void ensureCategoryWidget(Category *category);
void ensureAllCategoryWidgets();
void disconnectTabWidgets();
const QList<Core::IOptionsPage*> m_pages;
@@ -390,7 +390,7 @@ int ShortcutSettings::translateModifiers(Qt::KeyboardModifiers state,
// that is only reachable using the shift key anyway
if ((state & Qt::ShiftModifier) && (text.size() == 0
|| !text.at(0).isPrint()
|| text.at(0).isLetter()
|| text.at(0).isLetterOrNumber()
|| text.at(0).isSpace()))
result |= Qt::SHIFT;
if (state & Qt::ControlModifier)
+36 -2
View File
@@ -33,13 +33,13 @@
#include "messageoutputwindow.h"
#include <QtGui/QTextEdit>
#include <QtGui/QScrollBar>
using namespace Core::Internal;
MessageOutputWindow::MessageOutputWindow()
{
m_widget = new QTextEdit;
m_widget = new TextView;
m_widget->setReadOnly(true);
m_widget->setFrameStyle(QFrame::NoFrame);
}
@@ -86,7 +86,10 @@ void MessageOutputWindow::visibilityChanged(bool /*b*/)
void MessageOutputWindow::append(const QString &text)
{
bool scroll = m_widget->isScrollbarAtBottom() || !m_widget->isVisible();
m_widget->append(text);
if (scroll)
m_widget->scrollToBottom();
}
int MessageOutputWindow::priorityInStatusBar() const
@@ -118,3 +121,34 @@ bool MessageOutputWindow::canNavigate()
{
return false;
}
// -------- Copied from OutputWindow which should be shared instead
bool TextView::isScrollbarAtBottom() const
{
return verticalScrollBar()->value() == verticalScrollBar()->maximum();
}
void TextView::scrollToBottom()
{
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
}
void TextView::showEvent(QShowEvent *e)
{
bool atBottom = isScrollbarAtBottom();
QTextEdit::showEvent(e);
if (atBottom)
scrollToBottom();
}
void TextView::resizeEvent(QResizeEvent *e)
{
//Keep scrollbar at bottom of window while resizing, to ensure we keep scrolling
//This can happen if window is resized while building, or if the horizontal scrollbar appears
bool atBottom = isScrollbarAtBottom();
QTextEdit::resizeEvent(e);
if (atBottom)
scrollToBottom();
}
+19 -4
View File
@@ -36,13 +36,28 @@
#include <coreplugin/ioutputpane.h>
QT_BEGIN_NAMESPACE
class QTextEdit;
QT_END_NAMESPACE
#include <QtGui/QShowEvent>
#include <QtGui/QResizeEvent>
#include <QtGui/QTextEdit>
namespace Core {
namespace Internal {
class TextView : public QTextEdit
{
Q_OBJECT
public:
TextView(QWidget *parent = 0) : QTextEdit(parent) {}
void showEvent(QShowEvent *);
void scrollToBottom();
bool isScrollbarAtBottom() const;
protected:
void resizeEvent(QResizeEvent *e);
};
class MessageOutputWindow : public Core::IOutputPane
{
Q_OBJECT
@@ -71,7 +86,7 @@ public:
bool canNavigate();
private:
QTextEdit *m_widget;
TextView *m_widget;
};
} // namespace Internal
+10 -1
View File
@@ -144,7 +144,16 @@ void VariableChooser::createIconButton()
m_iconButton->setPixmap(QPixmap(QLatin1String(":/core/images/replace.png")));
m_iconButton->setToolTip(tr("Insert variable"));
m_iconButton->hide();
connect(m_iconButton, SIGNAL(clicked()), this, SLOT(show()));
connect(m_iconButton, SIGNAL(clicked()), this, SLOT(updatePositionAndShow()));
}
void VariableChooser::updatePositionAndShow()
{
if (parentWidget()) {
QPoint parentCenter = parentWidget()->mapToGlobal(parentWidget()->geometry().center());
move(parentCenter.x() - width()/2, parentCenter.y() - height()/2);
}
show();
}
void VariableChooser::handleItemActivated(QListWidgetItem *item)
+1
View File
@@ -64,6 +64,7 @@ private slots:
void updateCurrentEditor(QWidget *old, QWidget *widget);
void handleItemActivated(QListWidgetItem *item);
void insertVariable(const QString &variable);
void updatePositionAndShow();
private:
void createIconButton();
-95
View File
@@ -1,95 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AttachTcfDialog</class>
<widget class="QDialog" name="AttachTcfDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>310</width>
<height>224</height>
</rect>
</property>
<property name="windowTitle">
<string>Start Debugger</string>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>9</number>
</property>
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="channelLabel">
<property name="text">
<string>Host and port:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="channelLineEdit">
<property name="text">
<string notr="true">localhost:5115</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="architectureLabel">
<property name="text">
<string>Architecture:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="architectureComboBox"/>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="useServerStartScriptCheckBox"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="useServerStartScriptLabel">
<property name="text">
<string>Use server start script:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Utils::PathChooser" name="serverStartScript" native="true"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="serverStartScriptLabel">
<property name="text">
<string>Server start script:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::PathChooser</class>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+3 -3
View File
@@ -106,8 +106,8 @@ static QString typeToString(BreakpointType type)
return msgBreakpointAtSpecialFunc("fork");
case BreakpointAtExec:
return msgBreakpointAtSpecialFunc("exec");
case BreakpointAtVFork:
return msgBreakpointAtSpecialFunc("vfork");
//case BreakpointAtVFork:
// return msgBreakpointAtSpecialFunc("vfork");
case BreakpointAtSysCall:
return msgBreakpointAtSpecialFunc("syscall");
case BreakpointAtMain:
@@ -512,7 +512,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
|| data.type == BreakpointAtCatch
|| data.type == BreakpointAtFork
|| data.type == BreakpointAtExec
|| data.type == BreakpointAtVFork
//|| data.type == BreakpointAtVFork
|| data.type == BreakpointAtSysCall)
return typeToString(data.type);
if (data.type == Watchpoint)
+1 -1
View File
@@ -128,7 +128,7 @@ QString BreakpointParameters::toString() const
case BreakpointAtMain:
case BreakpointAtFork:
case BreakpointAtExec:
case BreakpointAtVFork:
//case BreakpointAtVFork:
case BreakpointAtSysCall:
case UnknownType:
break;
+1 -1
View File
@@ -61,7 +61,7 @@ enum BreakpointType
BreakpointAtMain,
BreakpointAtFork,
BreakpointAtExec,
BreakpointAtVFork,
//BreakpointAtVFork,
BreakpointAtSysCall,
Watchpoint
};
+14 -10
View File
@@ -122,12 +122,16 @@ BreakpointDialog::BreakpointDialog(unsigned engineCapabilities, QWidget *parent)
// Match BreakpointType (omitting unknown type).
m_ui.setupUi(this);
QStringList types;
types << tr("File and Line Number") << tr("Function Name") << tr("Address")
<< tr("throw") << tr("catch")
<< tr("Function \"main()\"")
<< tr("fork") << tr("exec")
<< tr("vfork") << tr("syscall")
<< tr("Address (Watchpoint)");
types << tr("File and Line Number")
<< tr("Function Name")
<< tr("Address")
<< tr("Break when C++ Exception is Thrown")
<< tr("Break when C++ Exception is Caught")
<< tr("Break when Function \"main()\" Starts")
<< tr("Break when a new Process is Forked")
<< tr("Break when a new Process is Executed")
<< tr("Break when a System Call is Executed")
<< tr("Break on Data Access (Watchpoint)");
QTC_ASSERT(types.size() == Watchpoint, return; )
m_ui.comboBoxType->addItems(types);
m_ui.pathChooserFileName->setExpectedKind(Utils::PathChooser::File);
@@ -140,7 +144,7 @@ BreakpointDialog::BreakpointDialog(unsigned engineCapabilities, QWidget *parent)
m_ui.lineEditModule->setToolTip(moduleToolTip);
const QString commandToolTip =
tr("Debugger command to be executed when the breakpoint is hit.\n"
"gdb allows for specifying a sequence of commands separated by "
"GDB allows for specifying a sequence of commands separated by "
"the delimiter '\\n'.");
m_ui.lineEditCommand->setToolTip(commandToolTip);
m_ui.labelCommand->setToolTip(commandToolTip);
@@ -157,7 +161,7 @@ BreakpointDialog::BreakpointDialog(unsigned engineCapabilities, QWidget *parent)
"<li><i>Use File Name</i>: Pass the file name only. This is "
"useful when using a source tree whose location does "
"not match the one used when building the modules. "
"It is the engine default for gdb as using full paths can "
"It is the engine default for GDB as using full paths can "
"be slow with this engine.</li>"
"</ul></body></html>");
m_ui.labelUseFullPath->setToolTip(pathToolTip);
@@ -339,7 +343,7 @@ void BreakpointDialog::typeChanged(int)
case BreakpointAtMain:
case BreakpointAtFork:
case BreakpointAtExec:
case BreakpointAtVFork:
//case BreakpointAtVFork:
case BreakpointAtSysCall:
break;
case BreakpointByAddress:
@@ -366,7 +370,7 @@ void BreakpointDialog::typeChanged(int)
case BreakpointAtCatch:
case BreakpointAtFork:
case BreakpointAtExec:
case BreakpointAtVFork:
//case BreakpointAtVFork:
case BreakpointAtSysCall:
clearOtherParts(AllConditionParts|ModulePart|TracePointPart);
setPartsEnabled(AllConditionParts|TracePointPart);
+2 -2
View File
@@ -740,7 +740,7 @@ bool CdbEngine::launchCDB(const DebuggerStartParameters &sp, QString *errorMessa
arguments << QLatin1String("-lines") << QLatin1String("-G")
// register idle (debuggee stop) notification
<< QLatin1String("-c")
<< QString::fromAscii(".idle_cmd " + m_extensionCommandPrefixBA + "idle");
<< QLatin1String(".idle_cmd ") + QString::fromAscii(m_extensionCommandPrefixBA) + QLatin1String("idle");
if (sp.useTerminal) // Separate console
arguments << QLatin1String("-2");
if (!m_options->symbolPaths.isEmpty())
@@ -2336,7 +2336,7 @@ bool CdbEngine::acceptsBreakpoint(BreakpointId id) const
switch (data.type) {
case UnknownType:
case BreakpointAtFork:
case BreakpointAtVFork:
//case BreakpointAtVFork:
case BreakpointAtSysCall:
return false;
case Watchpoint:
+4 -3
View File
@@ -102,7 +102,7 @@ static BreakpointParameters fixWinMSVCBreakpoint(const BreakpointParameters &p)
case BreakpointByFunction:
case BreakpointByAddress:
case BreakpointAtFork:
case BreakpointAtVFork:
//case BreakpointAtVFork:
case BreakpointAtSysCall:
case Watchpoint:
break;
@@ -144,7 +144,8 @@ QByteArray cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
str << '~' << bp.threadSpec << ' ';
// Currently use 'bu' so that the offset expression (including file name)
// is kept when reporting back breakpoints (which is otherwise discarded when resolving).
// is kept when reporting back breakpoints (which is otherwise discarded
// when resolving).
str << (bp.type == Watchpoint ? "ba" : "bu");
if (id != BreakpointId(-1))
str << id;
@@ -154,7 +155,7 @@ QByteArray cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
switch (bp.type) {
case BreakpointAtFork:
case BreakpointAtExec:
case BreakpointAtVFork:
//case BreakpointAtVFork:
case BreakpointAtSysCall:
case UnknownType:
case BreakpointAtCatch:
-2
View File
@@ -110,7 +110,6 @@ SOURCES += breakhandler.cpp \
FORMS += attachexternaldialog.ui \
attachcoredialog.ui \
attachtcfdialog.ui \
breakcondition.ui \
breakpoint.ui \
dumperoptionpage.ui \
@@ -140,5 +139,4 @@ include(pdb/pdb.pri)
include(lldb/lldbhost.pri)
include(qml/qml.pri)
include(tcf/tcf.pri)
include(shared/shared.pri)
-3
View File
@@ -429,9 +429,6 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("SkipKnownFrames"));
item->setText(tr("Skip Known Frames"));
item->setToolTip(tr("Selecting this results in well-known but usually "
"not interesting frames belonging to reference counting and "
"signal emission being skipped while single-stepping."));
item->setCheckable(true);
item->setDefaultValue(false);
insertItem(SkipKnownFrames, item);
-91
View File
@@ -38,7 +38,6 @@
#include "ui_attachcoredialog.h"
#include "ui_attachexternaldialog.h"
#include "ui_attachtcfdialog.h"
#include "ui_startexternaldialog.h"
#include "ui_startremotedialog.h"
#include "ui_startremoteenginedialog.h"
@@ -513,96 +512,6 @@ void AttachExternalDialog::accept()
}
///////////////////////////////////////////////////////////////////////
//
// AttachTcfDialog
//
///////////////////////////////////////////////////////////////////////
AttachTcfDialog::AttachTcfDialog(QWidget *parent)
: QDialog(parent),
m_ui(new Ui::AttachTcfDialog)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_ui->setupUi(this);
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
m_ui->serverStartScript->setExpectedKind(PathChooser::File);
m_ui->serverStartScript->setPromptDialogTitle(tr("Select Executable"));
connect(m_ui->useServerStartScriptCheckBox, SIGNAL(toggled(bool)),
this, SLOT(updateState()));
connect(m_ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
updateState();
}
AttachTcfDialog::~AttachTcfDialog()
{
delete m_ui;
}
void AttachTcfDialog::setRemoteChannel(const QString &channel)
{
m_ui->channelLineEdit->setText(channel);
}
QString AttachTcfDialog::remoteChannel() const
{
return m_ui->channelLineEdit->text();
}
void AttachTcfDialog::setRemoteArchitectures(const QStringList &list)
{
m_ui->architectureComboBox->clear();
if (!list.isEmpty()) {
m_ui->architectureComboBox->insertItems(0, list);
m_ui->architectureComboBox->setCurrentIndex(0);
}
}
void AttachTcfDialog::setRemoteArchitecture(const QString &arch)
{
int index = m_ui->architectureComboBox->findText(arch);
if (index != -1)
m_ui->architectureComboBox->setCurrentIndex(index);
}
QString AttachTcfDialog::remoteArchitecture() const
{
int index = m_ui->architectureComboBox->currentIndex();
return m_ui->architectureComboBox->itemText(index);
}
void AttachTcfDialog::setServerStartScript(const QString &scriptName)
{
m_ui->serverStartScript->setPath(scriptName);
}
QString AttachTcfDialog::serverStartScript() const
{
return m_ui->serverStartScript->path();
}
void AttachTcfDialog::setUseServerStartScript(bool on)
{
m_ui->useServerStartScriptCheckBox->setChecked(on);
}
bool AttachTcfDialog::useServerStartScript() const
{
return m_ui->useServerStartScriptCheckBox->isChecked();
}
void AttachTcfDialog::updateState()
{
bool enabled = m_ui->useServerStartScriptCheckBox->isChecked();
m_ui->serverStartScriptLabel->setEnabled(enabled);
m_ui->serverStartScript->setEnabled(enabled);
}
///////////////////////////////////////////////////////////////////////
//
// StartExternalDialog
-28
View File
@@ -46,7 +46,6 @@ class QDialogButtonBox;
namespace Ui {
class AttachCoreDialog;
class AttachExternalDialog;
class AttachTcfDialog;
class StartExternalDialog;
class StartRemoteDialog;
class StartRemoteEngineDialog;
@@ -133,33 +132,6 @@ private:
ProcessListFilterModel *m_model;
};
class AttachTcfDialog : public QDialog
{
Q_OBJECT
public:
explicit AttachTcfDialog(QWidget *parent);
~AttachTcfDialog();
QString remoteChannel() const;
void setRemoteChannel(const QString &host);
QString remoteArchitecture() const;
void setRemoteArchitecture(const QString &arch);
void setRemoteArchitectures(const QStringList &arches);
QString serverStartScript() const;
bool useServerStartScript() const;
void setUseServerStartScript(bool on);
void setServerStartScript(const QString &scriptName);
private slots:
void updateState();
private:
Ui::AttachTcfDialog *m_ui;
};
class StartExternalDialog : public QDialog
{
Q_OBJECT
-45
View File
@@ -371,7 +371,6 @@ const char * const M_DEBUG_START_DEBUGGING = "QtCreator.Menu.Debug.StartDebuggin
const char * const STARTEXTERNAL = "Debugger.StartExternal";
const char * const ATTACHEXTERNAL = "Debugger.AttachExternal";
const char * const ATTACHCORE = "Debugger.AttachCore";
const char * const ATTACHTCF = "Debugger.AttachTcf";
const char * const ATTACHREMOTE = "Debugger.AttachRemote";
const char * const ATTACHREMOTECDB = "Debugger.AttachRemoteCDB";
const char * const STARTREMOTELLDB = "Debugger.StartRemoteLLDB";
@@ -700,7 +699,6 @@ public slots:
const ProjectExplorer::Abi &abi = ProjectExplorer::Abi(),
const QString &debuggerCommand = QString());
void attachRemote(const QString &spec);
void attachRemoteTcf();
void enableReverseDebuggingTriggered(const QVariant &value);
void languagesChanged();
@@ -988,7 +986,6 @@ public:
QAction *m_startRemoteLldbAction;
QAction *m_attachExternalAction;
QAction *m_attachCoreAction;
QAction *m_attachTcfAction;
QAction *m_detachAction;
QAction *m_continueAction;
QAction *m_exitAction; // On application output button if "Stop" is possible
@@ -1104,7 +1101,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
m_startRemoteLldbAction = 0;
m_attachExternalAction = 0;
m_attachCoreAction = 0;
m_attachTcfAction = 0;
m_detachAction = 0;
m_commonOptionsPage = 0;
@@ -1582,37 +1578,6 @@ void DebuggerPluginPrivate::enableReverseDebuggingTriggered(const QVariant &valu
m_reverseDirectionAction->setEnabled(value.toBool());
}
void DebuggerPluginPrivate::attachRemoteTcf()
{
DebuggerStartParameters sp;
AttachTcfDialog dlg(mainWindow());
QStringList arches;
arches.append(_("i386:x86-64:intel"));
dlg.setRemoteArchitectures(arches);
dlg.setRemoteChannel(
configValue(_("LastTcfRemoteChannel")).toString());
dlg.setRemoteArchitecture(
configValue(_("LastTcfRemoteArchitecture")).toString());
dlg.setServerStartScript(
configValue(_("LastTcfServerStartScript")).toString());
dlg.setUseServerStartScript(
configValue(_("LastTcfUseServerStartScript")).toBool());
if (dlg.exec() != QDialog::Accepted)
return;
setConfigValue(_("LastTcfRemoteChannel"), dlg.remoteChannel());
setConfigValue(_("LastTcfRemoteArchitecture"), dlg.remoteArchitecture());
setConfigValue(_("LastTcfServerStartScript"), dlg.serverStartScript());
setConfigValue(_("LastTcfUseServerStartScript"), dlg.useServerStartScript());
sp.remoteChannel = dlg.remoteChannel();
sp.remoteArchitecture = dlg.remoteArchitecture();
sp.serverStartScript = dlg.serverStartScript();
sp.startMode = AttachTcf;
if (dlg.useServerStartScript())
sp.serverStartScript = dlg.serverStartScript();
if (RunControl *rc = createDebugger(sp))
startDebugger(rc);
}
void DebuggerPluginPrivate::runScheduled()
{
foreach (const DebuggerStartParameters &sp, m_scheduledStarts) {
@@ -2755,12 +2720,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
act->setText(tr("Attach to Core..."));
connect(act, SIGNAL(triggered()), SLOT(attachCore()));
act = m_attachTcfAction = new QAction(this);
act->setText(tr("Attach to Running Tcf Agent..."));
act->setToolTip(tr("This attaches to a running "
"'Target Communication Framework' agent."));
connect(act, SIGNAL(triggered()), SLOT(attachRemoteTcf()));
act = m_startRemoteAction = new QAction(this);
act->setText(tr("Start and Attach to Remote Application..."));
connect(act, SIGNAL(triggered()), SLOT(startRemoteApplication()));
@@ -2808,10 +2767,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, CC::G_DEFAULT_ONE);
cmd = am->registerAction(m_attachTcfAction,
Constants::ATTACHTCF, globalcontext);
mstart->addAction(cmd, CC::G_DEFAULT_ONE);
cmd = am->registerAction(m_startRemoteAction,
Constants::ATTACHREMOTE, globalcontext);
cmd->setAttribute(Command::CA_Hide);
-4
View File
@@ -89,7 +89,6 @@ DebuggerEngine *createGdbEngine(const DebuggerStartParameters &sp,
DebuggerEngine *createScriptEngine(const DebuggerStartParameters &sp);
DebuggerEngine *createPdbEngine(const DebuggerStartParameters &sp);
DebuggerEngine *createTcfEngine(const DebuggerStartParameters &sp);
QmlEngine *createQmlEngine(const DebuggerStartParameters &sp,
DebuggerEngine *masterEngine);
DebuggerEngine *createQmlCppEngine(const DebuggerStartParameters &sp,
@@ -776,9 +775,6 @@ DebuggerEngine *
case PdbEngineType:
return createPdbEngine(sp);
break;
case TcfEngineType:
return createTcfEngine(sp);
break;
case QmlEngineType:
return createQmlEngine(sp, masterEngine);
break;
@@ -1245,12 +1245,27 @@ void DebuggerToolTipManager::moveToolTipsBy(const QPoint &distance)
tw->move (tw->pos() + distance);
}
bool DebuggerToolTipManager::eventFilter(QObject *, QEvent *e)
bool DebuggerToolTipManager::eventFilter(QObject *o, QEvent *e)
{
// Move along with parent (toplevel)
if (e->type() == QEvent::Move && hasToolTips()) {
if (!hasToolTips())
return false;
switch (e->type()) {
case QEvent::Move: { // Move along with parent (toplevel)
const QMoveEvent *me = static_cast<const QMoveEvent *>(e);
moveToolTipsBy(me->pos() - me->oldPos());
}
break;
case QEvent::WindowStateChange: { // Hide/Show along with parent (toplevel)
const QWindowStateChangeEvent *se = static_cast<const QWindowStateChangeEvent *>(e);
const bool wasMinimized = se->oldState() & Qt::WindowMinimized;
const bool isMinimized = static_cast<const QWidget *>(o)->windowState() & Qt::WindowMinimized;
if (wasMinimized ^ isMinimized)
foreach (const QPointer<AbstractDebuggerToolTipWidget> &tw, purgeClosedToolTips())
tw->setVisible(!isMinimized);
}
break;
default:
break;
}
return false;
}
@@ -100,7 +100,7 @@ bool AbstractGdbAdapter::prepareCommand()
QString AbstractGdbAdapter::msgGdbStopFailed(const QString &why)
{
return tr("The Gdb process could not be stopped:\n%1").arg(why);
return tr("The gdb process could not be stopped:\n%1").arg(why);
}
QString AbstractGdbAdapter::msgInferiorStopFailed(const QString &why)
+2 -2
View File
@@ -433,7 +433,7 @@ void CodaGdbAdapter::readGdbServerCommand()
logMessage("gdb: -> " + currentTime() + ' ' + QString::fromAscii(packet));
if (packet != m_gdbReadBuffer)
logMessage("buffer: " + m_gdbReadBuffer);
logMessage(_("buffer: ") + m_gdbReadBuffer);
QByteArray &ba = m_gdbReadBuffer;
while (ba.size()) {
@@ -926,7 +926,7 @@ void CodaGdbAdapter::handleGdbServerCommand(const QByteArray &cmd)
CodaCallback(this, &CodaGdbAdapter::handleAndReportSetBreakpoint),
bp);
} else {
logMessage("MISPARSED BREAKPOINT '" + cmd + "'')" , LogError);
logMessage(_("MISPARSED BREAKPOINT '") + cmd + "'')" , LogError);
}
}
+18 -16
View File
@@ -259,12 +259,12 @@ QString GdbEngine::errorMessage(QProcess::ProcessError error)
{
switch (error) {
case QProcess::FailedToStart:
return tr("The Gdb process failed to start. Either the "
return tr("The gdb process failed to start. Either the "
"invoked program '%1' is missing, or you may have insufficient "
"permissions to invoke the program.\n%2")
.arg(m_gdb, gdbProc()->errorString());
case QProcess::Crashed:
return tr("The Gdb process crashed some time after starting "
return tr("The gdb process crashed some time after starting "
"successfully.");
case QProcess::Timedout:
return tr("The last waitFor...() function timed out. "
@@ -272,13 +272,13 @@ QString GdbEngine::errorMessage(QProcess::ProcessError error)
"waitFor...() again.");
case QProcess::WriteError:
return tr("An error occurred when attempting to write "
"to the Gdb process. For example, the process may not be running, "
"to the gdb process. For example, the process may not be running, "
"or it may have closed its input channel.");
case QProcess::ReadError:
return tr("An error occurred when attempting to read from "
"the Gdb process. For example, the process may not be running.");
"the gdb process. For example, the process may not be running.");
default:
return tr("An unknown error in the Gdb process occurred. ");
return tr("An unknown error in the gdb process occurred. ");
}
}
@@ -619,7 +619,7 @@ void GdbEngine::readGdbStandardError()
return;
if (err.startsWith("BFD: reopening"))
return;
qWarning() << "Unexpected gdb stderr:" << err;
qWarning() << "Unexpected GDB stderr:" << err;
}
void GdbEngine::readGdbStandardOutput()
@@ -870,9 +870,9 @@ void GdbEngine::commandTimeout()
"the operation.\nYou can choose between waiting "
"longer or abort debugging.").arg(timeOut / 1000);
QMessageBox *mb = showMessageBox(QMessageBox::Critical,
tr("Gdb not responding"), msg,
tr("GDB not responding"), msg,
QMessageBox::Ok | QMessageBox::Cancel);
mb->button(QMessageBox::Cancel)->setText(tr("Give gdb more time"));
mb->button(QMessageBox::Cancel)->setText(tr("Give GDB more time"));
mb->button(QMessageBox::Ok)->setText(tr("Stop debugging"));
if (mb->exec() == QMessageBox::Ok) {
showMessage(_("KILLING DEBUGGER AS REQUESTED BY USER"));
@@ -918,7 +918,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
//shutdown();
notifyInferiorIll();
} else if (msg == "\"finish\" not meaningful in the outermost frame.") {
// Handle a case known to appear on gdb 6.4 symbianelf when
// Handle a case known to appear on GDB 6.4 symbianelf when
// the stack is cut due to access to protected memory.
//showMessage(_("APPLYING WORKAROUND #2"));
notifyInferiorStopOk();
@@ -2672,13 +2672,15 @@ void GdbEngine::insertBreakpoint(BreakpointId id)
if (type == BreakpointAtFork) {
postCommand("catch fork", NeedsStop | RebuildBreakpointModel,
CB(handleCatchInsert), id);
return;
}
if (type == BreakpointAtVFork) {
postCommand("catch vfork", NeedsStop | RebuildBreakpointModel,
CB(handleCatchInsert), id);
return;
}
//if (type == BreakpointAtVFork) {
// postCommand("catch vfork", NeedsStop | RebuildBreakpointModel,
// CB(handleCatchInsert), id);
// return;
//}
if (type == BreakpointAtExec) {
postCommand("catch exec", NeedsStop | RebuildBreakpointModel,
CB(handleCatchInsert), id);
@@ -3908,7 +3910,7 @@ void GdbEngine::handleWatchPoint(const GdbResponse &response)
const QByteArray addr = ba.mid(pos0x);
if (addr.toULongLong(0, 0)) { // Non-null pointer
const QByteArray ns = qtNamespace();
const QByteArray type = ns.isEmpty() ? "QWidget*" : ("'" + ns + "QWidget'*");
const QByteArray type = ns.isEmpty() ? "QWidget*" : QByteArray("'" + ns + "QWidget'*");
const QString exp = _("(*(struct %1)%2)").arg(_(type)).arg(_(addr));
// qDebug() << posNs << posWidget << pos0x << addr << ns << type;
watchHandler()->watchExpression(exp);
@@ -4379,7 +4381,7 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &settingsIdHint)
const QString nativeGdb = QDir::toNativeSeparators(m_gdb);
showMessage(_("GDB %1 CANNOT FIND THE PYTHON INSTALLATION.").arg(nativeGdb));
showStatusMessage(_("%1 cannot find python").arg(nativeGdb));
const QString msg = tr("The gdb installed at %1 cannot "
const QString msg = tr("The GDB installed at %1 cannot "
"find a valid python installation in its %2 subdirectory.\n"
"You may set the environment variable PYTHONPATH to point to your installation.")
.arg(nativeGdb).arg(winPythonVersion);
@@ -4530,7 +4532,7 @@ void GdbEngine::handleGdbError(QProcess::ProcessError error)
default:
//gdbProc()->kill();
//notifyEngineIll();
showMessageBox(QMessageBox::Critical, tr("Gdb I/O Error"), msg);
showMessageBox(QMessageBox::Critical, tr("GDB I/O Error"), msg);
break;
}
}
@@ -4558,7 +4560,7 @@ void GdbEngine::handleGdbFinished(int code, QProcess::ExitStatus type)
const QString msg = type == QProcess::CrashExit ?
tr("The gdb process crashed.") :
tr("The gdb process exited unexpectedly (code %1)").arg(code);
showMessageBox(QMessageBox::Critical, tr("Unexpected Gdb Exit"), msg);
showMessageBox(QMessageBox::Critical, tr("Unexpected GDB Exit"), msg);
break;
}
}
+1 -1
View File
@@ -57,7 +57,7 @@ QString GdbOptionsPage::settingsId()
QString GdbOptionsPage::displayName() const
{
return tr("Gdb");
return tr("GDB");
}
QString GdbOptionsPage::category() const
+44 -18
View File
@@ -2,11 +2,19 @@
<ui version="4.0">
<class>GdbOptionsPage</class>
<widget class="QWidget" name="GdbOptionsPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>398</width>
<height>412</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBoxLocations">
<property name="title">
<string>Gdb</string>
<string>GDB</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
@@ -24,20 +32,27 @@
<item row="0" column="0">
<widget class="QLabel" name="labelGdbStartupScript">
<property name="toolTip">
<string>This is either empty or points to a file containing gdb commands that will be executed immediately after gdb starts up.</string>
<string>This is either empty or points to a file containing GDB commands that will be executed immediately after GDB starts up.</string>
</property>
<property name="text">
<string>Gdb startup script:</string>
<string>GDB startup script:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Utils::PathChooser" name="scriptFileChooser"/>
<widget class="Utils::PathChooser" name="scriptFileChooser" native="true"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelGdbWatchdogTimeout">
<property name="toolTip">
<string>This is the number of seconds Qt Creator will wait before
it terminates non-responsive gdb process. The default value of 20 seconds
should be sufficient for most applications, but there are situations when
loading big libraries or listing source files takes much longer than that
on slow machines. In this case, the value should be increased.</string>
</property>
<property name="text">
<string>Gdb timeout:</string>
<string>GDB timeout:</string>
</property>
</widget>
</item>
@@ -68,51 +83,62 @@ on slow machines. In this case, the value should be increased.</string>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxEnableReverseDebugging">
<property name="text">
<string>Enable reverse debugging</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxSkipKnownFrames">
<property name="toolTip">
<string>When this option is checked, 'Step Into' compresses several steps into one in certain situations, leading to 'less noisy' debugging. So will, e.g., the atomic
reference counting code be skipped, and a single 'Step Into' for a signal emission will end up directly in the slot connected to it.</string>
<string>When this option is checked, 'Step Into' compresses several steps into one in certain situations, leading to 'less noisy' debugging. So will, e.g., the atomic reference counting code be skipped, and a single 'Step Into' for a signal emission will end up directly in the slot connected to it.</string>
</property>
<property name="text">
<string>Skip known frames when stepping</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxUseMessageBoxForSignals">
<property name="toolTip">
<string>This will show a message box as soon as your application receives a signal like SIGSEGV during debugging.</string>
</property>
<property name="text">
<string>Show a message box when receiving a signal</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxAdjustBreakpointLocations">
<property name="toolTip">
<string>GDB allows setting breakpoints on source lines for which no code was generated. In such situations the breakpoint is shifted to the next source code line for which code was actually generated. This option reflects such temporary change by moving the breakpoint markers in the source code editor.</string>
</property>
<property name="text">
<string>Adjust breakpoint locations</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxLoadGdbInit">
<property name="toolTip">
<string>This allows or inhibits reading the user's default .gdbinit file on debugger startup.</string>
</property>
<property name="text">
<string>Load .gdbinit file on startup</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxTargetAsync">
<property name="text">
<string>Use asynchronous mode to control the inferior</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxEnableReverseDebugging">
<property name="toolTip">
<string>Enable reverse debugging Selecting this enables reverse debugging. NOTE: This feature is very slow and unstable on the GDB side. It exhibits unpredictable behaviour when going backwards over system calls and is very likely to destroy your debugging session.</string>
</property>
<property name="text">
<string>Enable reverse debugging</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -193,12 +193,12 @@ void RemoteGdbProcess::handleGdbFinished(int exitStatus)
switch (exitStatus) {
case Utils::SshRemoteProcess::FailedToStart:
m_error = tr("Remote gdb failed to start.");
m_error = tr("Remote GDB failed to start.");
setState(Inactive);
emit startFailed();
break;
case Utils::SshRemoteProcess::KilledBySignal:
emitErrorExit(tr("Remote gdb crashed."));
emitErrorExit(tr("Remote GDB crashed."));
break;
case Utils::SshRemoteProcess::ExitedNormally:
const int exitCode = m_gdbProc->exitCode();
+16 -16
View File
@@ -214,8 +214,8 @@ QByteArray TrkGdbAdapter::trkStepRangeMessage()
if (from <= pc && pc <= to) {
//to = qMax(to - 4, from);
//to = qMax(to - 4, from);
showMessage("STEP IN " + hexxNumber(from) + ' ' + hexxNumber(to)
+ " INSTEAD OF " + hexxNumber(pc));
showMessage(_("STEP IN ") + hexxNumber(from) + ' ' + hexxNumber(to)
+ _(" INSTEAD OF ") + hexxNumber(pc));
} else {
from = pc;
to = pc;
@@ -301,7 +301,7 @@ void TrkGdbAdapter::readGdbServerCommand()
logMessage("gdb: -> " + currentTime() + ' ' + QString::fromAscii(packet));
if (packet != m_gdbReadBuffer)
logMessage("buffer: " + m_gdbReadBuffer);
logMessage(QLatin1String("buffer: ") + m_gdbReadBuffer);
QByteArray &ba = m_gdbReadBuffer;
while (ba.size()) {
@@ -781,7 +781,7 @@ void TrkGdbAdapter::handleGdbServerCommand(const QByteArray &cmd)
const QByteArray ba = trkBreakpointMessage(addrLen.first, addrLen.second, armMode);
sendTrkMessage(0x1B, TrkCB(handleAndReportSetBreakpoint), ba, QVariant(addrLen.first));
} else {
logMessage("MISPARSED BREAKPOINT '" + cmd + "')", LogError);
logMessage(QLatin1String("MISPARSED BREAKPOINT '") + cmd + "')", LogError);
}
}
@@ -1015,14 +1015,14 @@ void TrkGdbAdapter::handleTrkResult(const TrkResult &result)
case TrkNotifyException: { // 0x91 Notify Exception (obsolete)
showMessage(_("RESET SNAPSHOT (NOTIFY EXCEPTION)"));
m_snapshot.reset();
logMessage(prefix + "NOTE: EXCEPTION " + str, AppError);
logMessage(prefix + _("NOTE: EXCEPTION ") + str, AppError);
sendTrkAck(result.token);
break;
}
case 0x92: { //
showMessage(_("RESET SNAPSHOT (NOTIFY INTERNAL ERROR)"));
m_snapshot.reset();
logMessage(prefix + "NOTE: INTERNAL ERROR: " + str, LogError);
logMessage(prefix + _("NOTE: INTERNAL ERROR: ") + str, LogError);
sendTrkAck(result.token);
break;
}
@@ -1105,22 +1105,22 @@ void TrkGdbAdapter::handleTrkResult(const TrkResult &result)
break;
}
case 0xa2: { // NotifyProcessorStarted
logMessage(prefix + "NOTE: PROCESSOR STARTED: " + str);
logMessage(prefix + _("NOTE: PROCESSOR STARTED: ") + str);
sendTrkAck(result.token);
break;
}
case 0xa6: { // NotifyProcessorStandby
logMessage(prefix + "NOTE: PROCESSOR STANDBY: " + str);
logMessage(prefix + _("NOTE: PROCESSOR STANDBY: ") + str);
sendTrkAck(result.token);
break;
}
case 0xa7: { // NotifyProcessorReset
logMessage(prefix + "NOTE: PROCESSOR RESET: " + str);
logMessage(prefix + _("NOTE: PROCESSOR RESET: ") + str);
sendTrkAck(result.token);
break;
}
default: {
logMessage(prefix + "INVALID: " + str, LogError);
logMessage(prefix + _("INVALID: ") + str, LogError);
break;
}
}
@@ -1133,8 +1133,8 @@ void TrkGdbAdapter::handleCpuType(const TrkResult &result)
// Error: 0x00
// [80 03 00 04 00 00 04 00 00 00]
if (result.data.size() < 7) {
logMessage("ERROR: CPUTYPE RESULT " + result.errorString()
+ " NOT PARSABLE", LogError);
logMessage(_("ERROR: CPUTYPE RESULT ") + result.errorString()
+ _(" NOT PARSABLE"), LogError);
return;
}
m_session.cpuMajor = result.data[1];
@@ -1250,7 +1250,7 @@ static QString msgMemoryReadError(int code, uint addr, uint len = 0)
void TrkGdbAdapter::handleReadMemoryBuffered(const TrkResult &result)
{
if (extractShort(result.data.data() + 1) + 3 != result.data.size())
logMessage("\n BAD MEMORY RESULT: " + result.data.toHex() + '\n', LogError);
logMessage(_("\n BAD MEMORY RESULT: ") + result.data.toHex() + '\n', LogError);
const MemoryRange range = result.cookie.value<MemoryRange>();
MEMORY_DEBUG("HANDLE READ MEMORY ***BUFFERED*** FOR " << range);
if (const int errorCode = result.errorCode()) {
@@ -1270,7 +1270,7 @@ void TrkGdbAdapter::handleReadMemoryBuffered(const TrkResult &result)
void TrkGdbAdapter::handleReadMemoryUnbuffered(const TrkResult &result)
{
if (extractShort(result.data.data() + 1) + 3 != result.data.size())
logMessage("\n BAD MEMORY RESULT: " + result.data.toHex() + '\n', LogError);
logMessage(_("\n BAD MEMORY RESULT: ") + result.data.toHex() + '\n', LogError);
const MemoryRange range = result.cookie.value<MemoryRange>();
MEMORY_DEBUG("HANDLE READ MEMORY UNBUFFERED FOR " << range);
if (const int errorCode = result.errorCode()) {
@@ -1451,7 +1451,7 @@ void TrkGdbAdapter::handleSupportMask(const TrkResult &result)
if (data[i] & (1 << j))
str.append(QByteArray::number(i * 8 + j, 16));
}
logMessage("SUPPORTED: " + str);
logMessage(_("SUPPORTED: ") + str);
}
void TrkGdbAdapter::handleTrkVersionsStartGdb(const TrkResult &result)
@@ -1776,7 +1776,7 @@ void TrkGdbAdapter::handleDirectWrite1(const TrkResult &response)
} else {
oldMem = response.data.mid(3);
oldPC = m_snapshot.registerValue(m_session.tid, RegisterPC);
logMessage("READ MEM: " + oldMem.toHex());
logMessage(_("READ MEM: ") + oldMem.toHex());
//qDebug("READ MEM: " + oldMem.toHex());
QByteArray ba;
appendByte(&ba, 0xaa);
+1 -1
View File
@@ -645,7 +645,7 @@ void IPCEngineHost::readyRead()
char terminator;
m_device->getChar(&terminator);
if (terminator != 'T') {
showStatusMessage(tr("Fatal engine shutdown. Incompatible binary or ipc error."));
showStatusMessage(tr("Fatal engine shutdown. Incompatible binary or IPC error."));
showMessage(QLatin1String("IPC Error: terminator missing"));
nuke();
return;
@@ -29,7 +29,7 @@
<item>
<widget class="QCheckBox" name="gdbEmu">
<property name="text">
<string>Use Gdb python dumpers</string>
<string>Use GDB python dumpers</string>
</property>
<property name="checked">
<bool>false</bool>
+9 -4
View File
@@ -384,7 +384,11 @@ void QmlEngine::runEngine()
void QmlEngine::startApplicationLauncher()
{
if (!d->m_applicationLauncher.isRunning()) {
appendMessage(tr("Starting %1 %2").arg(QDir::toNativeSeparators(startParameters().executable), startParameters().processArgs), NormalMessageFormat);
appendMessage(tr("Starting %1 %2").arg(
QDir::toNativeSeparators(startParameters().executable),
startParameters().processArgs)
+ QLatin1Char('\n')
, NormalMessageFormat);
d->m_applicationLauncher.start(ApplicationLauncher::Gui,
startParameters().executable,
startParameters().processArgs);
@@ -762,11 +766,12 @@ QString QmlEngine::toFileInProject(const QString &fileUrl)
if (fileUrl.isEmpty())
return fileUrl;
const QString path = QUrl(fileUrl).path();
const QString path = QUrl(fileUrl).toLocalFile();
if (path.isEmpty())
return fileUrl;
// Try to find shadow-build file in source dir first
if (!QUrl(fileUrl).toLocalFile().isEmpty()
&& isShadowBuildProject()) {
if (isShadowBuildProject()) {
const QString sourcePath = fromShadowBuildFilename(path);
if (QFileInfo(sourcePath).exists())
return sourcePath;
+2 -2
View File
@@ -79,7 +79,7 @@
<item row="4" column="0">
<widget class="QLabel" name="gnuTargetLabel">
<property name="text">
<string>&amp;GNU target</string>
<string>&amp;GNU target:</string>
</property>
<property name="buddy">
<cstring>gnuTargetComboBox</cstring>
@@ -122,7 +122,7 @@
<item row="7" column="0">
<widget class="QLabel" name="serverStartScriptLabel">
<property name="text">
<string>Server st&amp;art script:</string>
<string>&amp;Server start script:</string>
</property>
<property name="buddy">
<cstring>serverStartScript</cstring>
-376
View File
@@ -1,376 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "json.h"
#include <utils/qtcassert.h>
#include <QtCore/QByteArray>
#include <QtCore/QTextStream>
#include <ctype.h>
//#define DEBUG_JASON
#ifdef DEBUG_JASON
#define JDEBUG(s) qDebug() << s
#else
#define JDEBUG(s)
#endif
namespace Debugger {
namespace Internal {
static void skipSpaces(const char *&from, const char *to)
{
while (from != to && isspace(*from))
++from;
}
QTextStream &operator<<(QTextStream &os, const JsonValue &mi)
{
return os << mi.toString();
}
void JsonValue::parsePair(const char *&from, const char *to)
{
skipSpaces(from, to);
JDEBUG("parsePair: " << QByteArray(from, to - from));
m_name = parseCString(from, to);
skipSpaces(from, to);
while (from < to && *from != ':') {
JDEBUG("not a colon" << *from);
++from;
}
++from;
parseValue(from, to);
skipSpaces(from, to);
}
QByteArray JsonValue::parseNumber(const char *&from, const char *to)
{
QByteArray result;
while (from < to && *from >= '0' && *from <= '9')
result.append(*from++);
return result;
}
QByteArray JsonValue::parseCString(const char *&from, const char *to)
{
QByteArray result;
JDEBUG("parseCString: " << QByteArray(from, to - from));
if (*from != '"') {
qDebug() << "JSON Parse Error, double quote expected";
++from; // So we don't hang
return QByteArray();
}
const char *ptr = from;
++ptr;
while (ptr < to) {
if (*ptr == '"') {
++ptr;
result = QByteArray(from + 1, ptr - from - 2);
break;
}
if (*ptr == '\\') {
++ptr;
if (ptr == to) {
qDebug() << "JSON Parse Error, unterminated backslash escape";
from = ptr; // So we don't hang
return QByteArray();
}
}
++ptr;
}
from = ptr;
int idx = result.indexOf('\\');
if (idx >= 0) {
char *dst = result.data() + idx;
const char *src = dst + 1, *end = result.data() + result.length();
do {
char c = *src++;
switch (c) {
case 'a': *dst++ = '\a'; break;
case 'b': *dst++ = '\b'; break;
case 'f': *dst++ = '\f'; break;
case 'n': *dst++ = '\n'; break;
case 'r': *dst++ = '\r'; break;
case 't': *dst++ = '\t'; break;
case 'v': *dst++ = '\v'; break;
case '"': *dst++ = '"'; break;
case '\\': *dst++ = '\\'; break;
default:
{
int chars = 0;
uchar prod = 0;
forever {
if (c < '0' || c > '7') {
--src;
break;
}
prod = prod * 8 + c - '0';
if (++chars == 3 || src == end)
break;
c = *src++;
}
if (!chars) {
qDebug() << "JSON Parse Error, unrecognized backslash escape";
return QByteArray();
}
*dst++ = prod;
}
}
while (src != end) {
char c = *src++;
if (c == '\\')
break;
*dst++ = c;
}
} while (src != end);
*dst = 0;
result.truncate(dst - result.data());
}
JDEBUG("parseCString, got " << result);
return result;
}
void JsonValue::parseValue(const char *&from, const char *to)
{
JDEBUG("parseValue: " << QByteArray(from, to - from));
switch (*from) {
case '{':
parseObject(from, to);
break;
case '[':
parseArray(from, to);
break;
case '"':
m_type = String;
m_data = parseCString(from, to);
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
m_type = Number;
m_data = parseNumber(from, to);
default:
break;
}
}
void JsonValue::parseObject(const char *&from, const char *to)
{
JDEBUG("parseObject: " << QByteArray(from, to - from));
QTC_ASSERT(*from == '{', /**/);
++from;
m_type = Object;
while (from < to) {
if (*from == '}') {
++from;
break;
}
JsonValue child;
child.parsePair(from, to);
if (!child.isValid())
return;
m_children += child;
if (*from == ',')
++from;
}
}
void JsonValue::parseArray(const char *&from, const char *to)
{
JDEBUG("parseArray: " << QByteArray(from, to - from));
QTC_ASSERT(*from == '[', /**/);
++from;
m_type = Array;
while (from < to) {
if (*from == ']') {
++from;
break;
}
JsonValue child;
child.parseValue(from, to);
if (child.isValid())
m_children += child;
if (*from == ',')
++from;
}
}
void JsonValue::setStreamOutput(const QByteArray &name, const QByteArray &content)
{
if (content.isEmpty())
return;
JsonValue child;
child.m_type = String;
child.m_name = name;
child.m_data = content;
m_children += child;
if (m_type == Invalid)
m_type = Object;
}
static QByteArray ind(int indent)
{
return QByteArray(2 * indent, ' ');
}
void JsonValue::dumpChildren(QByteArray * str, bool multiline, int indent) const
{
for (int i = 0; i < m_children.size(); ++i) {
if (i != 0) {
*str += ',';
if (multiline)
*str += '\n';
}
if (multiline)
*str += ind(indent);
*str += m_children.at(i).toString(multiline, indent);
}
}
class MyString : public QString {
public:
ushort at(int i) const { return constData()[i].unicode(); }
};
template<class ST, typename CT>
inline ST escapeCStringTpl(const ST &ba)
{
ST ret;
ret.reserve(ba.length() * 2);
for (int i = 0; i < ba.length(); ++i) {
CT c = ba.at(i);
switch (c) {
case '\\': ret += "\\\\"; break;
case '\a': ret += "\\a"; break;
case '\b': ret += "\\b"; break;
case '\f': ret += "\\f"; break;
case '\n': ret += "\\n"; break;
case '\r': ret += "\\r"; break;
case '\t': ret += "\\t"; break;
case '\v': ret += "\\v"; break;
case '"': ret += "\\\""; break;
default:
if (c < 32 || c == 127) {
ret += '\\';
ret += '0' + (c >> 6);
ret += '0' + ((c >> 3) & 7);
ret += '0' + (c & 7);
} else {
ret += c;
}
}
}
return ret;
}
QString JsonValue::escapeCString(const QString &ba)
{
return escapeCStringTpl<MyString, ushort>(static_cast<const MyString &>(ba));
}
QByteArray JsonValue::escapeCString(const QByteArray &ba)
{
return escapeCStringTpl<QByteArray, uchar>(ba);
}
QByteArray JsonValue::toString(bool multiline, int indent) const
{
QByteArray result;
switch (m_type) {
case Invalid:
if (multiline)
result += ind(indent) + "Invalid\n";
else
result += "Invalid";
break;
case String:
if (!m_name.isEmpty())
result += m_name + '=';
result += '"' + escapeCString(m_data) + '"';
break;
case Number:
if (!m_name.isEmpty())
result += '"' + m_name + "\":";
result += m_data;
break;
case Object:
if (!m_name.isEmpty())
result += m_name + '=';
if (multiline) {
result += "{\n";
dumpChildren(&result, multiline, indent + 1);
result += '\n' + ind(indent) + '}';
} else {
result += '{';
dumpChildren(&result, multiline, indent + 1);
result += '}';
}
break;
case Array:
if (!m_name.isEmpty())
result += m_name + '=';
if (multiline) {
result += "[\n";
dumpChildren(&result, multiline, indent + 1);
result += '\n' + ind(indent) + ']';
} else {
result += '[';
dumpChildren(&result, multiline, indent + 1);
result += ']';
}
break;
}
return result;
}
void JsonValue::fromString(const QByteArray &ba)
{
const char *from = ba.constBegin();
const char *to = ba.constEnd();
parseValue(from, to);
}
JsonValue JsonValue::findChild(const char *name) const
{
for (int i = 0; i < m_children.size(); ++i)
if (m_children.at(i).m_name == name)
return m_children.at(i);
return JsonValue();
}
} // namespace Internal
} // namespace Debugger
-104
View File
@@ -1,104 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef DEBUGGER_JSON_H
#define DEBUGGER_JSON_H
#include <QtCore/QByteArray>
#include <QtCore/QList>
namespace Debugger {
namespace Internal {
class JsonValue
{
public:
JsonValue() : m_type(Invalid) {}
explicit JsonValue(const QByteArray &str) { fromString(str); }
QByteArray m_name;
QByteArray m_data;
QList<JsonValue> m_children;
enum Type {
Invalid,
String,
Number,
Object,
Array
};
Type m_type;
inline Type type() const { return m_type; }
inline QByteArray name() const { return m_name; }
inline bool hasName(const char *name) const { return m_name == name; }
inline bool isValid() const { return m_type != Invalid; }
inline bool isNumber() const { return m_type == Number; }
inline bool isString() const { return m_type == String; }
inline bool isObject() const { return m_type == Object; }
inline bool isArray() const { return m_type == Array; }
inline QByteArray data() const { return m_data; }
inline const QList<JsonValue> &children() const { return m_children; }
inline int childCount() const { return m_children.size(); }
const JsonValue &childAt(int index) const { return m_children[index]; }
JsonValue &childAt(int index) { return m_children[index]; }
JsonValue findChild(const char *name) const;
QByteArray toString(bool multiline = false, int indent = 0) const;
void fromString(const QByteArray &str);
void setStreamOutput(const QByteArray &name, const QByteArray &content);
private:
static QByteArray parseCString(const char *&from, const char *to);
static QByteArray parseNumber(const char *&from, const char *to);
static QByteArray escapeCString(const QByteArray &ba);
static QString escapeCString(const QString &ba);
void parsePair(const char *&from, const char *to);
void parseValue(const char *&from, const char *to);
void parseObject(const char *&from, const char *to);
void parseArray(const char *&from, const char *to);
void dumpChildren(QByteArray *str, bool multiline, int indent) const;
};
} // namespace Internal
} // namespace Debugger
//Q_DECLARE_METATYPE(GdbDebugger::Internal::JsonValue)
#endif // DEBUGGER_JSON_H
-11
View File
@@ -1,11 +0,0 @@
HEADERS += \
$$PWD/json.h \
$$PWD/tcfengine.h \
SOURCES += \
$$PWD/json.cpp \
$$PWD/tcfengine.cpp \
FORMS +=
RESOURCES +=
-577
View File
@@ -1,577 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "tcfengine.h"
#include "debuggerstartparameters.h"
#include "debuggerconstants.h"
#include "debuggerdialogs.h"
#include "debuggerstringutils.h"
#include "json.h"
#include "breakhandler.h"
#include "moduleshandler.h"
#include "registerhandler.h"
#include "stackhandler.h"
#include "watchhandler.h"
#include "watchutils.h"
#include <utils/qtcassert.h>
#include <QtCore/QDateTime>
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include <QtCore/QTimer>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QMainWindow>
#include <QtGui/QMessageBox>
#include <QtGui/QToolTip>
#include <QtNetwork/QTcpSocket>
#define DEBUG_TCF 1
#if DEBUG_TCF
# define SDEBUG(s) qDebug() << s
#else
# define SDEBUG(s)
#endif
# define XSDEBUG(s) qDebug() << s
#define CB(callback) &TcfEngine::callback, STRINGIFY(callback)
//#define USE_CONGESTION_CONTROL
static QByteArray C(const QByteArray &ba1,
const QByteArray &ba2 = QByteArray(),
const QByteArray &ba3 = QByteArray(),
const QByteArray &ba4 = QByteArray(),
const QByteArray &ba5 = QByteArray())
{
QByteArray result = ba1;
if (!ba2.isEmpty()) { result += '\0'; result += ba2; }
if (!ba3.isEmpty()) { result += '\0'; result += ba3; }
if (!ba4.isEmpty()) { result += '\0'; result += ba4; }
if (!ba5.isEmpty()) { result += '\0'; result += ba5; }
return result;
}
namespace Debugger {
namespace Internal {
///////////////////////////////////////////////////////////////////////
//
// TcfCommand
//
///////////////////////////////////////////////////////////////////////
QString TcfEngine::TcfCommand::toString() const
{
return quoteUnprintableLatin1(command);
}
///////////////////////////////////////////////////////////////////////
//
// TcfEngine
//
///////////////////////////////////////////////////////////////////////
TcfEngine::TcfEngine(const DebuggerStartParameters &startParameters)
: DebuggerEngine(startParameters)
{
setObjectName(QLatin1String("TcfEngine"));
m_congestion = 0;
m_inAir = 0;
m_sendTimer.setSingleShot(true);
m_sendTimer.setInterval(100); // ms
connect(&m_sendTimer, SIGNAL(timeout()), this, SLOT(handleSendTimer()));
m_socket = new QTcpSocket(this);
connect(m_socket, SIGNAL(connected()), this, SLOT(socketConnected()));
connect(m_socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()));
connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(socketError(QAbstractSocket::SocketError)));
//void aboutToClose ()
//void bytesWritten ( qint64 bytes )
//void readChannelFinished ()
connect(m_socket, SIGNAL(readyRead()), this, SLOT(socketReadyRead()));
//connect(m_socket, SIGNAL(hostFound())
//connect(m_socket, SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)))
//connect(m_socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
// thism SLOT(socketStateChanged(QAbstractSocket::SocketState)));
}
TcfEngine::~TcfEngine()
{
}
void TcfEngine::socketReadyRead()
{
//XSDEBUG("TcfEngine::socketReadyRead()");
m_inbuffer.append(m_socket->readAll());
int pos = 0;
while (1) {
// the "\3" is followed by either "\1" or "\2"
int next = m_inbuffer.indexOf("\3", pos);
//qDebug() << "pos: " << pos << "next: " << next;
if (next == -1)
break;
handleResponse(m_inbuffer.mid(pos, next - pos));
pos = next + 2;
}
m_inbuffer.clear();
}
void TcfEngine::socketConnected()
{
showStatusMessage("Socket connected.");
}
void TcfEngine::socketDisconnected()
{
showStatusMessage("Socket disconnected.");
XSDEBUG("FIXME: TcfEngine::socketDisconnected()");
}
void TcfEngine::socketError(QAbstractSocket::SocketError)
{
QString msg = tr("%1.").arg(m_socket->errorString());
//QMessageBox::critical(q->mainWindow(), tr("Error"), msg);
showStatusMessage(msg);
notifyEngineIll();
}
void TcfEngine::executeDebuggerCommand(const QString &command)
{
QByteArray cmd = command.toUtf8();
cmd = cmd.mid(cmd.indexOf(' ') + 1);
QByteArray null;
null.append('\0');
// FIXME: works for single-digit escapes only
cmd.replace("\\0", null);
cmd.replace("\\1", "\1");
cmd.replace("\\3", "\3");
TcfCommand tcf;
tcf.command = cmd;
enqueueCommand(tcf);
}
void TcfEngine::setupEngine()
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
showStatusMessage(tr("Running requested..."), 5000);
const DebuggerStartParameters &sp = startParameters();
const int pos = sp.remoteChannel.indexOf(QLatin1Char(':'));
const QString host = sp.remoteChannel.left(pos);
const quint16 port = sp.remoteChannel.mid(pos + 1).toInt();
m_socket->connectToHost(host, port);
if (m_socket->waitForConnected())
notifyEngineSetupOk();
else
notifyEngineSetupFailed();
}
void TcfEngine::setupInferior()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
notifyInferiorSetupOk();
}
void TcfEngine::runEngine()
{
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
//notifyEngineRunOk();
}
void TcfEngine::shutdownInferior()
{
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
notifyInferiorShutdownOk();
}
void TcfEngine::shutdownEngine()
{
QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << state());
m_congestion = 0;
m_inAir = 0;
m_services.clear();
notifyEngineShutdownOk();
}
void TcfEngine::continueInferior()
{
SDEBUG("TcfEngine::continueInferior()");
}
void TcfEngine::interruptInferior()
{
XSDEBUG("TcfEngine::interruptInferior()");
}
void TcfEngine::executeStep()
{
//SDEBUG("TcfEngine::executeStep()");
}
void TcfEngine::executeStepI()
{
//SDEBUG("TcfEngine::executeStepI()");
}
void TcfEngine::executeStepOut()
{
//SDEBUG("TcfEngine::executeStepOut()");
}
void TcfEngine::executeNext()
{
//SDEBUG("TcfEngine::nextExec()");
}
void TcfEngine::executeNextI()
{
//SDEBUG("TcfEngine::executeNextI()");
}
void TcfEngine::executeRunToLine(const ContextData &data)
{
Q_UNUSED(data)
SDEBUG("FIXME: TcfEngine::executeRunToLine()");
}
void TcfEngine::executeRunToFunction(const QString &functionName)
{
Q_UNUSED(functionName)
XSDEBUG("FIXME: TcfEngine::executeRunToFunction()");
}
void TcfEngine::executeJumpToLine(const ContextData &data)
{
Q_UNUSED(data)
XSDEBUG("FIXME: TcfEngine::executeJumpToLine()");
}
void TcfEngine::activateFrame(int index)
{
Q_UNUSED(index)
}
void TcfEngine::selectThread(int index)
{
Q_UNUSED(index)
}
void TcfEngine::attemptBreakpointSynchronization()
{
}
void TcfEngine::loadSymbols(const QString &moduleName)
{
Q_UNUSED(moduleName)
}
void TcfEngine::loadAllSymbols()
{
}
void TcfEngine::reloadModules()
{
}
void TcfEngine::requestModuleSymbols(const QString &moduleName)
{
Q_UNUSED(moduleName)
}
void TcfEngine::handleResponse(const QByteArray &response)
{
static QTime lastTime;
//showMessage(_(" "), currentTime(), LogTime);
QList<QByteArray> parts = response.split('\0');
if (parts.size() < 2 || !parts.last().isEmpty()) {
SDEBUG("WRONG RESPONSE PACKET LAYOUT" << parts);
//if (response.isEmpty())
acknowledgeResult();
return;
}
parts.removeLast(); // always empty
QByteArray tag = parts.at(0);
int n = parts.size();
if (n == 2 && tag == "N") { // unidentified command
int token = parts.at(1).toInt();
TcfCommand tcf = m_cookieForToken[token];
SDEBUG("COMMAND NOT RECOGNIZED FOR TOKEN" << token << tcf.toString());
showMessage(QString::number(token) + '^'
+ "NOT RECOQNIZED: " + quoteUnprintableLatin1(response),
LogOutput);
acknowledgeResult();
} else if (n == 2 && tag == "F") { // flow control
m_congestion = parts.at(1).toInt();
SDEBUG("CONGESTION: " << m_congestion);
} else if (n == 4 && tag == "R") { // result data
acknowledgeResult();
int token = parts.at(1).toInt();
QByteArray message = parts.at(2);
JsonValue data(parts.at(3));
showMessage(QString("%1^%2%3").arg(token)
.arg(quoteUnprintableLatin1(response))
.arg(QString::fromUtf8(data.toString())), LogOutput);
TcfCommand tcf = m_cookieForToken[token];
JsonValue result(data);
SDEBUG("GOOD RESPONSE: " << quoteUnprintableLatin1(response));
if (tcf.callback)
(this->*(tcf.callback))(result, tcf.cookie);
} else if (n == 3 && tag == "P") { // progress data (partial result)
//int token = parts.at(1).toInt();
QByteArray data = parts.at(2);
SDEBUG(_("\nTCF PARTIAL:") << quoteUnprintableLatin1(response));
} else if (n == 4 && tag == "E") { // an event
QByteArray service = parts.at(1);
QByteArray eventName = parts.at(2);
JsonValue data(parts.at(3));
if (eventName != "peerHeartBeat")
SDEBUG(_("\nTCF EVENT:") << quoteUnprintableLatin1(response)
<< data.toString());
if (service == "Locator" && eventName == "Hello") {
m_services.clear();
foreach (const JsonValue &service, data.children())
m_services.append(service.data());
QTimer::singleShot(0, this, SLOT(startDebugging()));
}
} else {
SDEBUG("UNKNOWN RESPONSE PACKET:"
<< quoteUnprintableLatin1(response) << parts);
}
}
void TcfEngine::startDebugging()
{
//foreach (const QByteArray &service, m_services) {
// postCommand(CB(handleRunControlGetChildren),
// service, "getChildren", "\"\"");
//}
postCommand(C("Diagnostics", "getChildren", "\"\""),
CB(handleRunControlGetChildren));
postCommand(C("Streams", "getChildren", "\"\""));
postCommand(C("Expressions", "getChildren", "\"\""));
postCommand(C("SysMonitor", "getChildren", "\"\""));
//postCommand(C("FileSystem", "getChildren", "\"\""));
//postCommand(C("Processes", "getChildren", "\"\""));
//postCommand(CB(handleRunControlGetChildren), "LineNumbers", "getChildren");
//postCommand(CB(handleRunControlGetChildren), "Symbols", "getChildren");
//postCommand(CB(handleRunControlGetChildren), "StackTrace", "getChildren");
//postCommand(CB(handleRunControlGetChildren), "Registers", "getChildren");
//postCommand(CB(handleRunControlGetChildren), "Memory", "getChildren");
//postCommand(CB(handleRunControlGetChildren), "Breakpoints", "getChildren");
//postCommand(CB(handleRunControlGetChildren), "RunControl", "getChildren");
//postCommand(CB(handleRunControlGetChildren), "Locator", "getChildren");
//postCommand(CB(handleRunControlSuspend),
// "RunControl", "suspend", "\"Thread1\"");
//postCommand(CB(handleRunControlSuspend),
// "RunControl", "getContext", "\"P12318\"");
//postCommand(C("Locator", "sync"), CB(handleRunControlGetChildren));
//postCommand("Locator", "redirect", "ID");
//postCommand(C("FileSystem", "open", "\"/bin/ls\"", "1", "2", "3"),
// CB(handleRunControlGetChildren));
postCommand(C("FileSystem", "stat", "\"/bin/ls\""),
CB(handleRunControlGetChildren));
}
void TcfEngine::postCommand(const QByteArray &cmd,
TcfCommandCallback callback, const char *callbackName)
{
static int token = 20;
++token;
//const char marker_eom = -1;
//const char marker_eos = -2;
//const char marker_null = -3;
QByteArray ba = "C";
ba.append('\0');
ba.append(QByteArray::number(token));
ba.append('\0');
ba.append(cmd);
ba.append('\0');
ba.append('\3');
ba.append('\1');
TcfCommand tcf;
tcf.command = ba;
tcf.callback = callback;
tcf.callbackName = callbackName;
tcf.token = token;
m_cookieForToken[token] = tcf;
enqueueCommand(tcf);
}
// Congestion control does not seem to work that way. Basically it's
// already too late when we get a flow control packet
void TcfEngine::enqueueCommand(const TcfCommand &cmd)
{
#ifdef USE_CONGESTION_CONTROL
// congestion controled
if (m_congestion <= 0 && m_sendQueue.isEmpty()) {
//SDEBUG("DIRECT SEND" << cmd.toString());
sendCommandNow(cmd);
} else {
SDEBUG("QUEUE " << cmd.toString());
m_sendQueue.enqueue(cmd);
m_sendTimer.start();
}
#else
// synchrounously
if (m_inAir == 0)
sendCommandNow(cmd);
else
m_sendQueue.enqueue(cmd);
#endif
}
void TcfEngine::handleSendTimer()
{
QTC_ASSERT(!m_sendQueue.isEmpty(), return);
if (m_congestion > 0) {
// not ready...
SDEBUG("WAITING FOR CONGESTION TO GO DOWN...");
m_sendTimer.start();
} else {
// go!
sendCommandNow(m_sendQueue.dequeue());
}
}
void TcfEngine::sendCommandNow(const TcfCommand &cmd)
{
++m_inAir;
int result = m_socket->write(cmd.command);
Q_UNUSED(result)
m_socket->flush();
showMessage(QString::number(cmd.token) + ' ' + cmd.toString(), LogInput);
SDEBUG("SEND " << cmd.toString()); //<< ' ' << QString::number(result));
}
void TcfEngine::acknowledgeResult()
{
#if !defined(USE_CONGESTION_CONTROL)
QTC_ASSERT(m_inAir == 1, /**/);
m_inAir = 0;
if (!m_sendQueue.isEmpty())
sendCommandNow(m_sendQueue.dequeue());
#endif
}
void TcfEngine::handleRunControlSuspend(const JsonValue &data, const QVariant &)
{
SDEBUG("HANDLE RESULT" << data.toString());
}
void TcfEngine::handleRunControlGetChildren(const JsonValue &data, const QVariant &)
{
SDEBUG("HANDLE RUN CONTROL GET CHILDREN" << data.toString());
}
void TcfEngine::handleSysMonitorGetChildren(const JsonValue &data, const QVariant &)
{
SDEBUG("HANDLE RUN CONTROL GET CHILDREN" << data.toString());
}
//////////////////////////////////////////////////////////////////////
//
// Tooltip specific stuff
//
//////////////////////////////////////////////////////////////////////
static WatchData m_toolTip;
static QPoint m_toolTipPos;
static QHash<QString, WatchData> m_toolTipCache;
bool TcfEngine::setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, const DebuggerToolTipContext &)
{
Q_UNUSED(mousePos)
Q_UNUSED(editor)
return false;
}
//////////////////////////////////////////////////////////////////////
//
// Watch specific stuff
//
//////////////////////////////////////////////////////////////////////
void TcfEngine::assignValueInDebugger(const Internal::WatchData *, const QString &expression, const QVariant &value)
{
XSDEBUG("ASSIGNING: " << expression + '=' + value.toString());
updateLocals();
}
void TcfEngine::updateLocals()
{
}
void TcfEngine::updateWatchData(const WatchData &, const WatchUpdateFlags &)
{
//qq->watchHandler()->rebuildModel();
showStatusMessage(tr("Stopped."), 5000);
}
void TcfEngine::updateSubItem(const WatchData &data0)
{
Q_UNUSED(data0)
QTC_ASSERT(false, return);
}
DebuggerEngine *createTcfEngine(const DebuggerStartParameters &sp)
{
return new TcfEngine(sp);
}
} // namespace Internal
} // namespace Debugger
-175
View File
@@ -1,175 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef DEBUGGER_TCFENGINE_H
#define DEBUGGER_TCFENGINE_H
#include <QtCore/QByteArray>
#include <QtCore/QHash>
#include <QtCore/QMap>
#include <QtCore/QObject>
#include <QtCore/QPoint>
#include <QtCore/QProcess>
#include <QtCore/QQueue>
#include <QtCore/QSet>
#include <QtCore/QTimer>
#include <QtCore/QVariant>
#include <QtNetwork/QAbstractSocket>
QT_BEGIN_NAMESPACE
class QTcpSocket;
QT_END_NAMESPACE
#include "debuggerengine.h"
#include "json.h"
namespace Debugger {
namespace Internal {
class ScriptAgent;
class WatchData;
class TcfEngine : public Debugger::DebuggerEngine
{
Q_OBJECT
public:
explicit TcfEngine(const DebuggerStartParameters &startParameters);
~TcfEngine();
private:
// DebuggerEngine implementation
void executeStep();
void executeStepOut();
void executeNext();
void executeStepI();
void executeNextI();
void setupEngine();
void setupInferior();
void runEngine();
void shutdownInferior();
void shutdownEngine();
bool setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
void continueInferior();
void interruptInferior();
void executeRunToLine(const ContextData &data);
void executeRunToFunction(const QString &functionName);
void executeJumpToLine(const ContextData &data);
void activateFrame(int index);
void selectThread(int index);
void attemptBreakpointSynchronization();
bool acceptsBreakpoint(BreakpointId) const { return false; }
void assignValueInDebugger(const WatchData *data,
const QString &expr, const QVariant &value);
void executeDebuggerCommand(const QString &command);
void loadSymbols(const QString &moduleName);
void loadAllSymbols();
void requestModuleSymbols(const QString &moduleName);
void reloadModules();
void reloadRegisters() {}
void reloadSourceFiles() {}
void reloadFullStack() {}
bool supportsThreads() const { return true; }
void maybeBreakNow(bool byFunction);
void updateWatchData(const WatchData &data, const WatchUpdateFlags &flags);
void updateLocals();
void updateSubItem(const WatchData &data);
Q_SLOT void socketConnected();
Q_SLOT void socketDisconnected();
Q_SLOT void socketError(QAbstractSocket::SocketError);
Q_SLOT void socketReadyRead();
void handleResponse(const QByteArray &ba);
void handleRunControlSuspend(const JsonValue &response, const QVariant &);
void handleRunControlGetChildren(const JsonValue &response, const QVariant &);
void handleSysMonitorGetChildren(const JsonValue &response, const QVariant &);
private:
Q_SLOT void startDebugging();
typedef void (TcfEngine::*TcfCommandCallback)
(const JsonValue &record, const QVariant &cookie);
struct TcfCommand
{
TcfCommand() : flags(0), token(-1), callback(0), callbackName(0) {}
QString toString() const;
int flags;
int token;
TcfCommandCallback callback;
const char *callbackName;
QByteArray command;
QVariant cookie;
};
void postCommand(const QByteArray &cmd,
TcfCommandCallback callback = 0, const char *callbackName = 0);
void sendCommandNow(const TcfCommand &command);
QHash<int, TcfCommand> m_cookieForToken;
QQueue<TcfCommand> m_sendQueue;
// timer based congestion control. does not seem to work well.
void enqueueCommand(const TcfCommand &command);
Q_SLOT void handleSendTimer();
int m_congestion;
QTimer m_sendTimer;
// synchrounous communication
void acknowledgeResult();
int m_inAir;
QTcpSocket *m_socket;
QByteArray m_inbuffer;
QList<QByteArray> m_services;
};
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_TCFENGINE_H
+4 -2
View File
@@ -35,6 +35,8 @@
#include "formeditorw.h"
#include "formeditorstack.h"
#include <coreplugin/editormanager/ieditor.h>
#include <utils/qtcassert.h>
#include <QtGui/QVBoxLayout>
@@ -109,9 +111,9 @@ void EditorWidget::add(const EditorData &d)
m_stack->add(d);
}
bool EditorWidget::removeFormWindowEditor(Core::IEditor *xmlEditor)
void EditorWidget::removeFormWindowEditor(Core::IEditor *xmlEditor)
{
return m_stack->removeFormWindowEditor(xmlEditor);
m_stack->removeFormWindowEditor(xmlEditor);
}
bool EditorWidget::setVisibleEditor(Core::IEditor *xmlEditor)
+1 -1
View File
@@ -68,7 +68,7 @@ public:
// Form editor stack API
void add(const EditorData &d);
bool removeFormWindowEditor(Core::IEditor *xmlEditor);
void removeFormWindowEditor(Core::IEditor *xmlEditor);
bool setVisibleEditor(Core::IEditor *xmlEditor);
SharedTools::WidgetHost *formWindowEditorForXmlEditor(const Core::IEditor *xmlEditor) const;
SharedTools::WidgetHost *formWindowEditorForFormWindow(const QDesignerFormWindowInterface *fw) const;
+18 -13
View File
@@ -78,12 +78,17 @@ void FormEditorStack::add(const EditorData &data)
m_formEditors.append(data);
addWidget(data.widgetHost);
// Editors are normally removed by listening to EditorManager::editorsClosed.
// However, in the case opening a file fails, EditorManager just deletes the editor, which
// is caught by the destroyed() signal.
connect(data.formWindowEditor, SIGNAL(destroyed(QObject*)),
this, SLOT(removeFormWindowEditor(QObject*)));
connect(data.widgetHost, SIGNAL(formWindowSizeChanged(int,int)),
this, SLOT(formSizeChanged(int,int)));
if (Designer::Constants::Internal::debug)
qDebug() << "FormEditorStack::add" << data.widgetHost;
qDebug() << "FormEditorStack::add" << data.widgetHost << m_formEditors.size();
// Since we have 1 pixel splitters we enforce no frame
// on the content widget
@@ -91,7 +96,7 @@ void FormEditorStack::add(const EditorData &data)
frame->setFrameStyle(QFrame::NoFrame);
}
int FormEditorStack::indexOf(const QDesignerFormWindowInterface *fw) const
int FormEditorStack::indexOfFormWindow(const QDesignerFormWindowInterface *fw) const
{
const int count = m_formEditors.size();
for(int i = 0; i < count; ++i)
@@ -100,7 +105,7 @@ int FormEditorStack::indexOf(const QDesignerFormWindowInterface *fw) const
return -1;
}
int FormEditorStack::indexOf(const Core::IEditor *xmlEditor) const
int FormEditorStack::indexOfFormEditor(const QObject *xmlEditor) const
{
const int count = m_formEditors.size();
for(int i = 0; i < count; ++i)
@@ -113,7 +118,7 @@ EditorData FormEditorStack::activeEditor() const
{
// Should actually be in sync with current index.
if (QDesignerFormWindowInterface *afw = m_designerCore->formWindowManager()->activeFormWindow()) {
const int index = indexOf(afw);
const int index = indexOfFormWindow(afw);
if (index >= 0)
return m_formEditors.at(index);
}
@@ -122,28 +127,28 @@ EditorData FormEditorStack::activeEditor() const
SharedTools::WidgetHost *FormEditorStack::formWindowEditorForFormWindow(const QDesignerFormWindowInterface *fw) const
{
const int i = indexOf(fw);
const int i = indexOfFormWindow(fw);
return i != -1 ? m_formEditors[i].widgetHost : static_cast<SharedTools::WidgetHost *>(0);
}
bool FormEditorStack::removeFormWindowEditor(Core::IEditor *xmlEditor)
void FormEditorStack::removeFormWindowEditor(QObject *xmlEditor)
{
const int i = indexOfFormEditor(xmlEditor);
if (Designer::Constants::Internal::debug)
qDebug() << "FormEditorStack::removeFormWindowEditor" << xmlEditor;
const int i = indexOf(xmlEditor);
if (i == -1) // Fail silently as this is invoked for all editors.
return false;
qDebug() << "FormEditorStack::removeFormWindowEditor" << xmlEditor << i << " of " << m_formEditors.size() ;
if (i == -1) // Fail silently as this is invoked for all editors from EditorManager
return; // and editor deletion signal.
removeWidget(m_formEditors[i].widgetHost);
m_formEditors[i].widgetHost->deleteLater();
m_formEditors.removeAt(i);
return true;
}
bool FormEditorStack::setVisibleEditor(Core::IEditor *xmlEditor)
{
if (Designer::Constants::Internal::debug)
qDebug() << "FormEditorStack::setVisibleEditor" << xmlEditor;
const int i = indexOf(xmlEditor);
const int i = indexOfFormEditor(xmlEditor);
QTC_ASSERT(i != -1, return false);
if (i != currentIndex())
@@ -177,7 +182,7 @@ void FormEditorStack::formSizeChanged(int w, int h)
SharedTools::WidgetHost *FormEditorStack::formWindowEditorForXmlEditor(const Core::IEditor *xmlEditor) const
{
const int i = indexOf(xmlEditor);
const int i = indexOfFormEditor(xmlEditor);
return i != -1 ? m_formEditors.at(i).widgetHost : static_cast<SharedTools::WidgetHost *>(0);
}
+5 -3
View File
@@ -66,7 +66,6 @@ public:
explicit FormEditorStack(QWidget *parent = 0);
void add(const EditorData &d);
bool removeFormWindowEditor(Core::IEditor *xmlEditor);
bool setVisibleEditor(Core::IEditor *xmlEditor);
SharedTools::WidgetHost *formWindowEditorForXmlEditor(const Core::IEditor *xmlEditor) const;
@@ -74,14 +73,17 @@ public:
EditorData activeEditor() const;
public slots:
void removeFormWindowEditor(QObject *);
private slots:
void updateFormWindowSelectionHandles();
void modeAboutToChange(Core::IMode *);
void formSizeChanged(int w, int h);
private:
inline int indexOf(const QDesignerFormWindowInterface *) const;
inline int indexOf(const Core::IEditor *xmlEditor) const;
inline int indexOfFormWindow(const QDesignerFormWindowInterface *) const;
inline int indexOfFormEditor(const QObject *xmlEditor) const;
QList<EditorData> m_formEditors;
QDesignerFormEditorInterface *m_designerCore;
+13 -3
View File
@@ -510,6 +510,8 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
const QStringList &parameterNames,
QString *errorMessage)
{
typedef QMap<int, Document::Ptr> DocumentMap;
const EditorData ed = m_few->activeEditor();
QTC_ASSERT(ed, return false)
const QString currentUiFile = ed.formWindowEditor->file()->fileName();
@@ -522,6 +524,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
// be generating the ui_<>.h file for it, and the .pro file knows what the generated file's name and its absolute path will be.
// So we should somehow get that info from project manager (?)
const QFileInfo fi(currentUiFile);
const QString uiFolder = fi.absolutePath();
const QString uicedName = QLatin1String("ui_") + fi.completeBaseName() + QLatin1String(".h");
// Retrieve code model snapshot restricted to project of ui file.
@@ -542,11 +545,18 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
docTable = newDocTable;
// take all docs, find the ones that include the ui_xx.h.
QList<Document::Ptr> docList = findDocumentsIncluding(docTable, uicedName, true); // change to false when we know the absolute path to generated ui_<>.h file
// Sort into a map, putting the ones whose path closely matches the ui-folder path
// first in case there are project subdirectories that contain identical file names.
const QList<Document::Ptr> docList = findDocumentsIncluding(docTable, uicedName, true); // change to false when we know the absolute path to generated ui_<>.h file
DocumentMap docMap;
foreach (const Document::Ptr &d, docList) {
const QFileInfo docFi(d->fileName());
docMap.insert(qAbs(docFi.absolutePath().compare(uiFolder, Qt::CaseInsensitive)), d);
}
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << objectName << signalSignature << "Looking for " << uicedName << " returned " << docList.size();
if (docList.isEmpty()) {
if (docMap.isEmpty()) {
*errorMessage = tr("No documents matching '%1' could be found.\nRebuilding the project might help.").arg(uicedName);
return false;
}
@@ -564,7 +574,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
const Class *cl = 0;
Document::Ptr doc;
foreach (const Document::Ptr &d, docList) {
foreach (const Document::Ptr &d, docMap) {
const ClassDocumentPtrPair cd = findClassRecursively(docTable, d, uiClass, 1u , &namespaceName);
if (cd.first) {
cl = cd.first;
+17 -6
View File
@@ -409,7 +409,13 @@ public:
bool is(int c) const
{
return m_xkey == c && m_modifiers != Qt::ControlModifier;
return m_xkey == c && m_modifiers !=
#ifdef Q_WS_MAC
Qt::MetaModifier
#else
Qt::ControlModifier
#endif
;
}
bool isControl(int c) const
@@ -510,21 +516,25 @@ class History
{
public:
History() : m_index(0) {}
void append(const QString &item)
{ //qDebug() << "APP: " << item << m_items;
m_items.removeAll(item);
m_items.append(item); m_index = m_items.size() - 1; }
void append(const QString &item);
void down() { m_index = qMin(m_index + 1, m_items.size()); }
void up() { m_index = qMax(m_index - 1, 0); }
//void clear() { m_items.clear(); m_index = 0; }
void restart() { m_index = m_items.size(); }
QString current() const { return m_items.value(m_index, QString()); }
QStringList items() const { return m_items; }
private:
QStringList m_items;
int m_index;
};
void History::append(const QString &item)
{
if (item.isEmpty())
return;
m_items.removeAll(item);
m_items.append(item); m_index = m_items.size() - 1;
}
// Mappings for a specific mode.
class ModeMapping : public QList<QPair<Inputs, Inputs> >
@@ -2945,6 +2955,7 @@ EventResult FakeVimHandler::Private::handleSearchSubSubMode(const Input &input)
{
if (input.isEscape()) {
m_commandBuffer.clear();
g.searchHistory.append(m_searchCursor.selectedText());
m_searchCursor = QTextCursor();
updateSelection();
enterCommandMode();
+1 -1
View File
@@ -108,7 +108,7 @@ public:
layout->setContentsMargins(3, 0, 3, 0);
layout->setSpacing(2);
m_patience->setToolTip(tr("Use the patience algorithmn for calculating the diff"));
m_patience->setToolTip(tr("Use the patience algorithm for calculating the diff"));
m_patience->setText(tr("Patience"));
layout->addWidget(m_patience);
m_patience->setCheckable(true);
+2 -1
View File
@@ -203,7 +203,8 @@ void DirectoryFilter::refresh(QFutureInterface<void> &future)
QStringList filesFound;
while (!future.isCanceled() && it.hasNext()) {
filesFound << it.next();
if (future.isProgressUpdateNeeded()) {
if (future.isProgressUpdateNeeded()
|| future.progressValue() == 0 /*workaround for regression in Qt*/) {
future.setProgressValueAndText(it.currentProgress(),
tr("%1 filter update: %n files", 0, filesFound.size()).arg(m_name));
}
+1 -1
View File
@@ -238,7 +238,7 @@ MemcheckTool::MemcheckTool(QObject *parent) :
m_filterProjectAction->setCheckable(true);
m_suppressionSeparator->setSeparator(true);
m_suppressionSeparator->setToolTip(tr("These suppression files where used in the last memory analyzer run."));
m_suppressionSeparator->setToolTip(tr("These suppression files were used in the last memory analyzer run."));
}
void MemcheckTool::settingsDestroyed(QObject *settings)
@@ -166,7 +166,7 @@ void ApplicationLauncher::guiProcessError()
default:
error = tr("Some error has occurred while running the program.");
}
emit appendMessage(error, ErrorMessageFormat);
emit appendMessage(error + QLatin1Char('\n'), ErrorMessageFormat);
emit processExited(d->m_guiProcess.exitCode());
}
@@ -112,11 +112,6 @@ void BuildStepListWidget::init(BuildStepList *bsl)
m_addButton->setText(tr("Add %1 Step").arg(m_buildStepList->displayName()));
// make sure widget is updated
foreach(BuildStepsWidgetStruct s, m_buildSteps) {
s.widget->init();
s.detailsWidget->setSummaryText(s.widget->summaryText());
}
updateBuildStepButtonsState();
static QLatin1String buttonStyle(
+7 -2
View File
@@ -37,6 +37,7 @@
#include "linuxiccparser.h"
#include "headerpath.h"
#include "projectexplorerconstants.h"
#include "toolchainmanager.h"
#include <utils/environment.h>
#include <utils/synchronousprocess.h>
@@ -287,7 +288,9 @@ void GccToolChain::updateId()
{
QString i = id();
i = i.left(i.indexOf(QLatin1Char(':')));
setId(QString::fromLatin1("%1:%2.%3").arg(i).arg(m_compilerPath).arg(m_targetAbi.toString()));
setId(QString::fromLatin1("%1:%2.%3.%4")
.arg(i).arg(m_compilerPath)
.arg(m_targetAbi.toString()).arg(m_debuggerCommand));
}
QString GccToolChain::typeName() const
@@ -521,12 +524,14 @@ QList<ToolChain *> Internal::GccToolChainFactory::autoDetectToolchains(const QSt
if (!abiList.contains(requiredAbi))
return result;
QString debuggerPath; // Find the first debugger
QString debuggerPath = ToolChainManager::instance()->defaultDebugger(requiredAbi); // Find the first debugger
if (debuggerPath.isEmpty()) {
foreach (const QString &debugger, debuggers) {
debuggerPath = systemEnvironment.searchInPath(debugger);
if (!debuggerPath.isEmpty())
break;
}
}
foreach (const Abi &abi, abiList) {
QScopedPointer<GccToolChain> tc(createToolChain(true));
@@ -363,8 +363,8 @@ MsvcToolChain::MsvcToolChain(const QString &name, const Abi &abi,
Q_ASSERT(abi.binaryFormat() == Abi::PEFormat);
Q_ASSERT(abi.osFlavor() != Abi::WindowsMSysFlavor);
setId(QString::fromLatin1("%1:%2.%3").arg(Constants::MSVC_TOOLCHAIN_ID).arg(m_varsBat)
.arg(m_varsBatArg));
setId(QString::fromLatin1("%1:%2.%3.%4").arg(Constants::MSVC_TOOLCHAIN_ID).arg(m_varsBat)
.arg(m_varsBatArg).arg(m_debuggerCommand));
setDisplayName(name);
}
@@ -1579,7 +1579,8 @@ void ProjectExplorerPlugin::updateActions()
d->m_rebuildProjectOnlyAction->setEnabled(enableBuildActions);
d->m_cleanProjectOnlyAction->setEnabled(enableBuildActions);
d->m_clearSession->setEnabled(hasProjects && enabledSessionBuildActions);
d->m_clearSession->setEnabled(hasProjects);
d->m_buildSessionAction->setEnabled(hasProjects && enabledSessionBuildActions);
d->m_rebuildSessionAction->setEnabled(hasProjects && enabledSessionBuildActions);
d->m_cleanSessionAction->setEnabled(hasProjects && enabledSessionBuildActions);
@@ -117,7 +117,6 @@ ProjectTreeWidget::ProjectTreeWidget(QWidget *parent)
this, SLOT(filesAboutToBeRemoved(FolderNode *, const QList<FileNode*> &)));
m_view = new ProjectTreeView;
m_view->header()->setStretchLastSection(true);
m_view->setModel(m_model);
setFocusProxy(m_view);
initView();
@@ -47,6 +47,9 @@
static const char *const TOOLCHAIN_DATA_KEY = "ToolChain.";
static const char *const TOOLCHAIN_COUNT_KEY = "ToolChain.Count";
static const char *const TOOLCHAIN_FILE_VERSION_KEY = "Version";
static const char *const DEFAULT_DEBUGGER_COUNT_KEY = "DefaultDebugger.Count";
static const char *const DEFAULT_DEBUGGER_ABI_KEY = "DefaultDebugger.Abi.";
static const char *const DEFAULT_DEBUGGER_PATH_KEY = "DefaultDebugger.Path.";
static const char *const TOOLCHAIN_FILENAME = "/toolChains.xml";
static QString settingsFileName()
@@ -70,6 +73,7 @@ class ToolChainManagerPrivate
{
public:
QList<ToolChain *> m_toolChains;
QMap<QString, QString> m_abiToDebugger;
};
} // namespace Internal
@@ -96,6 +100,11 @@ ToolChainManager::ToolChainManager(QObject *parent) :
void ToolChainManager::restoreToolChains()
{
// Restore SDK settings first
restoreToolChains(Core::ICore::instance()->resourcePath()
+ QLatin1String("/Nokia") + QLatin1String(TOOLCHAIN_FILENAME), true);
// Then auto detect
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
QList<ToolChainFactory *> factories = pm->getObjects<ToolChainFactory>();
// Autodetect tool chains:
@@ -105,9 +114,8 @@ void ToolChainManager::restoreToolChains()
registerToolChain(tc);
}
// Then restore user settings
restoreToolChains(settingsFileName(), false);
restoreToolChains(Core::ICore::instance()->resourcePath()
+ QLatin1String("/Nokia") + QLatin1String(TOOLCHAIN_FILENAME), true);
}
ToolChainManager::~ToolChainManager()
@@ -138,6 +146,8 @@ void ToolChainManager::saveToolChains()
}
writer.saveValue(QLatin1String(TOOLCHAIN_COUNT_KEY), count);
writer.save(settingsFileName(), "QtCreatorToolChains");
// Do not save default debuggers! Those are set by the SDK!
}
void ToolChainManager::restoreToolChains(const QString &fileName, bool autoDetected)
@@ -152,10 +162,22 @@ void ToolChainManager::restoreToolChains(const QString &fileName, bool autoDetec
if (version < 1)
return;
// Read default debugger settings (if any)
int count = data.value(QLatin1String(DEFAULT_DEBUGGER_COUNT_KEY)).toInt();
for (int i = 0; i < count; ++i) {
const QString abiKey = QString::fromLatin1(DEFAULT_DEBUGGER_ABI_KEY) + QString::number(i);
if (!data.contains(abiKey))
continue;
const QString pathKey = QString::fromLatin1(DEFAULT_DEBUGGER_PATH_KEY) + QString::number(i);
if (!data.contains(abiKey))
continue;
m_d->m_abiToDebugger.insert(data.value(abiKey).toString(), data.value(pathKey).toString());
}
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
QList<ToolChainFactory *> factories = pm->getObjects<ToolChainFactory>();
int count = data.value(QLatin1String(TOOLCHAIN_COUNT_KEY), 0).toInt();
count = data.value(QLatin1String(TOOLCHAIN_COUNT_KEY), 0).toInt();
for (int i = 0; i < count; ++i) {
const QString key = QString::fromLatin1(TOOLCHAIN_DATA_KEY) + QString::number(i);
if (!data.contains(key))
@@ -207,6 +229,11 @@ ToolChain *ToolChainManager::findToolChain(const QString &id) const
return 0;
}
QString ToolChainManager::defaultDebugger(const Abi &abi) const
{
return m_d->m_abiToDebugger.value(abi.toString());
}
void ToolChainManager::notifyAboutUpdate(ProjectExplorer::ToolChain *tc)
{
if (!tc || !m_d->m_toolChains.contains(tc))
@@ -68,6 +68,8 @@ public:
QList<ToolChain *> findToolChains(const Abi &abi) const;
ToolChain *findToolChain(const QString &id) const;
QString defaultDebugger(const Abi &abi) const;
public slots:
bool registerToolChain(ProjectExplorer::ToolChain *tc);
void deregisterToolChain(ProjectExplorer::ToolChain *tc);
@@ -452,7 +452,7 @@ void ToolChainModel::removeToolChain(ToolChain *tc)
// --------------------------------------------------------------------------
ToolChainOptionsPage::ToolChainOptionsPage() :
m_ui(0), m_cloneAction(0), m_model(0), m_selectionModel(0), m_currentTcWidget(0)
m_ui(0), m_model(0), m_selectionModel(0), m_currentTcWidget(0)
{ }
QString ToolChainOptionsPage::id() const
@@ -496,7 +496,7 @@ QWidget *ToolChainOptionsPage::createPage(QWidget *parent)
m_ui->toolChainView->setModel(m_model);
m_ui->toolChainView->header()->setResizeMode(0, QHeaderView::ResizeToContents);
m_ui->toolChainView->header()->setResizeMode(1, QHeaderView::ResizeToContents);
m_ui->toolChainView->header()->setResizeMode(1, QHeaderView::Stretch);
m_ui->toolChainView->expandAll();
m_selectionModel = m_ui->toolChainView->selectionModel();
@@ -521,14 +521,9 @@ QWidget *ToolChainOptionsPage::createPage(QWidget *parent)
addMenu->addAction(action);
}
}
m_cloneAction = new QAction(addMenu);
m_cloneAction->setText(tr("Clone ..."));
connect(m_cloneAction, SIGNAL(triggered()), mapper, SLOT(map()));
mapper->setMapping(m_cloneAction, static_cast<QObject *>(0));
connect(m_ui->cloneButton, SIGNAL(clicked()), mapper, SLOT(map()));
mapper->setMapping(m_ui->cloneButton, static_cast<QObject *>(0));
if (!addMenu->isEmpty())
addMenu->addSeparator();
addMenu->addAction(m_cloneAction);
m_ui->addButton->setMenu(addMenu);
connect(m_ui->delButton, SIGNAL(clicked()), this, SLOT(removeToolChain()));
@@ -619,7 +614,7 @@ void ToolChainOptionsPage::updateState()
canDelete = !tc->isAutoDetected();
}
m_cloneAction->setEnabled(canCopy);
m_ui->cloneButton->setEnabled(canCopy);
m_ui->delButton->setEnabled(canDelete);
}
@@ -144,7 +144,6 @@ private:
Ui::ToolChainOptionsPage *m_ui;
QWidget *m_configWidget;
QString m_searchKeywords;
QAction *m_cloneAction;
ToolChainModel *m_model;
QList<ToolChainFactory *> m_factories;
@@ -50,6 +50,25 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cloneButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>21</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Clone</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="delButton">
<property name="sizePolicy">
@@ -134,6 +134,7 @@ void WinGuiProcess::run()
if (!started) {
emit processMessage(tr("The process could not be started: %1").
arg(Utils::winErrorMessage(GetLastError())), true);
emit processFinished(0);
break;
}
@@ -285,13 +285,13 @@ AbstractFormEditorTool* FormEditorView::currentTool() const
return m_currentTool;
}
void FormEditorView::changeToMoveTool()
bool FormEditorView::changeToMoveTool()
{
if (m_currentTool == m_moveTool)
return;
return true;
if (!isMoveToolAvailable())
return;
return false;
scene()->setPaintMode(FormEditorScene::NormalMode);
m_scene->updateAllFormEditorItems();
@@ -300,6 +300,7 @@ void FormEditorView::changeToMoveTool()
m_currentTool = m_moveTool;
m_currentTool->clear();
m_currentTool->setItems(scene()->itemsForQmlItemNodes(selectedQmlItemNodes()));
return true;
}
void FormEditorView::changeToDragTool()
@@ -317,13 +318,13 @@ void FormEditorView::changeToDragTool()
}
void FormEditorView::changeToMoveTool(const QPointF &beginPoint)
bool FormEditorView::changeToMoveTool(const QPointF &beginPoint)
{
if (m_currentTool == m_moveTool)
return;
return true;
if (!isMoveToolAvailable())
return;
return false;
scene()->setPaintMode(FormEditorScene::NormalMode);
m_scene->updateAllFormEditorItems();
@@ -333,6 +334,7 @@ void FormEditorView::changeToMoveTool(const QPointF &beginPoint)
m_currentTool->clear();
m_currentTool->setItems(scene()->itemsForQmlItemNodes(selectedQmlItemNodes()));
m_moveTool->beginWithPoint(beginPoint);
return true;
}
void FormEditorView::changeToSelectionTool()
@@ -91,8 +91,8 @@ public:
AbstractFormEditorTool *currentTool() const;
FormEditorScene *scene() const;
void changeToMoveTool();
void changeToMoveTool(const QPointF &beginPoint);
bool changeToMoveTool();
bool changeToMoveTool(const QPointF &beginPoint);
void changeToDragTool();
void changeToSelectionTool();
void changeToItemCreatorTool();
@@ -210,7 +210,7 @@ void SelectionTool::keyPressEvent(QKeyEvent *event)
case Qt::Key_Right:
case Qt::Key_Up:
case Qt::Key_Down:
view()->changeToMoveTool();
if (view()->changeToMoveTool())
view()->currentTool()->keyPressEvent(event);
break;
}
@@ -507,8 +507,7 @@ void DesignDocumentController::deleteSelected()
void DesignDocumentController::copySelected()
{
QScopedPointer<Model> model(Model::create("Qt/Rectangle"));
model->setMetaInfo(m_d->model->metaInfo());
QScopedPointer<Model> model(Model::create("QtQuick.Rectangle", 1, 0, this->model()));
model->setFileUrl(m_d->model->fileUrl());
model->changeImports(m_d->model->imports(), QList<Import>());
@@ -552,7 +551,7 @@ void DesignDocumentController::copySelected()
foreach (ModelNode node, view.rootModelNode().allDirectSubModelNodes()) {
node.destroy();
}
view.changeRootNodeType("Qt/Rectangle", 4, 7);
view.changeRootNodeType("QtQuick.Rectangle", 1, 0);
view.rootModelNode().setId("designer__Selection");
foreach (const ModelNode &selectedNode, selectedNodes) {
@@ -603,8 +602,7 @@ static void scatterItem(ModelNode pastedNode, const ModelNode targetNode, int of
void DesignDocumentController::paste()
{
QScopedPointer<Model> model(Model::create("empty"));
model->setMetaInfo(m_d->model->metaInfo());
QScopedPointer<Model> model(Model::create("empty", 1, 0, this->model()));
model->setFileUrl(m_d->model->fileUrl());
model->changeImports(m_d->model->imports(), QList<Import>());
@@ -155,13 +155,22 @@ void DesignDocumentControllerView::fromClipboard()
QString DesignDocumentControllerView::toText() const
{
QScopedPointer<Model> outputModel(Model::create("QtQuick.Rectangle", 1, 0));
outputModel->setMetaInfo(model()->metaInfo());
QScopedPointer<Model> outputModel(Model::create("QtQuick.Rectangle", 1, 0, model()));
QPlainTextEdit textEdit;
textEdit.setPlainText("import Qt 4.7; Item {}");
QString imports;
foreach (const Import &import, model()->imports()) {
if (import.isFileImport())
imports += QLatin1String("import ") + QLatin1String("\"") + import.file() + QLatin1String("\"")+ QLatin1String(";\n");
else
imports += QLatin1String("import ") + import.url() + QLatin1String(" ") + import.version() + QLatin1String(";\n");
}
textEdit.setPlainText(imports + QLatin1String("Item {\n}\n"));
NotIndentingTextEditModifier modifier(&textEdit);
QScopedPointer<RewriterView> rewriterView(new RewriterView(RewriterView::Amend, 0));
rewriterView->setCheckSemanticErrors(false);
rewriterView->setTextModifier(&modifier);
outputModel->attachView(rewriterView.data());
@@ -177,8 +186,7 @@ QString DesignDocumentControllerView::toText() const
void DesignDocumentControllerView::fromText(QString text)
{
QScopedPointer<Model> inputModel(Model::create("QtQuick.Rectangle", 1, 0));
inputModel->setMetaInfo(model()->metaInfo());
QScopedPointer<Model> inputModel(Model::create("QtQuick.Rectangle", 1, 0, model()));
inputModel->setFileUrl(model()->fileUrl());
QPlainTextEdit textEdit;
QString imports;
@@ -189,6 +197,7 @@ void DesignDocumentControllerView::fromText(QString text)
NotIndentingTextEditModifier modifier(&textEdit);
QScopedPointer<RewriterView> rewriterView(new RewriterView(RewriterView::Amend, 0));
rewriterView->setCheckSemanticErrors(false);
rewriterView->setTextModifier(&modifier);
inputModel->attachView(rewriterView.data());
@@ -315,7 +315,7 @@ void NavigatorTreeModel::handleChangedItem(QStandardItem *item)
ItemRow itemRow = itemRowForNode(node);
if (item == itemRow.idItem) {
if (node.isValidId(item->text())) {
if (node.isValidId(item->text()) && !node.view()->modelNodeForId(item->text()).isValid()) {
if (node.id().isEmpty() || item->text().isEmpty()) { //no id
try {
node.setId(item->text());
@@ -327,8 +327,14 @@ void NavigatorTreeModel::handleChangedItem(QStandardItem *item)
node.view()->rewriterView()->renameId(node.id(), item->text());
}
} else {
if (!node.isValidId(item->text()))
QMessageBox::warning(0, tr("Invalid Id"), tr("%1 is an invalid id").arg(item->text()));
else
QMessageBox::warning(0, tr("Invalid Id"), tr("%1 already exists").arg(item->text()));
bool blockSingals = blockItemChangedSignal(true);
item->setText(node.id());
blockItemChangedSignal(blockSingals);
}
} else if (item == itemRow.visibilityItem) {
bool invisible = (item->checkState() == Qt::Unchecked);
@@ -368,12 +368,17 @@ void PropertyEditor::changeValue(const QString &propertyName)
PropertyEditorValue *value = qobject_cast<PropertyEditorValue*>(QDeclarativeMetaType::toQObject(m_currentType->m_backendValuesPropertyMap.value(propertyName)));
const QString newId = value->value().toString();
if (m_selectedNode.isValidId(newId)) {
if (newId == m_selectedNode.id())
return;
if (m_selectedNode.isValidId(newId) && !modelNodeForId(newId).isValid() ) {
if (m_selectedNode.id().isEmpty() || newId.isEmpty()) { //no id
try {
m_selectedNode.setId(newId);
} catch (InvalidIdException &e) { //better save then sorry
m_locked = true;
value->setValue(m_selectedNode.id());
m_locked = false;
QMessageBox::warning(0, tr("Invalid Id"), e.description());
}
} else { //there is already an id, so we refactor
@@ -381,8 +386,13 @@ void PropertyEditor::changeValue(const QString &propertyName)
rewriterView()->renameId(m_selectedNode.id(), newId);
}
} else {
m_locked = true;
value->setValue(m_selectedNode.id());
m_locked = false;
if (!m_selectedNode.isValidId(newId))
QMessageBox::warning(0, tr("Invalid Id"), tr("%1 is an invalid id").arg(newId));
else
QMessageBox::warning(0, tr("Invalid Id"), tr("%1 already exists").arg(newId));
}
return;
}
@@ -454,6 +464,7 @@ void PropertyEditor::changeExpression(const QString &name)
RewriterTransaction transaction = beginRewriterTransaction();
try {
QString underscoreName(name);
underscoreName.replace(QLatin1Char('.'), QLatin1Char('_'));
@@ -464,6 +475,7 @@ void PropertyEditor::changeExpression(const QString &name)
if (fxObjectNode.modelNode().metaInfo().propertyTypeName(name) == QLatin1String("QColor")) {
if (QColor(value->expression().remove('"')).isValid()) {
fxObjectNode.setVariantProperty(name, QColor(value->expression().remove('"')));
transaction.commit(); //committing in the try block
return;
}
} else if (fxObjectNode.modelNode().metaInfo().propertyTypeName(name) == QLatin1String("bool")) {
@@ -472,6 +484,7 @@ void PropertyEditor::changeExpression(const QString &name)
fxObjectNode.setVariantProperty(name, true);
else
fxObjectNode.setVariantProperty(name, false);
transaction.commit(); //committing in the try block
return;
}
} else if (fxObjectNode.modelNode().metaInfo().propertyTypeName(name) == QLatin1String("int")) {
@@ -479,6 +492,7 @@ void PropertyEditor::changeExpression(const QString &name)
int intValue = value->expression().toInt(&ok);
if (ok) {
fxObjectNode.setVariantProperty(name, intValue);
transaction.commit(); //committing in the try block
return;
}
} else if (fxObjectNode.modelNode().metaInfo().propertyTypeName(name) == QLatin1String("qreal")) {
@@ -486,6 +500,7 @@ void PropertyEditor::changeExpression(const QString &name)
qreal realValue = value->expression().toFloat(&ok);
if (ok) {
fxObjectNode.setVariantProperty(name, realValue);
transaction.commit(); //committing in the try block
return;
}
}
@@ -496,9 +511,10 @@ void PropertyEditor::changeExpression(const QString &name)
return;
}
try {
if (fxObjectNode.expression(name) != value->expression() || !fxObjectNode.propertyAffectedByCurrentState(name))
fxObjectNode.setBindingProperty(name, value->expression());
transaction.commit(); //committing in the try block
}
catch (RewritingException &e) {
@@ -156,7 +156,7 @@ void PropertyEditorValue::setExpression(const QString &expression)
bool PropertyEditorValue::isInSubState() const
{
const QmlDesigner::QmlObjectNode objectNode(modelNode());
return objectNode.isValid() && objectNode.propertyAffectedByCurrentState(name());
return objectNode.isValid() && objectNode.currentState().isValid() && objectNode.propertyAffectedByCurrentState(name());
}
bool PropertyEditorValue::isBound() const
@@ -84,7 +84,7 @@ public:
virtual ~Model();
static Model *create(QString type, int major = 4, int minor = 7);
static Model *create(QString type, int major = 4, int minor = 7, Model *metaInfoPropxyModel = 0);
Model *masterModel() const;
void setMasterModel(Model *model);
@@ -96,7 +96,6 @@ public:
MetaInfo metaInfo();
NodeMetaInfo metaInfo(const QString &typeName, int majorVersion = -1, int minorVersion = -1);
bool hasNodeMetaInfo(const QString &typeName, int majorVersion = -1, int minorVersion = -1);
void setMetaInfo(const MetaInfo &metaInfo);
void attachView(AbstractView *view);
void detachView(AbstractView *view, ViewNotification emitDetachNotify = NotifyView);
@@ -109,6 +108,8 @@ public:
RewriterView *rewriterView() const;
Model *metaInfoProxyModel();
protected:
Model();
@@ -187,6 +187,12 @@ public:
QmlJS::LookupContext *lookupContext() const;
QmlJS::Document *document() const;
bool checkSemanticErrors() const
{ return m_checkErrors; }
void setCheckSemanticErrors(bool b)
{ m_checkErrors = b; }
signals:
void errorsChanged(const QList<RewriterView::Error> &errors);
@@ -213,6 +219,7 @@ private: //variables
RewriterTransaction m_removeDefaultPropertyTransaction;
QString m_rewritingErrorMessage;
QString lastCorrectQmlSource;
bool m_checkErrors;
};
} //QmlDesigner
@@ -599,7 +599,7 @@ bool NodeMetaInfoPrivate::isPropertyEnum(const QString &propertyName) const
if (objectInfo->isValid())
return objectInfo->isPropertyEnum(rawPropertyName);
else
return true;
return false;
}
QList<const Interpreter::ObjectValue *> objects;
@@ -121,10 +121,11 @@ void ModelPrivate::detachAllViews()
}
}
Model *ModelPrivate::create(QString type, int major, int minor)
Model *ModelPrivate::create(QString type, int major, int minor, Model *metaInfoPropxyModel)
{
Model *model = new Model;
model->m_d->m_metaInfoProxyModel = metaInfoPropxyModel;
model->m_d->rootNode()->setType(type);
model->m_d->rootNode()->setMajorVersion(major);
model->m_d->rootNode()->setMinorVersion(minor);
@@ -1628,9 +1629,9 @@ Model::~Model()
}
Model *Model::create(QString type, int major, int minor)
Model *Model::create(QString type, int major, int minor, Model *metaInfoPropxyModel)
{
return Internal::ModelPrivate::create(type, major, minor);
return Internal::ModelPrivate::create(type, major, minor, metaInfoPropxyModel);
}
@@ -1686,6 +1687,18 @@ RewriterView *Model::rewriterView() const
return m_d->rewriterView();
}
/*!
\brief Returns the model that is used for metainfo
\return Return itself if not other metaInfoProxyModel does exist
*/
Model *Model::metaInfoProxyModel()
{
if (m_d->m_metaInfoProxyModel)
return m_d->m_metaInfoProxyModel->metaInfoProxyModel();
else
return this;
}
#if 0
/*!
\brief Creates a new empty model
@@ -1746,15 +1759,6 @@ NodeMetaInfo Model::metaInfo(const QString &typeName, int majorVersion, int mino
return NodeMetaInfo(this, typeName, majorVersion, minorVersion);
}
/*!
\brief Sets a specific Metainfo on this Model
*/
void Model::setMetaInfo(const MetaInfo &metaInfo)
{
Internal::WriteLocker locker(m_d);
m_d->setMetaInfo(metaInfo);
}
/*!
\brief Returns list of QML types available within the model.
*/
@@ -97,7 +97,7 @@ public:
ModelPrivate(Model *model);
~ModelPrivate();
static Model *create(QString type, int major, int minor);
static Model *create(QString type, int major, int minor, Model *metaInfoPropxyModel);
QUrl fileUrl() const;
void setFileUrl(const QUrl &url);
@@ -240,6 +240,8 @@ private:
QWeakPointer<Model> m_masterModel;
QWeakPointer<RewriterView> m_rewriterView;
QWeakPointer<NodeInstanceView> m_nodeInstanceView;
QWeakPointer<Model> m_metaInfoProxyModel;
bool m_writeLock;
qint32 m_internalIdCounter;
};

Some files were not shown because too many files have changed in this diff Show More