Commit ec4302a1 authored by mae's avatar mae
Browse files

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

parents 87b8a974 5fcf3503
......@@ -215,8 +215,20 @@
\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
\row
......@@ -239,10 +251,19 @@
\row
\i Indenting Blocks
\i Use \key{Ctrl+I}
\row
\i Collapse
\i Use \key{Ctrl+\<}
\row
\i Commenting or uncommenting blocks
\i Use \key{Ctrl+\/}
\row
\i Delete a line
\i Use \key{Shift+Del}
\row
\i Switch between header file and source file
\i Use \key{F4}.
......@@ -256,19 +277,12 @@
\i Use \key{F2} and \key{Shift+F2}. This feature works with
namespaces, classes, methods, variables, include statements,
and macros.
\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.
\row
\i Switch to an external editor
\i Select \gui{Open in external editor} from the
\gui{Edit -> Advanced} menu.
\endtable
*/
......
......@@ -462,6 +462,7 @@ bool EditorManager::unregisterEditor(IEditor *editor)
return false;
}
void EditorManager::updateCurrentEditorAndGroup(IContext *context)
{
if (debugEditorManager)
......@@ -470,7 +471,8 @@ void EditorManager::updateCurrentEditorAndGroup(IContext *context)
IEditor *editor = context ? qobject_cast<IEditor*>(context) : 0;
if (groupContext) {
m_d->m_splitter->setCurrentGroup(groupContext->editorGroup());
setCurrentEditor(0);
if (groupContext->editorGroup()->editorCount() == 0)
setCurrentEditor(0);
updateActions();
} else if (editor) {
setCurrentEditor(editor);
......
......@@ -124,10 +124,23 @@ void CodepasterPlugin::extensionsInitialized()
->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()
{
if (m_poster)
// FIXME: The whole m_poster thing is de facto a simple function call.
if (m_poster) {
delete m_poster;
m_poster = 0;
}
IEditor* editor = EditorManager::instance()->currentEditor();
ITextEditor* textEditor = qobject_cast<ITextEditor*>(editor);
if (!textEditor)
......@@ -171,7 +184,8 @@ void CodepasterPlugin::post()
data = view.getContent();
// Submit to codepaster
m_poster = new CustomPoster(m_settingsPage->serverUrl().toString());
m_poster = new CustomPoster(serverUrl());
// Copied from cpaster. Otherwise lineendings will screw up
if (!data.contains("\r\n")) {
......@@ -185,9 +199,11 @@ void CodepasterPlugin::post()
void CodepasterPlugin::fetch()
{
if (m_fetcher)
if (m_fetcher) {
delete m_fetcher;
m_fetcher = new CustomFetcher(m_settingsPage->serverUrl().toString());
m_fetcher = 0;
}
m_fetcher = new CustomFetcher(serverUrl());
QDialog dialog;
Ui_PasteSelectDialog ui;
......@@ -208,7 +224,7 @@ void CodepasterPlugin::fetch()
return;
delete m_fetcher;
m_fetcher = new CustomFetcher(m_settingsPage->serverUrl().toString());
m_fetcher = new CustomFetcher(serverUrl());
m_fetcher->fetch(pasteID);
}
......
......@@ -70,6 +70,7 @@ public slots:
void fetch();
private:
QString serverUrl() const;
QAction *m_postAction;
QAction *m_fetchAction;
......
......@@ -180,7 +180,16 @@ bool FakeVimPluginPrivate::initialize()
void FakeVimPluginPrivate::installHandler(Core::IEditor *editor)
{
if (!editor)
return;
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);
......
......@@ -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)
updateDocumentation();
updateUniqueIdToIndexMap();
......@@ -361,11 +364,16 @@ QtVersion *QtVersionManager::currentQtVersion() const
QtDirWidget::QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defaultVersion)
: QWidget(parent)
, m_versions(versions)
, m_defaultVersion(defaultVersion)
, m_specifyNameString(tr("<specify a name>"))
, 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.qtPath->setExpectedKind(Core::Utils::PathChooser::Directory);
m_ui.qtPath->setPromptDialogTitle(tr("Select QTDIR"));
......@@ -417,6 +425,11 @@ QtDirWidget::QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defau
updateState();
}
QtDirWidget::~QtDirWidget()
{
qDeleteAll(m_versions);
}
void QtDirWidget::addQtDir()
{
QtVersion *newVersion = new QtVersion(m_specifyNameString, m_specifyPathString);
......
......@@ -122,7 +122,6 @@ private:
// This is updated on first call to qmakeCommand
// That function is called from updateVersionInfo()
mutable QString m_qtVersionString;
Q_DISABLE_COPY(QtVersion);
};
......@@ -131,6 +130,7 @@ class QtDirWidget : public QWidget
Q_OBJECT
public:
QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defaultVersion);
~QtDirWidget();
QList<QtVersion *> versions() const;
int defaultVersion() const;
void finish();
......
......@@ -719,6 +719,7 @@ bool ProFileEvaluator::Private::visitProValue(ProValue *value)
// The following two blocks fix bug 180128 by making all "interesting"
// file name absolute in each .pro file, not just the top most one
if (varName == QLatin1String("SOURCES")
|| varName == QLatin1String("OBJECTIVE_SOURCES")
|| varName == QLatin1String("HEADERS")
|| varName == QLatin1String("INTERFACES")
|| varName == QLatin1String("FORMS")
......@@ -1666,7 +1667,7 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct
}
const QStringList mutuals = args[1].split(QLatin1Char('|'));
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++) {
if (configs[i] == mutuals[mut].trimmed()) {
cond = (configs[i] == args[0]);
......
......@@ -42,7 +42,7 @@
#include <QtCore/QDebug>
#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 oldSourceBase = QT_INSTALL_DIR;
......@@ -108,7 +108,8 @@ bool patchBinariesWithQtPathes(const char *baseQtPath)
#ifdef Q_OS_WIN
"/bin/qmake.exe",
"/bin/QtCore4.dll",
"/bin/QtCored4.dll"
"/bin/QtCored4.dll",
"/lib/QtCored4.dll"
#else
"/bin/qmake",
"/lib/libQtCore.so",
......@@ -136,7 +137,6 @@ char * allocFileNameCopyAppend(const char * textToCopy,
Q_ASSERT(textToAppend != NULL);
if (textToAppend2 == NULL)
textToAppend2 = "";
Q_ASSERT(textToAppend2 != NULL);
char * const res = new char[bytesToAllocate];
const size_t textToCopyLen = strlen(textToCopy);
......@@ -153,7 +153,7 @@ char * allocFileNameCopyAppend(const char * textToCopy,
if (textToAppendLen > 0)
strncpy(res + textToCopyLen, textToAppend, bytesToAllocate - textToCopyLen - 1);
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[bytesToAllocate - 1] = '\0'; // Safe is safe
return res;
......@@ -183,6 +183,19 @@ bool patchDebugLibrariesWithQtPath(const char *baseQtPath)
{"/bin/QtWebKitd4.dll", "/src/3rdparty/webkit/WebCore/"},
{"/bin/QtXmld4.dll", "/src/xml/"},
{"/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/qtaccessiblewidgetsd4.dll", "/src/plugins/accessible/widgets/"},
{"/plugins/codecs/qcncodecsd4.dll", "/src/plugins/codecs/cn/"},
......
load(qttest_p4)
TEMPLATE = app
CONFIG += qt warn_on console depend_includepath
QT = core testlib
include(../shared/shared.pri)
QT = core
SOURCES += tst_ast.cpp
load(qttest_p4)
TEMPLATE = app
CONFIG += qt warn_on console depend_includepath
QT = core testlib
include(../shared/shared.pri)
QT = core
SOURCES += tst_semantic.cpp
DEFINES += HAVE_QT CPLUSPLUS_WITH_NAMESPACE
INCLUDEPATH += $$PWD/../../../../shared/cplusplus
INCLUDEPATH += $$PWD/../../../../src/shared/cplusplus
DEPENDPATH += $$INCLUDEPATH .
LIBS += -L$$PWD -lCPlusPlusTestSupport
......@@ -5,4 +5,4 @@ CONFIG += static
QT = core
DEFINES += HAVE_QT CPLUSPLUS_WITH_NAMESPACE
include($$PWD/../../../../shared/cplusplus/cplusplus.pri)
include($$PWD/../../../../src/shared/cplusplus/cplusplus.pri)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment