Merge branch '0.9.2-rc1' of git@scm.dev.nokia.troll.no:creator/mainline into 0.9.2-rc1

This commit is contained in:
mae
2009-02-05 19:35:25 +01:00
17 changed files with 104 additions and 33 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -215,8 +215,20 @@
\title The Code Editor \title The Code Editor
### SCREENSHOT of the editor in action Qt Creator's code editor is designed to aid the developer to create, edit,
and navigate code. It is fully equipped with syntax highlighting, code
completion, context sensitive help, as well as inline error indicators
while you are typing. The screenshots below show the various dialogs within
which you can configure your editor.
\table
\row
\i \inlineimage qtcreator-texteditor-general.png
\i \inlineimage qtcreator-texteditor-fonts.png
\i \inlineimage qtcreator-texteditor-completion.png
\endtable
The table below lists keyboard shortcuts supported by the code editor.
\table \table
\row \row
@@ -239,10 +251,19 @@
\row \row
\i Indenting Blocks \i Indenting Blocks
\i Use \key{Ctrl+I} \i Use \key{Ctrl+I}
\row
\i Collapse
\i Use \key{Ctrl+\<}
\row \row
\i Commenting or uncommenting blocks \i Commenting or uncommenting blocks
\i Use \key{Ctrl+\/} \i Use \key{Ctrl+\/}
\row
\i Delete a line
\i Use \key{Shift+Del}
\row \row
\i Switch between header file and source file \i Switch between header file and source file
\i Use \key{F4}. \i Use \key{F4}.
@@ -256,20 +277,13 @@
\i Use \key{F2} and \key{Shift+F2}. This feature works with \i Use \key{F2} and \key{Shift+F2}. This feature works with
namespaces, classes, methods, variables, include statements, namespaces, classes, methods, variables, include statements,
and macros. and macros.
\row
\i Switch to an external editor
\i Select \gui{Open in external editor} from the
\gui{Edit -> Advanced} menu.
\endtable \endtable
More:
Collapse
Up/Down/Page Up/Page Down - hold ctrl to prevent the cursor from moving
To switch to an external editor, select \gui{Open in external editor} from
the \gui{Edit -> Advanced} menu.
*/ */

View File

@@ -462,6 +462,7 @@ bool EditorManager::unregisterEditor(IEditor *editor)
return false; return false;
} }
void EditorManager::updateCurrentEditorAndGroup(IContext *context) void EditorManager::updateCurrentEditorAndGroup(IContext *context)
{ {
if (debugEditorManager) if (debugEditorManager)
@@ -470,7 +471,8 @@ void EditorManager::updateCurrentEditorAndGroup(IContext *context)
IEditor *editor = context ? qobject_cast<IEditor*>(context) : 0; IEditor *editor = context ? qobject_cast<IEditor*>(context) : 0;
if (groupContext) { if (groupContext) {
m_d->m_splitter->setCurrentGroup(groupContext->editorGroup()); m_d->m_splitter->setCurrentGroup(groupContext->editorGroup());
setCurrentEditor(0); if (groupContext->editorGroup()->editorCount() == 0)
setCurrentEditor(0);
updateActions(); updateActions();
} else if (editor) { } else if (editor) {
setCurrentEditor(editor); setCurrentEditor(editor);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -124,10 +124,23 @@ void CodepasterPlugin::extensionsInitialized()
->getObject<ProjectExplorer::ProjectExplorerPlugin>(); ->getObject<ProjectExplorer::ProjectExplorerPlugin>();
} }
QString CodepasterPlugin::serverUrl() const
{
QString url = m_settingsPage->serverUrl().toString();
if (url.startsWith("http://"))
url = url.mid(7);
if (url.endsWith('/'))
url.chop(1);
return url;
}
void CodepasterPlugin::post() void CodepasterPlugin::post()
{ {
if (m_poster) // FIXME: The whole m_poster thing is de facto a simple function call.
if (m_poster) {
delete m_poster; delete m_poster;
m_poster = 0;
}
IEditor* editor = EditorManager::instance()->currentEditor(); IEditor* editor = EditorManager::instance()->currentEditor();
ITextEditor* textEditor = qobject_cast<ITextEditor*>(editor); ITextEditor* textEditor = qobject_cast<ITextEditor*>(editor);
if (!textEditor) if (!textEditor)
@@ -171,7 +184,8 @@ void CodepasterPlugin::post()
data = view.getContent(); data = view.getContent();
// Submit to codepaster // Submit to codepaster
m_poster = new CustomPoster(m_settingsPage->serverUrl().toString());
m_poster = new CustomPoster(serverUrl());
// Copied from cpaster. Otherwise lineendings will screw up // Copied from cpaster. Otherwise lineendings will screw up
if (!data.contains("\r\n")) { if (!data.contains("\r\n")) {
@@ -185,9 +199,11 @@ void CodepasterPlugin::post()
void CodepasterPlugin::fetch() void CodepasterPlugin::fetch()
{ {
if (m_fetcher) if (m_fetcher) {
delete m_fetcher; delete m_fetcher;
m_fetcher = new CustomFetcher(m_settingsPage->serverUrl().toString()); m_fetcher = 0;
}
m_fetcher = new CustomFetcher(serverUrl());
QDialog dialog; QDialog dialog;
Ui_PasteSelectDialog ui; Ui_PasteSelectDialog ui;
@@ -208,7 +224,7 @@ void CodepasterPlugin::fetch()
return; return;
delete m_fetcher; delete m_fetcher;
m_fetcher = new CustomFetcher(m_settingsPage->serverUrl().toString()); m_fetcher = new CustomFetcher(serverUrl());
m_fetcher->fetch(pasteID); m_fetcher->fetch(pasteID);
} }

View File

@@ -70,6 +70,7 @@ public slots:
void fetch(); void fetch();
private: private:
QString serverUrl() const;
QAction *m_postAction; QAction *m_postAction;
QAction *m_fetchAction; QAction *m_fetchAction;

View File

@@ -180,7 +180,16 @@ bool FakeVimPluginPrivate::initialize()
void FakeVimPluginPrivate::installHandler(Core::IEditor *editor) void FakeVimPluginPrivate::installHandler(Core::IEditor *editor)
{ {
if (!editor)
return;
QWidget *widget = editor->widget(); QWidget *widget = editor->widget();
if (!widget)
return;
// we can only handle QTextEdit and QPlainTextEdit
if (!qobject_cast<QTextEdit *>(widget) && !qobject_cast<QPlainTextEdit *>(widget))
return;
FakeVimHandler *handler = new FakeVimHandler(widget, widget); FakeVimHandler *handler = new FakeVimHandler(widget, widget);

View File

@@ -177,7 +177,10 @@ void QtVersionManager::apply()
} }
} }
} }
m_versions = m_widget->versions(); qDeleteAll(m_versions);
m_versions.clear();
foreach(QtVersion *version, m_widget->versions())
m_versions.append(new QtVersion(*version));
if (versionPathsChanged) if (versionPathsChanged)
updateDocumentation(); updateDocumentation();
updateUniqueIdToIndexMap(); updateUniqueIdToIndexMap();
@@ -361,11 +364,16 @@ QtVersion *QtVersionManager::currentQtVersion() const
QtDirWidget::QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defaultVersion) QtDirWidget::QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defaultVersion)
: QWidget(parent) : QWidget(parent)
, m_versions(versions)
, m_defaultVersion(defaultVersion) , m_defaultVersion(defaultVersion)
, m_specifyNameString(tr("<specify a name>")) , m_specifyNameString(tr("<specify a name>"))
, m_specifyPathString(tr("<specify a path>")) , m_specifyPathString(tr("<specify a path>"))
{ {
// Initialize m_versions
foreach(QtVersion *version, versions) {
m_versions.append(new QtVersion(*version));
}
m_ui.setupUi(this); m_ui.setupUi(this);
m_ui.qtPath->setExpectedKind(Core::Utils::PathChooser::Directory); m_ui.qtPath->setExpectedKind(Core::Utils::PathChooser::Directory);
m_ui.qtPath->setPromptDialogTitle(tr("Select QTDIR")); m_ui.qtPath->setPromptDialogTitle(tr("Select QTDIR"));
@@ -417,6 +425,11 @@ QtDirWidget::QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defau
updateState(); updateState();
} }
QtDirWidget::~QtDirWidget()
{
qDeleteAll(m_versions);
}
void QtDirWidget::addQtDir() void QtDirWidget::addQtDir()
{ {
QtVersion *newVersion = new QtVersion(m_specifyNameString, m_specifyPathString); QtVersion *newVersion = new QtVersion(m_specifyNameString, m_specifyPathString);

View File

@@ -122,7 +122,6 @@ private:
// This is updated on first call to qmakeCommand // This is updated on first call to qmakeCommand
// That function is called from updateVersionInfo() // That function is called from updateVersionInfo()
mutable QString m_qtVersionString; mutable QString m_qtVersionString;
Q_DISABLE_COPY(QtVersion);
}; };
@@ -131,6 +130,7 @@ class QtDirWidget : public QWidget
Q_OBJECT Q_OBJECT
public: public:
QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defaultVersion); QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defaultVersion);
~QtDirWidget();
QList<QtVersion *> versions() const; QList<QtVersion *> versions() const;
int defaultVersion() const; int defaultVersion() const;
void finish(); void finish();

