...
 
Commits (73)
...@@ -48,9 +48,12 @@ Project support ...@@ -48,9 +48,12 @@ Project support
* The qmake step is a lot smarter and tries harder to not run * The qmake step is a lot smarter and tries harder to not run
* By default projects using the Microsoft Visual Studio toolchain use jom * By default projects using the Microsoft Visual Studio toolchain use jom
instead of nmake, for better utilization of all processors. instead of nmake, for better utilization of all processors.
* Show subdirectory structure below .pro/.pri files in project tree
* Add "Show file in Finder/Explorer" (Mac/Windows) to context menu.
On Linux it opens the containing directory.
Compilation Compilation
* Support distributed compilation on Windows/MSVC via jom * Support multi-core compilation on Windows/MSVC via jom
(see http://qt.gitorious.org/qt-labs/jom/) (see http://qt.gitorious.org/qt-labs/jom/)
Debugging Debugging
......
unix:QDOC_BIN = $$(QTDIR)/bin/qdoc3
win32:QDOC_BIN = $$(QTDIR)/bin/qdoc3.exe
win32:QDOC_BIN = $$replace(QDOC_BIN, "/", "\\")
# legacy branch, can be dropped as soon as we depend on Qt 4.6
!exists( $$QDOC_BIN ) {
unix:QDOC_BIN = $$(QTDIR)/tools/qdoc3/qdoc3
win32 {
QDOC_BIN = $$(QTDIR)/tools/qdoc3/release/qdoc3.exe
QDOC_BIN = $$replace(QDOC_BIN, "/", "\\")
!exists( $$QDOC_BIN ) {
QDOC_BIN = $$(QTDIR)/tools/qdoc3/debug/qdoc3.exe
QDOC_BIN = $$replace(QDOC_BIN, "/", "\\")
}
}
}
unix { unix {
QDOC = SRCDIR=$$PWD OUTDIR=$$OUT_PWD/doc/html $$(QTDIR)/tools/qdoc3/qdoc3 QDOC = SRCDIR=$$PWD OUTDIR=$$OUT_PWD/doc/html $$QDOC_BIN
HELPGENERATOR = $$(QTDIR)/bin/qhelpgenerator HELPGENERATOR = $$(QTDIR)/bin/qhelpgenerator
} else { } else {
QDOC = set SRCDIR=$$PWD&& set OUTDIR=$$OUT_PWD/doc/html&& $$(QTDIR)\tools\qdoc3\release\qdoc3.exe QDOC = set SRCDIR=$$PWD&& set OUTDIR=$$OUT_PWD/doc/html&& $$QDOC_BIN
HELPGENERATOR = $$(QTDIR)\bin\qhelpgenerator.exe HELPGENERATOR = $$(QTDIR)\bin\qhelpgenerator.exe
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
\title Qt Creator Manual \title Qt Creator Manual
\section1 Version 1.2.80 \section1 Version 1.2.90
The goal of Qt Creator is to provide a cross-platform, complete Integrated The goal of Qt Creator is to provide a cross-platform, complete Integrated
Development Environment (IDE) to develop Qt projects. It is available for Development Environment (IDE) to develop Qt projects. It is available for
...@@ -1454,8 +1454,8 @@ ...@@ -1454,8 +1454,8 @@
system. system.
This feature lets you use Qt Creator as a code editor. You can change the This feature lets you use Qt Creator as a code editor. You can change the
way your project is built by modifying the \c make command on the way your project is built by modifying the \c make command under
\gui{Project Settings} page. \gui{Build Settings} in the \gui{Projects} mode.
For a generic project, you have to manually specify which files belong to For a generic project, you have to manually specify which files belong to
your project and which include directories/defines you want to pass to your your project and which include directories/defines you want to pass to your
...@@ -1468,7 +1468,8 @@ ...@@ -1468,7 +1468,8 @@
file. When you first create a generic project, Qt Creator will add any file. When you first create a generic project, Qt Creator will add any
files it recognizes to your project. To add or remove files later, simply files it recognizes to your project. To add or remove files later, simply
edit the \c{.files} file in Qt Creator. Your project tree will be refreshed edit the \c{.files} file in Qt Creator. Your project tree will be refreshed
when you save this file. when you save this file. You can also add or remove files using the context
menu in the project tree.
If you frequently need to update the \c{.files} file, we recommend the use If you frequently need to update the \c{.files} file, we recommend the use
of a small script that will update the files for you. Currently, if the of a small script that will update the files for you. Currently, if the
...@@ -1478,7 +1479,9 @@ ...@@ -1478,7 +1479,9 @@
\section2 Specifying Include Paths \section2 Specifying Include Paths
The include paths are specified in the \c{.includes} file. The include paths are specified in the \c{.includes} file, one include
path per line. The paths can be either absolute or relative to the
\c{.includes} file.
\section2 Specifying Defines \section2 Specifying Defines
...@@ -1490,11 +1493,12 @@ ...@@ -1490,11 +1493,12 @@
#define NAME value #define NAME value
\endcode \endcode
\section2 Creating a Run Configuration \section2 Creating a Run Configuration
Qt Creator cannot automatically determine which executable it should run. Qt Creator cannot automatically determine which executable it should run.
To set up a custom executable run configuration in the \gui Projects mode, To set up a custom executable run configuration in the \gui Projects mode,
use the \bold{+} button. Here you can specify the name, executable, and use the \bold{Add} button. Here you can specify the name, executable, and
some optional arguments. By default, the working directory is some optional arguments. By default, the working directory is
\c{$BUILDDIR} which should work fine. \c{$BUILDDIR} which should work fine.
*/ */
...@@ -1782,7 +1786,7 @@ ...@@ -1782,7 +1786,7 @@
There are some known issues with Qt Creator. There are some known issues with Qt Creator.
The development team is aware of those, there is no need to report them as bug. The development team is aware of those, there is no need to report them as bug.
\section1 Known Issues of Version 1.2.80 \section1 Known Issues of Version 1.2.90
\list \list
\o Gdb on Windows may not work if the 'Embassy \reg Security Center' software \o Gdb on Windows may not work if the 'Embassy \reg Security Center' software
......
...@@ -18,15 +18,15 @@ sources.fileextensions = "qtcreator.qdoc addressbook-sdk.qdoc" ...@@ -18,15 +18,15 @@ sources.fileextensions = "qtcreator.qdoc addressbook-sdk.qdoc"
qhp.projects = QtCreator qhp.projects = QtCreator
qhp.QtCreator.file = qtcreator.qhp qhp.QtCreator.file = qtcreator.qhp
qhp.QtCreator.namespace = com.nokia.qtcreator.1280 qhp.QtCreator.namespace = com.nokia.qtcreator.1290
qhp.QtCreator.virtualFolder = doc qhp.QtCreator.virtualFolder = doc
qhp.QtCreator.indexTitle = Qt Creator qhp.QtCreator.indexTitle = Qt Creator
qhp.QtCreator.indexRoot = qhp.QtCreator.indexRoot =
qhp.QtCreator.extraFiles = classic.css \ qhp.QtCreator.extraFiles = classic.css \
images/qt-logo.png images/qt-logo.png
qhp.QtCreator.filterAttributes = qtcreator 1.2.80 qhp.QtCreator.filterAttributes = qtcreator 1.2.90
qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 1.2.80 qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 1.2.90
qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 1.2.80 qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 1.2.90
# macros.qdocconf # macros.qdocconf
...@@ -202,5 +202,5 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \ ...@@ -202,5 +202,5 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \ "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
"<td width=\"30%\" align=\"left\">Copyright &copy; 2009 Nokia</td>\n" \ "<td width=\"30%\" align=\"left\">Copyright &copy; 2009 Nokia</td>\n" \
"<td width=\"40%\" align=\"center\">&nbsp;</td>\n" \ "<td width=\"40%\" align=\"center\">&nbsp;</td>\n" \
"<td width=\"30%\" align=\"right\"><div align=\"right\">Qt Creator 1.2.80</div></td>\n" \ "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt Creator 1.2.90</div></td>\n" \
"</tr></table></div></address>" "</tr></table></div></address>"
...@@ -1031,7 +1031,7 @@ static void qDumpQAbstractItem(QDumper &d) ...@@ -1031,7 +1031,7 @@ static void qDumpQAbstractItem(QDumper &d)
//d.putItem("value", "(").put(rowCount).put(",").put(columnCount).put(")"); //d.putItem("value", "(").put(rowCount).put(",").put(columnCount).put(")");
d.putItem("value", m->data(mi, Qt::DisplayRole).toString()); d.putItem("value", m->data(mi, Qt::DisplayRole).toString());
d.putItem("valueencoded", "2"); d.putItem("valueencoded", "2");
d.putItem("numchild", "1"); d.putItem("numchild", rowCount * columnCount);
if (d.dumpChildren) { if (d.dumpChildren) {
d.beginChildren(); d.beginChildren();
for (int row = 0; row < rowCount; ++row) { for (int row = 0; row < rowCount; ++row) {
...@@ -1042,7 +1042,7 @@ static void qDumpQAbstractItem(QDumper &d) ...@@ -1042,7 +1042,7 @@ static void qDumpQAbstractItem(QDumper &d)
d.put("[").put(row).put(",").put(column).put("]"); d.put("[").put(row).put(",").put(column).put("]");
d.endItem(); d.endItem();
//d.putItem("numchild", (m->hasChildren(child) ? "1" : "0")); //d.putItem("numchild", (m->hasChildren(child) ? "1" : "0"));
d.putItem("numchild", "1"); d.putItem("numchild", m->rowCount(child) * m->columnCount(child));
d.beginItem("addr"); d.beginItem("addr");
d.put("$").put(child.row()).put(",").put(child.column()).put(",") d.put("$").put(child.row()).put(",").put(child.column()).put(",")
.put(child.internalPointer()).put(",").put(child.model()); .put(child.internalPointer()).put(",").put(child.model());
...@@ -1104,7 +1104,7 @@ static void qDumpQAbstractItemModel(QDumper &d) ...@@ -1104,7 +1104,7 @@ static void qDumpQAbstractItemModel(QDumper &d)
d.putItem("value", m.data(mi, Qt::DisplayRole).toString()); d.putItem("value", m.data(mi, Qt::DisplayRole).toString());
d.putItem("valueencoded", "2"); d.putItem("valueencoded", "2");
//d.putItem("numchild", (m.hasChildren(mi) ? "1" : "0")); //d.putItem("numchild", (m.hasChildren(mi) ? "1" : "0"));
d.putItem("numchild", "1"); d.putItem("numchild", m.rowCount(mi) * m.columnCount(mi));
d.beginItem("addr"); d.beginItem("addr");
d.put("$").put(mi.row()).put(",").put(mi.column()).put(","); d.put("$").put(mi.row()).put(",").put(mi.column()).put(",");
d.put(mi.internalPointer()).put(",").put(mi.model()); d.put(mi.internalPointer()).put(",").put(mi.model());
...@@ -1442,8 +1442,8 @@ static void qDumpQHash(QDumper &d) ...@@ -1442,8 +1442,8 @@ static void qDumpQHash(QDumper &d)
} else { } else {
d.putItem("addr", node); d.putItem("addr", node);
d.beginItem("type"); d.beginItem("type");
d.put("'"NS"QHashNode<").put(keyType).put(",") d.put(NS"QHashNode<").put(keyType).put(",")
.put(valueType).put(MAP_NODE_TYPE_END"'"); .put(valueType).put(MAP_NODE_TYPE_END);
d.endItem(); d.endItem();
} }
d.endHash(); d.endHash();
...@@ -2272,7 +2272,7 @@ static void qDumpQObjectMethodList(QDumper &d) ...@@ -2272,7 +2272,7 @@ static void qDumpQObjectMethodList(QDumper &d)
static const char *qConnectionType(uint type) static const char *qConnectionType(uint type)
{ {
Qt::ConnectionType connType = static_cast<Qt::ConnectionType>(type); Qt::ConnectionType connType = static_cast<Qt::ConnectionType>(type);
const char *output; const char *output = "unknown";
switch (connType) { switch (connType) {
case Qt::AutoConnection: output = "auto"; break; case Qt::AutoConnection: output = "auto"; break;
case Qt::DirectConnection: output = "direct"; break; case Qt::DirectConnection: output = "direct"; break;
...@@ -2315,8 +2315,7 @@ static inline void qDumpQObjectConnectionPart(QDumper &d, ...@@ -2315,8 +2315,7 @@ static inline void qDumpQObjectConnectionPart(QDumper &d,
d.put(number).put(namePostfix); d.put(number).put(namePostfix);
d.endItem(); d.endItem();
if (partner == owner) { if (partner == owner) {
d.putItem("value", QLatin1String("<this>")); d.putItem("value", "<this>");
d.putItem("valueencoded", "2");
d.putItem("type", owner->metaObject()->className()); d.putItem("type", owner->metaObject()->className());
d.putItem("numchild", 0); d.putItem("numchild", 0);
d.putItem("addr", owner); d.putItem("addr", owner);
...@@ -2613,6 +2612,14 @@ static void qDumpQSharedPointer(QDumper &d) ...@@ -2613,6 +2612,14 @@ static void qDumpQSharedPointer(QDumper &d)
const QSharedPointer<int> &ptr = const QSharedPointer<int> &ptr =
*reinterpret_cast<const QSharedPointer<int> *>(d.data); *reinterpret_cast<const QSharedPointer<int> *>(d.data);
if (ptr.isNull()) {
d.putItem("value", "<null>");
d.putItem("valuedisabled", "true");
d.putItem("numchild", 0);
d.disarm();
return;
}
if (isSimpleType(d.innertype)) if (isSimpleType(d.innertype))
qDumpInnerValueHelper(d, d.innertype, ptr.data()); qDumpInnerValueHelper(d, d.innertype, ptr.data());
else else
...@@ -2769,6 +2776,15 @@ static void qDumpQWeakPointer(QDumper &d) ...@@ -2769,6 +2776,15 @@ static void qDumpQWeakPointer(QDumper &d)
{ {
const int v = sizeof(void *); const int v = sizeof(void *);
const void *value = deref(addOffset(d.data, v)); const void *value = deref(addOffset(d.data, v));
const void *data = deref(d.data);
if (value == 0 || data == 0) {
d.putItem("value", "<null>");
d.putItem("valuedisabled", "true");
d.putItem("numchild", 0);
d.disarm();
return;
}
if (isSimpleType(d.innertype)) if (isSimpleType(d.innertype))
qDumpInnerValueHelper(d, d.innertype, value); qDumpInnerValueHelper(d, d.innertype, value);
...@@ -3429,8 +3445,8 @@ void *qDumpObjectData440( ...@@ -3429,8 +3445,8 @@ void *qDumpObjectData440(
"\""NS"QFileInfo\"," "\""NS"QFileInfo\","
"\""NS"QHash\"," "\""NS"QHash\","
"\""NS"QHashNode\"," "\""NS"QHashNode\","
"\""NS"QImage\"," //"\""NS"QImage\","
"\""NS"QImageData\"," //"\""NS"QImageData\","
"\""NS"QLinkedList\"," "\""NS"QLinkedList\","
"\""NS"QList\"," "\""NS"QList\","
"\""NS"QLocale\"," "\""NS"QLocale\","
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -184,8 +184,8 @@ ...@@ -184,8 +184,8 @@
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.nokia.qtcreator</string> <string>com.nokia.qtcreator</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.2.80</string> <string>1.2.90</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.2.80</string> <string>1.2.90</string>
</dict> </dict>
</plist> </plist>
<plugin name="BinEditor" version="1.2.80" compatVersion="1.2.80"> <plugin name="BinEditor" version="1.2.90" compatVersion="1.2.90">
<vendor>Nokia Corporation</vendor> <vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright> <copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license> <license>
...@@ -19,7 +19,7 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license> ...@@ -19,7 +19,7 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Binary editor component.</description> <description>Binary editor component.</description>
<url>http://qt.nokia.com</url> <url>http://qt.nokia.com</url>
<dependencyList> <dependencyList>
<dependency name="Core" version="1.2.80"/> <dependency name="Core" version="1.2.90"/>
<dependency name="TextEditor" version="1.2.80"/> <dependency name="TextEditor" version="1.2.90"/>
</dependencyList> </dependencyList>
</plugin> </plugin>
...@@ -439,13 +439,13 @@ bool BinEditor::inTextArea(const QPoint &pos) const ...@@ -439,13 +439,13 @@ bool BinEditor::inTextArea(const QPoint &pos) const
return (x > 16 * m_columnWidth + m_charWidth/2); return (x > 16 * m_columnWidth + m_charWidth/2);
} }
void BinEditor::updateLines()
{
updateLines(m_cursorPosition, m_cursorPosition);
}
void BinEditor::updateLines(int fromPosition, int toPosition) void BinEditor::updateLines(int fromPosition, int toPosition)
{ {
if (fromPosition < 0)
fromPosition = m_cursorPosition;
if (toPosition < 0)
toPosition = fromPosition;
int topLine = verticalScrollBar()->value(); int topLine = verticalScrollBar()->value();
int firstLine = qMin(fromPosition, toPosition) / 16; int firstLine = qMin(fromPosition, toPosition) / 16;
int lastLine = qMax(fromPosition, toPosition) / 16; int lastLine = qMax(fromPosition, toPosition) / 16;
...@@ -650,6 +650,7 @@ void BinEditor::paintEvent(QPaintEvent *e) ...@@ -650,6 +650,7 @@ void BinEditor::paintEvent(QPaintEvent *e)
const char *hex = "0123456789abcdef"; const char *hex = "0123456789abcdef";
painter.setPen(palette().text().color()); painter.setPen(palette().text().color());
const QFontMetrics &fm = painter.fontMetrics();
for (int i = 0; i <= m_numVisibleLines; ++i) { for (int i = 0; i <= m_numVisibleLines; ++i) {
int line = topLine + i; int line = topLine + i;
if (line >= m_numLines) if (line >= m_numLines)
...@@ -715,18 +716,18 @@ void BinEditor::paintEvent(QPaintEvent *e) ...@@ -715,18 +716,18 @@ void BinEditor::paintEvent(QPaintEvent *e)
if (foundPatternAt >= 0 && pos >= foundPatternAt && pos < foundPatternAt + matchLength) { if (foundPatternAt >= 0 && pos >= foundPatternAt && pos < foundPatternAt + matchLength) {
painter.fillRect(item_x, y-m_ascent, m_columnWidth, m_lineHeight, QColor(0xffef0b)); painter.fillRect(item_x, y-m_ascent, m_columnWidth, m_lineHeight, QColor(0xffef0b));
int printable_item_x = -xoffset + m_margin + m_labelWidth + 16 * m_columnWidth + m_charWidth int printable_item_x = -xoffset + m_margin + m_labelWidth + 16 * m_columnWidth + m_charWidth
+ painter.fontMetrics().width( printable.left(c)); + fm.width(printable.left(c));
painter.fillRect(printable_item_x, y-m_ascent, painter.fillRect(printable_item_x, y-m_ascent,
painter.fontMetrics().width(printable.at(c)), fm.width(printable.at(c)),
m_lineHeight, QColor(0xffef0b)); m_lineHeight, QColor(0xffef0b));
} }
if (selStart < selEnd && !isFullySelected && pos >= selStart && pos < selEnd) { if (selStart < selEnd && !isFullySelected && pos >= selStart && pos < selEnd) {
selectionRect |= QRect(item_x, y-m_ascent, m_columnWidth, m_lineHeight); selectionRect |= QRect(item_x, y-m_ascent, m_columnWidth, m_lineHeight);
int printable_item_x = -xoffset + m_margin + m_labelWidth + 16 * m_columnWidth + m_charWidth int printable_item_x = -xoffset + m_margin + m_labelWidth + 16 * m_columnWidth + m_charWidth
+ painter.fontMetrics().width( printable.left(c)); + fm.width(printable.left(c));
printableSelectionRect |= QRect(printable_item_x, y-m_ascent, printableSelectionRect |= QRect(printable_item_x, y-m_ascent,
painter.fontMetrics().width(printable.at(c)), fm.width(printable.at(c)),
m_lineHeight); m_lineHeight);
} }
} }
...@@ -754,7 +755,7 @@ void BinEditor::paintEvent(QPaintEvent *e) ...@@ -754,7 +755,7 @@ void BinEditor::paintEvent(QPaintEvent *e)
if (cursor >= 0) { if (cursor >= 0) {
int w = painter.fontMetrics().boundingRect(itemString.mid(cursor*3, 2)).width(); int w = fm.boundingRect(itemString.mid(cursor*3, 2)).width();
QRect cursorRect(x + cursor * m_columnWidth, y - m_ascent, w + 1, m_lineHeight); QRect cursorRect(x + cursor * m_columnWidth, y - m_ascent, w + 1, m_lineHeight);
painter.save(); painter.save();
painter.setPen(Qt::red); painter.setPen(Qt::red);
...@@ -762,7 +763,7 @@ void BinEditor::paintEvent(QPaintEvent *e) ...@@ -762,7 +763,7 @@ void BinEditor::paintEvent(QPaintEvent *e)
painter.restore(); painter.restore();
if (m_hexCursor && m_cursorVisible) { if (m_hexCursor && m_cursorVisible) {
if (m_lowNibble) if (m_lowNibble)
cursorRect.adjust(painter.fontMetrics().width(itemString.left(1)), 0, 0, 0); cursorRect.adjust(fm.width(itemString.left(1)), 0, 0, 0);
painter.fillRect(cursorRect, Qt::red); painter.fillRect(cursorRect, Qt::red);
painter.save(); painter.save();
painter.setClipRect(cursorRect); painter.setClipRect(cursorRect);
...@@ -776,7 +777,7 @@ void BinEditor::paintEvent(QPaintEvent *e) ...@@ -776,7 +777,7 @@ void BinEditor::paintEvent(QPaintEvent *e)
if (isFullySelected) { if (isFullySelected) {
painter.save(); painter.save();
painter.fillRect(text_x, y-m_ascent, painter.fontMetrics().width(printable), m_lineHeight, painter.fillRect(text_x, y-m_ascent, fm.width(printable), m_lineHeight,
palette().highlight()); palette().highlight());
painter.setPen(palette().highlightedText().color()); painter.setPen(palette().highlightedText().color());
painter.drawText(text_x, y, printable); painter.drawText(text_x, y, printable);
...@@ -794,9 +795,9 @@ void BinEditor::paintEvent(QPaintEvent *e) ...@@ -794,9 +795,9 @@ void BinEditor::paintEvent(QPaintEvent *e)
} }
if (cursor >= 0 && !printable.isEmpty()) { if (cursor >= 0 && !printable.isEmpty()) {
QRect cursorRect(text_x + painter.fontMetrics().width(printable.left(cursor)), QRect cursorRect(text_x + fm.width(printable.left(cursor)),
y-m_ascent, y-m_ascent,
painter.fontMetrics().width(printable.at(cursor)), fm.width(printable.at(cursor)),
m_lineHeight); m_lineHeight);
painter.save(); painter.save();
if (m_hexCursor || !m_cursorVisible) { if (m_hexCursor || !m_cursorVisible) {
......
...@@ -187,7 +187,8 @@ private: ...@@ -187,7 +187,8 @@ private:
int posAt(const QPoint &pos) const; int posAt(const QPoint &pos) const;
bool inTextArea(const QPoint &pos) const; bool inTextArea(const QPoint &pos) const;
QRect cursorRect() const; QRect cursorRect() const;
void updateLines(int fromPosition = -1, int toPosition = -1); void updateLines();
void updateLines(int fromPosition, int toPosition);
void ensureCursorVisible(); void ensureCursorVisible();
void setBlinkingCursorEnabled(bool enable); void setBlinkingCursorEnabled(bool enable);
......
<plugin name="Bookmarks" version="1.2.80" compatVersion="1.2.80"> <plugin name="Bookmarks" version="1.2.90" compatVersion="1.2.90">
<vendor>Nokia Corporation</vendor> <vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright> <copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license> <license>
...@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license> ...@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Bookmarks in text editors.</description> <description>Bookmarks in text editors.</description>
<url>http://qt.nokia.com</url> <url>http://qt.nokia.com</url>
<dependencyList> <dependencyList>
<dependency name="TextEditor" version="1.2.80"/> <dependency name="TextEditor" version="1.2.90"/>
<dependency name="ProjectExplorer" version="1.2.80"/> <dependency name="ProjectExplorer" version="1.2.90"/>
<dependency name="Core" version="1.2.80"/> <dependency name="Core" version="1.2.90"/>
</dependencyList> </dependencyList>
</plugin> </plugin>
<plugin name="CMakeProjectManager" version="1.2.80" compatVersion="1.2.80"> <plugin name="CMakeProjectManager" version="1.2.90" compatVersion="1.2.90">
<vendor>Nokia Corporation</vendor> <vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright> <copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license> <license>
...@@ -19,9 +19,9 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license> ...@@ -19,9 +19,9 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>CMake support</description> <description>CMake support</description>
<url>http://qt.nokia.com</url> <url>http://qt.nokia.com</url>
<dependencyList> <dependencyList>
<dependency name="TextEditor" version="1.2.80"/> <dependency name="TextEditor" version="1.2.90"/>
<dependency name="ProjectExplorer" version="1.2.80"/> <dependency name="ProjectExplorer" version="1.2.90"/>
<dependency name="CppTools" version="1.2.80"/> <dependency name="CppTools" version="1.2.90"/>
<dependency name="CppEditor" version="1.2.80"/> <dependency name="CppEditor" version="1.2.90"/>
</dependencyList> </dependencyList>
</plugin> </plugin>
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
** contact the sales department at http://qt.nokia.com/contact. ** contact the sales department at http://qt.nokia.com/contact.
** **
**************************************************************************/ **************************************************************************/
#include "makestep.h" #include "makestep.h"
#include "cmakeprojectconstants.h" #include "cmakeprojectconstants.h"
#include "cmakeproject.h" #include "cmakeproject.h"
......
<plugin name="Core" version="1.2.80" compatVersion="1.2.80"> <plugin name="Core" version="1.2.90" compatVersion="1.2.90">
<vendor>Nokia Corporation</vendor> <vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright> <copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license> <license>
......
...@@ -35,7 +35,7 @@ namespace Constants { ...@@ -35,7 +35,7 @@ namespace Constants {
#define IDE_VERSION_MAJOR 1 #define IDE_VERSION_MAJOR 1
#define IDE_VERSION_MINOR 2 #define IDE_VERSION_MINOR 2
#define IDE_VERSION_RELEASE 80 #define IDE_VERSION_RELEASE 90
#define STRINGIFY_INTERNAL(x) #x #define STRINGIFY_INTERNAL(x) #x
#define STRINGIFY(x) STRINGIFY_INTERNAL(x) #define STRINGIFY(x) STRINGIFY_INTERNAL(x)
......
...@@ -554,13 +554,11 @@ IEditor *EditorManager::currentEditor() const ...@@ -554,13 +554,11 @@ IEditor *EditorManager::currentEditor() const
return m_d->m_currentEditor; return m_d->m_currentEditor;
} }
void EditorManager::emptyView(Core::Internal::EditorView *view) void EditorManager::emptyView(Core::Internal::EditorView *view)
{ {
if (!view) if (!view)
return; return;
QList<IEditor *> editors = view->editors(); QList<IEditor *> editors = view->editors();
foreach (IEditor *editor, editors) { foreach (IEditor *editor, editors) {
if (!m_d->m_editorModel->isDuplicate(editor)) { if (!m_d->m_editorModel->isDuplicate(editor)) {
...@@ -1484,8 +1482,8 @@ void EditorManager::updateActions() ...@@ -1484,8 +1482,8 @@ void EditorManager::updateActions()
m_d->m_gotoNextDocHistoryAction->setEnabled(m_d->m_editorModel->rowCount() != 0); m_d->m_gotoNextDocHistoryAction->setEnabled(m_d->m_editorModel->rowCount() != 0);
m_d->m_gotoPreviousDocHistoryAction->setEnabled(m_d->m_editorModel->rowCount() != 0); m_d->m_gotoPreviousDocHistoryAction->setEnabled(m_d->m_editorModel->rowCount() != 0);
EditorView *view = currentEditorView(); EditorView *view = currentEditorView();
m_d->m_goBackAction->setEnabled(view->canGoBack()); m_d->m_goBackAction->setEnabled(view ? view->canGoBack() : false);
m_d->m_goForwardAction->setEnabled(view->canGoForward()); m_d->m_goForwardAction->setEnabled(view ? view->canGoForward() : false);
bool hasSplitter = m_d->m_splitter->isSplitter(); bool hasSplitter = m_d->m_splitter->isSplitter();
m_d->m_removeCurrentSplitAction->setEnabled(hasSplitter); m_d->m_removeCurrentSplitAction->setEnabled(hasSplitter);
......
...@@ -617,7 +617,6 @@ SplitterOrView::SplitterOrView(OpenEditorsModel *model) ...@@ -617,7 +617,6 @@ SplitterOrView::SplitterOrView(OpenEditorsModel *model)
m_view = new EditorView(model); m_view = new EditorView(model);
m_splitter = 0; m_splitter = 0;
m_layout->addWidget(m_view); m_layout->addWidget(m_view);
setFocusPolicy(Qt::ClickFocus);
} }
SplitterOrView::SplitterOrView(Core::IEditor *editor) SplitterOrView::SplitterOrView(Core::IEditor *editor)
...@@ -629,7 +628,6 @@ SplitterOrView::SplitterOrView(Core::IEditor *editor) ...@@ -629,7 +628,6 @@ SplitterOrView::SplitterOrView(Core::IEditor *editor)
m_view->addEditor(editor); m_view->addEditor(editor);
m_splitter = 0; m_splitter = 0;
m_layout->addWidget(m_view); m_layout->addWidget(m_view);
setFocusPolicy(Qt::ClickFocus);
} }
SplitterOrView::~SplitterOrView() SplitterOrView::~SplitterOrView()
...@@ -642,20 +640,24 @@ SplitterOrView::~SplitterOrView() ...@@ -642,20 +640,24 @@ SplitterOrView::~SplitterOrView()
m_splitter = 0; m_splitter = 0;
} }
void SplitterOrView::mousePressEvent(QMouseEvent *e)
void SplitterOrView::focusInEvent(QFocusEvent *)
{ {
if (e->button() != Qt::LeftButton)
return;
setFocus(Qt::MouseFocusReason);
CoreImpl::instance()->editorManager()->setCurrentView(this); CoreImpl::instance()->editorManager()->setCurrentView(this);
} }
void SplitterOrView::paintEvent(QPaintEvent *) void SplitterOrView::paintEvent(QPaintEvent *)
{ {
if (CoreImpl::instance()->editorManager()->currentSplitterOrView() != this) if (CoreImpl::instance()->editorManager()->currentSplitterOrView() != this)
return; return;
QPainter painter(this);
// Discreet indication where an editor would be if (!m_view || hasEditors())
return;
// Discreet indication where an editor would be if there is none
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true); painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(Qt::NoPen); painter.setPen(Qt::NoPen);
QColor shadeBrush(Qt::black); QColor shadeBrush(Qt::black);
...@@ -664,6 +666,7 @@ void SplitterOrView::paintEvent(QPaintEvent *) ...@@ -664,6 +666,7 @@ void SplitterOrView::paintEvent(QPaintEvent *)
const int r = 3; const int r = 3;
painter.drawRoundedRect(rect().adjusted(r, r, -r, -r), r * 2, r * 2); painter.drawRoundedRect(rect().adjusted(r, r, -r, -r), r * 2, r * 2);
#if 0
if (hasFocus()) { if (hasFocus()) {
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
// With QMacStyle, we have to draw our own focus rect, since I didn't find // With QMacStyle, we have to draw our own focus rect, since I didn't find
...@@ -687,6 +690,7 @@ void SplitterOrView::paintEvent(QPaintEvent *) ...@@ -687,6 +690,7 @@ void SplitterOrView::paintEvent(QPaintEvent *)
} }
#endif #endif
} }
#endif
} }
SplitterOrView *SplitterOrView::findFirstView() SplitterOrView *SplitterOrView::findFirstView()
......
...@@ -199,8 +199,8 @@ public: ...@@ -199,8 +199,8 @@ public:
void unsplitAll(); void unsplitAll();
protected: protected:
void focusInEvent(QFocusEvent *);
void paintEvent(QPaintEvent *); void paintEvent(QPaintEvent *);
void mousePressEvent(QMouseEvent *e);
private: private:
......
src/plugins/coreplugin/images/inputfield.png

422 Bytes | W: | H:

src/plugins/coreplugin/images/inputfield.png

379 Bytes | W: | H:

src/plugins/coreplugin/images/inputfield.png
src/plugins/coreplugin/images/inputfield.png
src/plugins/coreplugin/images/inputfield.png
src/plugins/coreplugin/images/inputfield.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -474,6 +474,12 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption ...@@ -474,6 +474,12 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
case PE_PanelLineEdit: case PE_PanelLineEdit:
{ {
painter->save(); painter->save();
// Fill the line edit background
QRect filledRect = option->rect.adjusted(1, 1, -1, -1);
painter->setBrushOrigin(filledRect.topLeft());
painter->fillRect(filledRect, option->palette.base());
if (option->state & State_Enabled) if (option->state & State_Enabled)
drawCornerImage(d->lineeditImage, painter, option->rect, 2, 2, 2, 2); drawCornerImage(d->lineeditImage, painter, option->rect, 2, 2, 2, 2);
else else
......
...@@ -176,8 +176,8 @@ void NavigationWidget::resizeEvent(QResizeEvent *re) ...@@ -176,8 +176,8 @@ void NavigationWidget::resizeEvent(QResizeEvent *re)
NavigationSubWidget *NavigationWidget::insertSubItem(int position) NavigationSubWidget *NavigationWidget::insertSubItem(int position)
{ {
NavigationSubWidget *nsw = new NavigationSubWidget(this); NavigationSubWidget *nsw = new NavigationSubWidget(this);
connect(nsw, SIGNAL(split()), this, SLOT(split())); connect(nsw, SIGNAL(splitMe()), this, SLOT(splitSubWidget()));
connect(nsw, SIGNAL(close()), this, SLOT(close())); connect(nsw, SIGNAL(closeMe()), this, SLOT(closeSubWidget()));
insertWidget(position, nsw); insertWidget(position, nsw);
m_subWidgets.insert(position, nsw); m_subWidgets.insert(position, nsw);
return nsw; return nsw;
...@@ -199,7 +199,7 @@ void NavigationWidget::activateSubWidget() ...@@ -199,7 +199,7 @@ void NavigationWidget::activateSubWidget()
m_subWidgets.first()->setFocusWidget(); m_subWidgets.first()->setFocusWidget();
} }
void NavigationWidget::split() void NavigationWidget::splitSubWidget()
{ {
NavigationSubWidget *original = qobject_cast<NavigationSubWidget *>(sender()); NavigationSubWidget *original = qobject_cast<NavigationSubWidget *>(sender());
int pos = indexOf(original) + 1; int pos = indexOf(original) + 1;
...@@ -207,7 +207,7 @@ void NavigationWidget::split() ...@@ -207,7 +207,7 @@ void NavigationWidget::split()
newnsw->setFactory(original->factory()); newnsw->setFactory(original->factory());
} }
void NavigationWidget::close() void NavigationWidget::closeSubWidget()
{ {
if (m_subWidgets.count() != 1) { if (m_subWidgets.count() != 1) {
NavigationSubWidget *subWidget = qobject_cast<NavigationSubWidget *>(sender()); NavigationSubWidget *subWidget = qobject_cast<NavigationSubWidget *>(sender());
...@@ -389,8 +389,8 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget) ...@@ -389,8 +389,8 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget)
setLayout(lay); setLayout(lay);
lay->addWidget(m_toolBar); lay->addWidget(m_toolBar);
connect(splitAction, SIGNAL(clicked()), this, SIGNAL(split())); connect(splitAction, SIGNAL(clicked()), this, SIGNAL(splitMe()));
connect(close, SIGNAL(clicked()), this, SIGNAL(close())); connect(close, SIGNAL(clicked()), this, SIGNAL(closeMe()));
connect(m_navigationComboBox, SIGNAL(currentIndexChanged(int)), connect(m_navigationComboBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(setCurrentIndex(int))); this, SLOT(setCurrentIndex(int)));
......
...@@ -103,8 +103,8 @@ protected: ...@@ -103,8 +103,8 @@ protected:
private slots: private slots:
void objectAdded(QObject*); void objectAdded(QObject*);
void activateSubWidget(); void activateSubWidget();
void split(); void splitSubWidget();
void close(); void closeSubWidget();
private: private:
NavigationSubWidget *insertSubItem(int position); NavigationSubWidget *insertSubItem(int position);
...@@ -136,8 +136,8 @@ public: ...@@ -136,8 +136,8 @@ public:
Core::Command *command(const QString &title) const; Core::Command *command(const QString &title) const;
signals: signals:
void split(); void splitMe();
void close(); void closeMe();
private slots: private slots:
void objectAdded(QObject*); void objectAdded(QObject*);
......
...@@ -46,10 +46,6 @@ ...@@ -46,10 +46,6 @@
#include <QtGui/QToolBar> #include <QtGui/QToolBar>
#include <QtGui/QStatusBar> #include <QtGui/QStatusBar>
namespace {
enum { debugQWorkbenchWrappers = 0 };
}
// Script function template to pop up a message box // Script function template to pop up a message box
// with a certain icon and buttons. // with a certain icon and buttons.
template <int MsgBoxIcon, int MsgBoxButtons> template <int MsgBoxIcon, int MsgBoxButtons>
...@@ -178,14 +174,9 @@ namespace Core { ...@@ -178,14 +174,9 @@ namespace Core {
namespace Internal { namespace Internal {
ScriptManagerPrivate::ScriptManagerPrivate(QObject *parent) ScriptManagerPrivate::ScriptManagerPrivate(QObject *parent)
: ScriptManager(parent), m_initialized(false) : ScriptManager(parent),
{ m_engine(0)
}
QScriptEngine &ScriptManagerPrivate::scriptEngine()
{ {
ensureEngineInitialized();
return m_engine;
} }
// Split a backtrace of the form: // Split a backtrace of the form:
...@@ -225,25 +216,26 @@ bool ScriptManagerPrivate::runScript(const QString &script, QString *errorMessag ...@@ -225,25 +216,26 @@ bool ScriptManagerPrivate::runScript(const QString &script, QString *errorMessag
ensureEngineInitialized(); ensureEngineInitialized();
stack->clear(); stack->clear();
m_engine.pushContext(); m_engine->pushContext();
m_engine.evaluate(script); m_engine->evaluate(script);
const bool failed = m_engine.hasUncaughtException (); const bool failed = m_engine->hasUncaughtException ();
if (failed) { if (failed) {
const int errorLineNumber = m_engine.uncaughtExceptionLineNumber(); const int errorLineNumber = m_engine->uncaughtExceptionLineNumber();
const QStringList backTrace = m_engine.uncaughtExceptionBacktrace(); const QStringList backTrace = m_engine->uncaughtExceptionBacktrace();
parseBackTrace(backTrace, *stack); parseBackTrace(backTrace, *stack);
const QString backtrace = backTrace.join(QString(QLatin1Char('\n'))); const QString backtrace = backTrace.join(QString(QLatin1Char('\n')));
*errorMessage = ScriptManager::tr("Exception at line %1: %2\n%3").arg(errorLineNumber).arg(engineError(m_engine)).arg(backtrace); *errorMessage = ScriptManager::tr("Exception at line %1: %2\n%3").arg(errorLineNumber).arg(engineError(m_engine)).arg(backtrace);
} }
m_engine.popContext(); m_engine->popContext();
return !failed; return !failed;
} }
void ScriptManagerPrivate::ensureEngineInitialized() void ScriptManagerPrivate::ensureEngineInitialized()
{ {
if (m_initialized) if (m_engine)
return; return;
m_engine = new QScriptEngine(this);
// register QObjects that occur as properties // register QObjects that occur as properties
SharedTools::registerQObject<QMainWindow>(m_engine); SharedTools::registerQObject<QMainWindow>(m_engine);
SharedTools::registerQObject<QStatusBar>(m_engine); SharedTools::registerQObject<QStatusBar>(m_engine);
...@@ -252,52 +244,51 @@ void ScriptManagerPrivate::ensureEngineInitialized() ...@@ -252,52 +244,51 @@ void ScriptManagerPrivate::ensureEngineInitialized()
// SharedTools::registerQObjectInterface<Core::MessageManager, MessageManagerPrototype>(m_engine); // SharedTools::registerQObjectInterface<Core::MessageManager, MessageManagerPrototype>(m_engine);
// SharedTools::registerQObjectInterface<Core::IFile, FilePrototype>(m_engine); // SharedTools::registerQObjectInterface<Core::IFile, FilePrototype>(m_engine);
// qScriptRegisterSequenceMetaType<QList<Core::IFile *> >(&m_engine); // qScriptRegisterSequenceMetaType<QList<Core::IFile *> >(m_engine);
// SharedTools::registerQObjectInterface<Core::FileManager, FileManagerPrototype>(m_engine); // SharedTools::registerQObjectInterface<Core::FileManager, FileManagerPrototype>(m_engine);
// SharedTools::registerQObjectInterface<Core::IEditor, EditorPrototype>(m_engine); // SharedTools::registerQObjectInterface<Core::IEditor, EditorPrototype>(m_engine);
qScriptRegisterSequenceMetaType<QList<Core::IEditor *> >(&m_engine); qScriptRegisterSequenceMetaType<QList<Core::IEditor *> >(m_engine);
// SharedTools::registerQObjectInterface<Core::EditorGroup, EditorGroupPrototype>(m_engine); // SharedTools::registerQObjectInterface<Core::EditorGroup, EditorGroupPrototype>(m_engine);
qScriptRegisterSequenceMetaType<QList<Core::EditorGroup *> >(&m_engine); qScriptRegisterSequenceMetaType<QList<Core::EditorGroup *> >(m_engine);
SharedTools::registerQObjectInterface<Core::EditorManager, EditorManagerPrototype>(m_engine); SharedTools::registerQObjectInterface<Core::EditorManager, EditorManagerPrototype>(m_engine);
// SharedTools::registerQObjectInterface<Core::ICore, CorePrototype>(m_engine); // SharedTools::registerQObjectInterface<Core::ICore, CorePrototype>(m_engine);
// Make "core" available // Make "core" available
m_engine.globalObject().setProperty(QLatin1String("core"), qScriptValueFromValue(&m_engine, Core::ICore::instance())); m_engine->globalObject().setProperty(QLatin1String("core"), qScriptValueFromValue(m_engine, Core::ICore::instance()));
// CLASSIC: registerInterfaceWithDefaultPrototype<Core::MessageManager, MessageManagerPrototype>(m_engine); // CLASSIC: registerInterfaceWithDefaultPrototype<Core::MessageManager, MessageManagerPrototype>(m_engine);
// Message box conveniences // Message box conveniences
m_engine.globalObject().setProperty(QLatin1String("critical"), m_engine->globalObject().setProperty(QLatin1String("critical"),
m_engine.newFunction(messageBox<QMessageBox::Critical, QMessageBox::Ok>, 3)); m_engine->newFunction(messageBox<QMessageBox::Critical, QMessageBox::Ok>, 3));
m_engine.globalObject().setProperty(QLatin1String("warning"), m_engine->globalObject().setProperty(QLatin1String("warning"),
m_engine.newFunction(messageBox<QMessageBox::Warning, QMessageBox::Ok>, 3)); m_engine->newFunction(messageBox<QMessageBox::Warning, QMessageBox::Ok>, 3));
m_engine.globalObject().setProperty(QLatin1String("information"), m_engine->globalObject().setProperty(QLatin1String("information"),
m_engine.newFunction(messageBox<QMessageBox::Information, QMessageBox::Ok>, 3)); m_engine->newFunction(messageBox<QMessageBox::Information, QMessageBox::Ok>, 3));
// StandardButtons has overloaded operator '|' - grrr. // StandardButtons has overloaded operator '|' - grrr.
enum { MsgBoxYesNo = 0x00014000 }; enum { MsgBoxYesNo = 0x00014000 };
m_engine.globalObject().setProperty(QLatin1String("yesNoQuestion"), m_engine->globalObject().setProperty(QLatin1String("yesNoQuestion"),
m_engine.newFunction(messageBox<QMessageBox::Question, MsgBoxYesNo>, 3)); m_engine->newFunction(messageBox<QMessageBox::Question, MsgBoxYesNo>, 3));
m_engine.globalObject().setProperty(QLatin1String("getText"), m_engine.newFunction(inputDialogGetText, 3)); m_engine->globalObject().setProperty(QLatin1String("getText"), m_engine->newFunction(inputDialogGetText, 3));
m_engine.globalObject().setProperty(QLatin1String("getInteger"), m_engine.newFunction(inputDialogGetInteger, 3)); m_engine->globalObject().setProperty(QLatin1String("getInteger"), m_engine->newFunction(inputDialogGetInteger, 3));
m_engine.globalObject().setProperty(QLatin1String("getDouble"), m_engine.newFunction(inputDialogGetDouble, 3)); m_engine->globalObject().setProperty(QLatin1String("getDouble"), m_engine->newFunction(inputDialogGetDouble, 3));
m_engine.globalObject().setProperty(QLatin1String("getItem"), m_engine.newFunction(inputDialogGetItem, 3)); m_engine->globalObject().setProperty(QLatin1String("getItem"), m_engine->newFunction(inputDialogGetItem, 3));
// file box // file box
m_engine.globalObject().setProperty(QLatin1String("getOpenFileNames"), m_engine.newFunction(fileBox<QFileDialog::AcceptOpen, QFileDialog::ExistingFiles> , 2)); m_engine->globalObject().setProperty(QLatin1String("getOpenFileNames"), m_engine->newFunction(fileBox<QFileDialog::AcceptOpen, QFileDialog::ExistingFiles> , 2));
m_engine.globalObject().setProperty(QLatin1String("getOpenFileName"), m_engine.newFunction(fileBox<QFileDialog::AcceptOpen, QFileDialog::ExistingFile> , 2)); m_engine->globalObject().setProperty(QLatin1String("getOpenFileName"), m_engine->newFunction(fileBox<QFileDialog::AcceptOpen, QFileDialog::ExistingFile> , 2));
m_engine.globalObject().setProperty(QLatin1String("getSaveFileName"), m_engine.newFunction(fileBox<QFileDialog::AcceptSave, QFileDialog::AnyFile> , 2)); m_engine->globalObject().setProperty(QLatin1String("getSaveFileName"), m_engine->newFunction(fileBox<QFileDialog::AcceptSave, QFileDialog::AnyFile> , 2));
m_engine.globalObject().setProperty(QLatin1String("getExistingDirectory"), m_engine.newFunction(fileBox<QFileDialog::AcceptSave, QFileDialog::DirectoryOnly> , 2)); m_engine->globalObject().setProperty(QLatin1String("getExistingDirectory"), m_engine->newFunction(fileBox<QFileDialog::AcceptSave, QFileDialog::DirectoryOnly> , 2));
m_initialized = true;
} }
QString ScriptManagerPrivate::engineError(QScriptEngine &scriptEngine) QString ScriptManagerPrivate::engineError(QScriptEngine *scriptEngine)
{ {
QScriptValue error = scriptEngine.evaluate(QLatin1String("Error")); QScriptValue error = scriptEngine->evaluate(QLatin1String("Error"));
if (error.isValid()) if (error.isValid())
return error.toString(); return error.toString();
return ScriptManager::tr("Unknown error"); return ScriptManager::tr("Unknown error");
......
...@@ -59,9 +59,6 @@ public: ...@@ -59,9 +59,6 @@ public:
ScriptManager(QObject *parent = 0) : QObject(parent) {} ScriptManager(QObject *parent = 0) : QObject(parent) {}
virtual ~ScriptManager() { } virtual ~ScriptManager() { }
// Access the engine (for plugins to wrap additional interfaces).
virtual QScriptEngine &scriptEngine() = 0;
// Run a script // Run a script
virtual bool runScript(const QString &script, QString *errorMessage, Stack *errorStack) = 0; virtual bool runScript(const QString &script, QString *errorMessage, Stack *errorStack) = 0;
virtual bool runScript(const QString &script, QString *errorMessage) = 0; virtual bool runScript(const QString &script, QString *errorMessage) = 0;
......
...@@ -45,17 +45,15 @@ class ScriptManagerPrivate : public Core::ScriptManager ...@@ -45,17 +45,15 @@ class ScriptManagerPrivate : public Core::ScriptManager
public: public:
explicit ScriptManagerPrivate(QObject *parent); explicit ScriptManagerPrivate(QObject *parent);
QScriptEngine &scriptEngine();
bool runScript(const QString &script, QString *errorMessage, Stack *stack); bool runScript(const QString &script, QString *errorMessage, Stack *stack);
bool runScript(const QString &script, QString *errorMessage); bool runScript(const QString &script, QString *errorMessage);
static QString engineError(QScriptEngine &scriptEngine); static QString engineError(QScriptEngine *scriptEngine);
private: private:
void ensureEngineInitialized(); void ensureEngineInitialized();
QScriptEngine m_engine; QScriptEngine *m_engine;
bool m_initialized;
}; };
} // namespace Internal } // namespace Internal
......
...@@ -101,8 +101,8 @@ SideBarItem *SideBar::item(const QString &title) ...@@ -101,8 +101,8 @@ SideBarItem *SideBar::item(const QString &title)
SideBarWidget *SideBar::insertSideBarWidget(int position, const QString &title) SideBarWidget *SideBar::insertSideBarWidget(int position, const QString &title)
{ {
SideBarWidget *item = new SideBarWidget(this, title); SideBarWidget *item = new SideBarWidget(this, title);
connect(item, SIGNAL(split()), this, SLOT(split())); connect(item, SIGNAL(splitMe()), this, SLOT(splitSubWidget()));
connect(item, SIGNAL(close()), this, SLOT(close())); connect(item, SIGNAL(closeMe()), this, SLOT(closeSubWidget()));
connect(item, SIGNAL(currentWidgetChanged()), this, SLOT(updateWidgets())); connect(item, SIGNAL(currentWidgetChanged()), this, SLOT(updateWidgets()));
insertWidget(position, item); insertWidget(position, item);
m_widgets.insert(position, item); m_widgets.insert(position, item);
...@@ -118,7 +118,7 @@ void SideBar::removeSideBarWidget(SideBarWidget *widget) ...@@ -118,7 +118,7 @@ void SideBar::removeSideBarWidget(SideBarWidget *widget)
widget->deleteLater(); widget->deleteLater();
} }
void SideBar::split() void SideBar::splitSubWidget()
{ {
SideBarWidget *original = qobject_cast<SideBarWidget*>(sender()); SideBarWidget *original = qobject_cast<SideBarWidget*>(sender());
int pos = indexOf(original) + 1; int pos = indexOf(original) + 1;
...@@ -126,7 +126,7 @@ void SideBar::split() ...@@ -126,7 +126,7 @@ void SideBar::split()
updateWidgets(); updateWidgets();
} }
void SideBar::close() void SideBar::closeSubWidget()
{ {
if (m_widgets.count() != 1) { if (m_widgets.count() != 1) {
SideBarWidget *widget = qobject_cast<SideBarWidget*>(sender()); SideBarWidget *widget = qobject_cast<SideBarWidget*>(sender());
...@@ -239,13 +239,13 @@ SideBarWidget::SideBarWidget(SideBar *sideBar, const QString &title) ...@@ -239,13 +239,13 @@ SideBarWidget::SideBarWidget(SideBar *sideBar, const QString &title)
m_splitButton = new QToolButton; m_splitButton = new QToolButton;
m_splitButton->setIcon(QIcon(":/core/images/splitbutton_horizontal.png")); m_splitButton->setIcon(QIcon(":/core/images/splitbutton_horizontal.png"));
m_splitButton->setToolTip(tr("Split")); m_splitButton->setToolTip(tr("Split"));
connect(m_splitButton, SIGNAL(clicked(bool)), this, SIGNAL(split())); connect(m_splitButton, SIGNAL(clicked(bool)), this, SIGNAL(splitMe()));
m_closeButton = new QToolButton; m_closeButton = new QToolButton;
m_closeButton->setIcon(QIcon(":/core/images/closebutton.png")); m_closeButton->setIcon(QIcon(":/core/images/closebutton.png"));
m_closeButton->setToolTip(tr("Close")); m_closeButton->setToolTip(tr("Close"));
connect(m_closeButton, SIGNAL(clicked(bool)), this, SIGNAL(close())); connect(m_closeButton, SIGNAL(clicked(bool)), this, SIGNAL(closeMe()));
QWidget *spacerItem = new QWidget(this); QWidget *spacerItem = new QWidget(this);
spacerItem->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); spacerItem->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
......
...@@ -111,8 +111,8 @@ public: ...@@ -111,8 +111,8 @@ public:
QMap<QString, Core::Command*> shortcutMap() const; QMap<QString, Core::Command*> shortcutMap() const;
private slots: private slots:
void split(); void splitSubWidget();
void close(); void closeSubWidget();
void updateWidgets(); void updateWidgets();
private: private:
...@@ -146,8 +146,8 @@ public: ...@@ -146,8 +146,8 @@ public:
Core::Command *command(const QString &title) const; Core::Command *command(const QString &title) const;
signals: signals:
void split(); void splitMe();
void close(); void closeMe();
void currentWidgetChanged(); void currentWidgetChanged();
private slots: private slots:
......
<plugin name="CodePaster" version="1.2.80" compatVersion="1.2.80"> <plugin name="CodePaster" version="1.2.90" compatVersion="1.2.90">
<vendor>Nokia Corporation</vendor> <vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright> <copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license> <license>
...@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license> ...@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Codepaster plugin for pushing/fetching diff from server</description> <description>Codepaster plugin for pushing/fetching diff from server</description>
<url>http://qt.nokia.com</url> <url>http://qt.nokia.com</url>
<dependencyList> <dependencyList>