View File

@@ -719,6 +719,7 @@ bool ProFileEvaluator::Private::visitProValue(ProValue *value)
// The following two blocks fix bug 180128 by making all "interesting" // The following two blocks fix bug 180128 by making all "interesting"
// file name absolute in each .pro file, not just the top most one // file name absolute in each .pro file, not just the top most one
if (varName == QLatin1String("SOURCES") if (varName == QLatin1String("SOURCES")
|| varName == QLatin1String("OBJECTIVE_SOURCES")
|| varName == QLatin1String("HEADERS") || varName == QLatin1String("HEADERS")
|| varName == QLatin1String("INTERFACES") || varName == QLatin1String("INTERFACES")
|| varName == QLatin1String("FORMS") || varName == QLatin1String("FORMS")
@@ -1666,7 +1667,7 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct
} }
const QStringList mutuals = args[1].split(QLatin1Char('|')); const QStringList mutuals = args[1].split(QLatin1Char('|'));
const QStringList &configs = valuesDirect(QLatin1String("CONFIG")); const QStringList &configs = valuesDirect(QLatin1String("CONFIG"));
for (int i = configs.size() - 1 && ok; i >= 0; i--) { for (int i = configs.size() - 1; i >= 0; i--) {
for (int mut = 0; mut < mutuals.count(); mut++) { for (int mut = 0; mut < mutuals.count(); mut++) {
if (configs[i] == mutuals[mut].trimmed()) { if (configs[i] == mutuals[mut].trimmed()) {
cond = (configs[i] == args[0]); cond = (configs[i] == args[0]);

View File

@@ -42,7 +42,7 @@
#include <QtCore/QDebug> #include <QtCore/QDebug>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# define QT_INSTALL_DIR "C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.4.3"; # define QT_INSTALL_DIR "C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.4.3/qt";
const char * const oldInstallBase = QT_INSTALL_DIR; const char * const oldInstallBase = QT_INSTALL_DIR;
const char * const oldSourceBase = QT_INSTALL_DIR; const char * const oldSourceBase = QT_INSTALL_DIR;
@@ -108,7 +108,8 @@ bool patchBinariesWithQtPathes(const char *baseQtPath)
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
"/bin/qmake.exe", "/bin/qmake.exe",
"/bin/QtCore4.dll", "/bin/QtCore4.dll",
"/bin/QtCored4.dll" "/bin/QtCored4.dll",
"/lib/QtCored4.dll"
#else #else
"/bin/qmake", "/bin/qmake",
"/lib/libQtCore.so", "/lib/libQtCore.so",
@@ -136,7 +137,6 @@ char * allocFileNameCopyAppend(const char * textToCopy,
Q_ASSERT(textToAppend != NULL); Q_ASSERT(textToAppend != NULL);
if (textToAppend2 == NULL) if (textToAppend2 == NULL)
textToAppend2 = ""; textToAppend2 = "";
Q_ASSERT(textToAppend2 != NULL);
char * const res = new char[bytesToAllocate]; char * const res = new char[bytesToAllocate];
const size_t textToCopyLen = strlen(textToCopy); const size_t textToCopyLen = strlen(textToCopy);
@@ -153,7 +153,7 @@ char * allocFileNameCopyAppend(const char * textToCopy,
if (textToAppendLen > 0) if (textToAppendLen > 0)
strncpy(res + textToCopyLen, textToAppend, bytesToAllocate - textToCopyLen - 1); strncpy(res + textToCopyLen, textToAppend, bytesToAllocate - textToCopyLen - 1);
if (textToAppend2Len > 0) if (textToAppend2Len > 0)
strncpy(res + textToCopyLen + textToAppend2Len, textToAppend2, bytesToAllocate - textToCopyLen - textToAppend2Len - 1); strncpy(res + textToCopyLen + textToAppendLen, textToAppend2, bytesToAllocate - textToCopyLen - textToAppendLen - 1);
res[textToCopyLen + textToAppendLen + textToAppend2Len] = '\0'; res[textToCopyLen + textToAppendLen + textToAppend2Len] = '\0';
res[bytesToAllocate - 1] = '\0'; // Safe is safe res[bytesToAllocate - 1] = '\0'; // Safe is safe
return res; return res;
@@ -183,6 +183,19 @@ bool patchDebugLibrariesWithQtPath(const char *baseQtPath)
{"/bin/QtWebKitd4.dll", "/src/3rdparty/webkit/WebCore/"}, {"/bin/QtWebKitd4.dll", "/src/3rdparty/webkit/WebCore/"},
{"/bin/QtXmld4.dll", "/src/xml/"}, {"/bin/QtXmld4.dll", "/src/xml/"},
{"/bin/QtXmlPatternsd4.dll", "/src/xmlpatterns/"}, {"/bin/QtXmlPatternsd4.dll", "/src/xmlpatterns/"},
{"/lib/Qt3Supportd4.dll", "/src/qt3support/"},
{"/lib/QtCored4.dll", "/src/corelib/"},
{"/lib/QtGuid4.dll", "/src/gui/"},
{"/lib/QtHelpd4.dll", "/tools/assistant/lib/"},
{"/lib/QtNetworkd4.dll", "/src/network/"},
{"/lib/QtOpenGLd4.dll", "/src/opengl/"},
{"/lib/QtScriptd4.dll", "/src/script/"},
{"/lib/QtSqld4.dll", "/src/sql/"},
{"/lib/QtSvgd4.dll", "/src/svg/"},
{"/lib/QtTestd4.dll", "/src/testlib/"},
{"/lib/QtWebKitd4.dll", "/src/3rdparty/webkit/WebCore/"},
{"/lib/QtXmld4.dll", "/src/xml/"},
{"/lib/QtXmlPatternsd4.dll", "/src/xmlpatterns/"},
{"/plugins/accessible/qtaccessiblecompatwidgetsd4.dll", "/src/plugins/accessible/compat/"}, {"/plugins/accessible/qtaccessiblecompatwidgetsd4.dll", "/src/plugins/accessible/compat/"},
{"/plugins/accessible/qtaccessiblewidgetsd4.dll", "/src/plugins/accessible/widgets/"}, {"/plugins/accessible/qtaccessiblewidgetsd4.dll", "/src/plugins/accessible/widgets/"},
{"/plugins/codecs/qcncodecsd4.dll", "/src/plugins/codecs/cn/"}, {"/plugins/codecs/qcncodecsd4.dll", "/src/plugins/codecs/cn/"},

View File

@@ -1,4 +1,5 @@
load(qttest_p4) TEMPLATE = app
CONFIG += qt warn_on console depend_includepath
QT = core testlib
include(../shared/shared.pri) include(../shared/shared.pri)
QT = core
SOURCES += tst_ast.cpp SOURCES += tst_ast.cpp

View File

@@ -1,5 +1,6 @@
load(qttest_p4) TEMPLATE = app
CONFIG += qt warn_on console depend_includepath
QT = core testlib
include(../shared/shared.pri) include(../shared/shared.pri)
QT = core
SOURCES += tst_semantic.cpp SOURCES += tst_semantic.cpp

View File

@@ -1,5 +1,5 @@
DEFINES += HAVE_QT CPLUSPLUS_WITH_NAMESPACE DEFINES += HAVE_QT CPLUSPLUS_WITH_NAMESPACE
INCLUDEPATH += $$PWD/../../../../shared/cplusplus INCLUDEPATH += $$PWD/../../../../src/shared/cplusplus
DEPENDPATH += $$INCLUDEPATH . DEPENDPATH += $$INCLUDEPATH .
LIBS += -L$$PWD -lCPlusPlusTestSupport LIBS += -L$$PWD -lCPlusPlusTestSupport

View File

@@ -5,4 +5,4 @@ CONFIG += static
QT = core QT = core
DEFINES += HAVE_QT CPLUSPLUS_WITH_NAMESPACE DEFINES += HAVE_QT CPLUSPLUS_WITH_NAMESPACE
include($$PWD/../../../../shared/cplusplus/cplusplus.pri) include($$PWD/../../../../src/shared/cplusplus/cplusplus.pri)