forked from qt-creator/qt-creator
Merge commit 'origin/0.9.1-beta'
This commit is contained in:
@@ -13,6 +13,7 @@ win32 {
|
||||
}
|
||||
linux-* {
|
||||
LIBS *= -lExtensionSystem -lAggregation
|
||||
QMAKE_FLAGS+=-Wl,--enable-new-dtags
|
||||
}
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
@@ -283,3 +283,4 @@ int main(int argc, char **argv)
|
||||
QTimer::singleShot(100, &pluginManager, SLOT(startTests()));
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
|
||||
@@ -268,16 +268,14 @@ bool EditorGroup::restoreState(const QByteArray &state)
|
||||
EditorManager *em = EditorManager::instance();
|
||||
EditorList editors;
|
||||
in >> editors;
|
||||
IEditor *currentEditor = 0;
|
||||
IEditor *editor;
|
||||
int savedIndex = editors.currentEditorIndex;
|
||||
if (savedIndex >= 0 && savedIndex < editors.count())
|
||||
em->restoreEditor(editors.fileNameAt(savedIndex), editors.editorKindAt(savedIndex), this);
|
||||
for (int j = 0; j < editors.count(); ++j) {
|
||||
editor = em->restoreEditor(editors.fileNameAt(j), editors.editorKindAt(j), this);
|
||||
if (j == savedIndex)
|
||||
currentEditor = editor;
|
||||
continue;
|
||||
em->restoreEditor(editors.fileNameAt(j), editors.editorKindAt(j), this);
|
||||
}
|
||||
if (currentEditor)
|
||||
setCurrentEditor(currentEditor);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,8 +98,6 @@ void FancyTabBar::paintEvent(QPaintEvent *event)
|
||||
|
||||
// paint active tab last, since it overlaps the neighbors
|
||||
paintTab(&p, currentIndex());
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Handle hover events for mouse fade ins
|
||||
|
||||
@@ -151,20 +151,18 @@ class Debugger::Internal::LocationMark
|
||||
public:
|
||||
LocationMark(const QString &fileName, int linenumber)
|
||||
: BaseTextMark(fileName, linenumber)
|
||||
{
|
||||
}
|
||||
{}
|
||||
~LocationMark();
|
||||
|
||||
QIcon icon() const;
|
||||
void updateLineNumber(int /*lineNumber*/) {}
|
||||
void updateBlock(const QTextBlock & /*block*/) {}
|
||||
void removedFromEditor() { deleteLater(); }
|
||||
private:
|
||||
void removedFromEditor() {}
|
||||
};
|
||||
|
||||
LocationMark::~LocationMark()
|
||||
{
|
||||
//qDebug() << "LOCATIONMARK DESTRUCTOR" << m_editor;
|
||||
//qDebug() << "LOCATIONMARK DESTRUCTOR";
|
||||
}
|
||||
|
||||
QIcon LocationMark::icon() const
|
||||
|
||||
@@ -25,7 +25,7 @@ SUBDIRS = plugin_coreplugin \
|
||||
# plugin_regexp \ # don't know what to do with this
|
||||
plugin_qtscripteditor \
|
||||
plugin_cpaster \
|
||||
plugin_cmakeprojectmanager
|
||||
# plugin_cmakeprojectmanager
|
||||
|
||||
# These two plugins require private headers from Qt and therefore don't work
|
||||
# with an installed/released version of Qt.
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
CompileOutputWindow(BuildManager *bm);
|
||||
QWidget *outputWidget(QWidget *);
|
||||
QList<QWidget*> toolBarWidgets(void) const { return QList<QWidget *>(); }
|
||||
QString name() const { return tr("Compile"); }
|
||||
QString name() const { return tr("Compile Output"); }
|
||||
int priorityInStatusBar() const;
|
||||
void clearContents();
|
||||
void visibilityChanged(bool visible);
|
||||
|
||||
@@ -311,7 +311,7 @@ QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
|
||||
rowInResult = findInResultInsertPosition(item.name);
|
||||
int rowInChanges = findInChangesInsertPosition(item.name);
|
||||
|
||||
qDebug()<<"addVariable "<<item.name<<existsInBaseEnvironment<<rowInResult<<rowInChanges;
|
||||
//qDebug() << "addVariable " << item.name << existsInBaseEnvironment << rowInResult << rowInChanges;
|
||||
|
||||
if (existsInBaseEnvironment) {
|
||||
m_items.insert(rowInChanges, item);
|
||||
|
||||
@@ -406,16 +406,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
|
||||
msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
// recent projects menu
|
||||
Core::IActionContainer *mrecent =
|
||||
am->createMenu(Constants::M_RECENTPROJECTS);
|
||||
mrecent->menu()->setTitle("Recent Projects");
|
||||
mfile->addMenu(mrecent, Core::Constants::G_FILE_PROJECT);
|
||||
connect(mfile->menu(), SIGNAL(aboutToShow()),
|
||||
this, SLOT(updateRecentProjectMenu()));
|
||||
#endif
|
||||
|
||||
// Default open action
|
||||
m_openFileAction = new QAction(tr("Open File"), this);
|
||||
cmd = am->registerAction(m_openFileAction, ProjectExplorer::Constants::OPENFILE,
|
||||
@@ -425,6 +415,14 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
|
||||
// Open With menu
|
||||
mfilec->addMenu(openWith, ProjectExplorer::Constants::G_FILE_OPEN);
|
||||
|
||||
// recent projects menu
|
||||
Core::IActionContainer *mrecent =
|
||||
am->createMenu(Constants::M_RECENTPROJECTS);
|
||||
mrecent->menu()->setTitle("Recent Projects");
|
||||
mfile->addMenu(mrecent, Core::Constants::G_FILE_OPEN);
|
||||
connect(mfile->menu(), SIGNAL(aboutToShow()),
|
||||
this, SLOT(updateRecentProjectMenu()));
|
||||
|
||||
// unload action
|
||||
m_unloadAction = new QAction(tr("Unload Project"), this);
|
||||
cmd = am->registerAction(m_unloadAction, Constants::UNLOAD, globalcontext);
|
||||
@@ -1498,8 +1496,7 @@ void ProjectExplorerPlugin::openRecentProject()
|
||||
QAction *a = qobject_cast<QAction*>(sender());
|
||||
if (m_recentProjectsActions.contains(a)) {
|
||||
const QString fileName = m_recentProjectsActions.value(a);
|
||||
if (ProjectFileFactory *pf = findProjectFileFactory(fileName))
|
||||
pf->open(fileName);
|
||||
openProject(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -700,7 +700,6 @@ void Qt4ProFileNode::update()
|
||||
|
||||
void Qt4ProFileNode::fileChanged(const QString &filePath)
|
||||
{
|
||||
qDebug()<<"+++++"<<filePath;
|
||||
CppTools::CppModelManagerInterface *modelManager =
|
||||
ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>();
|
||||
|
||||
|
||||
@@ -621,7 +621,22 @@ void Qt4Project::addDefaultBuild()
|
||||
// Restoring configuration
|
||||
// Do we already have a gdbmacrobuildstep?
|
||||
// If not add it and disable linking of debugging helper
|
||||
// TODO
|
||||
|
||||
// Check for old link debugging helper setting in each buildConfiguration
|
||||
// We add a gdbmacrosbuildstep if at least one has it
|
||||
// TODO remove migration code from pre beta
|
||||
foreach(const QString &bc, buildConfigurations()) {
|
||||
QVariant v = value(bc, "addQDumper");
|
||||
if (v.isValid() && v.toBool()) {
|
||||
GdbMacrosBuildStep *gdbmacrostep = new GdbMacrosBuildStep(this);
|
||||
insertBuildStep(0, gdbmacrostep);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach(const QString &bc, buildConfigurations()) {
|
||||
setValue(bc, "addQDumper", QVariant());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1022,7 +1022,7 @@ Core::ICore *SubversionPlugin::coreInstance()
|
||||
|
||||
SubversionPlugin *SubversionPlugin::subversionPluginInstance()
|
||||
{
|
||||
QTC_ASSERT(m_subversionPluginInstance, m_subversionPluginInstance);
|
||||
QTC_ASSERT(m_subversionPluginInstance, return m_subversionPluginInstance);
|
||||
return m_subversionPluginInstance;
|
||||
}
|
||||
|
||||
|
||||
@@ -749,7 +749,7 @@ void BaseTextEditor::moveLineUpDown(bool up)
|
||||
|
||||
void BaseTextEditor::cleanWhitespace()
|
||||
{
|
||||
d->m_document->cleanWhitespace();
|
||||
d->m_document->cleanWhitespace();
|
||||
}
|
||||
|
||||
void BaseTextEditor::keyPressEvent(QKeyEvent *e)
|
||||
@@ -1286,7 +1286,7 @@ void BaseTextEditor::setFontSettings(const TextEditor::FontSettings &fs)
|
||||
|
||||
void BaseTextEditor::setStorageSettings(const StorageSettings &storageSettings)
|
||||
{
|
||||
d->m_document->setStorageSettings(storageSettings);
|
||||
d->m_document->setStorageSettings(storageSettings);
|
||||
}
|
||||
|
||||
//--------- BaseTextEditorPrivate -----------
|
||||
@@ -2283,9 +2283,11 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
|
||||
}
|
||||
}
|
||||
|
||||
collapseAfter = (userData->collapseMode() == TextBlockUserData::CollapseAfter);
|
||||
collapseThis = (userData->collapseMode() == TextBlockUserData::CollapseThis);
|
||||
hasClosingCollapse = userData->hasClosingCollapse() && (previousBraceDepth > 0);
|
||||
if (!userData->ifdefedOut()) {
|
||||
collapseAfter = (userData->collapseMode() == TextBlockUserData::CollapseAfter);
|
||||
collapseThis = (userData->collapseMode() == TextBlockUserData::CollapseThis);
|
||||
hasClosingCollapse = userData->hasClosingCollapse() && (previousBraceDepth > 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (d->m_codeFoldingVisible) {
|
||||
@@ -2318,10 +2320,12 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
|
||||
|
||||
bool collapseNext = nextBlockUserData
|
||||
&& nextBlockUserData->collapseMode()
|
||||
== TextBlockUserData::CollapseThis;
|
||||
== TextBlockUserData::CollapseThis
|
||||
&& !nextBlockUserData->ifdefedOut();
|
||||
|
||||
bool nextHasClosingCollapse = nextBlockUserData
|
||||
&& nextBlockUserData->hasClosingCollapseInside();
|
||||
&& nextBlockUserData->hasClosingCollapseInside()
|
||||
&& nextBlockUserData->ifdefedOut();
|
||||
|
||||
bool drawBox = ((collapseAfter || collapseNext) && !nextHasClosingCollapse);
|
||||
|
||||
@@ -2473,17 +2477,22 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
|
||||
extraAreaWidth(&markWidth);
|
||||
|
||||
if (e->type() == QEvent::MouseMove && e->buttons() == 0) { // mouse tracking
|
||||
int highlightBlockNumber = d->extraAreaHighlightCollapseBlockNumber;
|
||||
// Update which folder marker is highlighted
|
||||
const int highlightBlockNumber = d->extraAreaHighlightCollapseBlockNumber;
|
||||
d->extraAreaHighlightCollapseBlockNumber = -1;
|
||||
if (TextBlockUserData::canCollapse(cursor.block())
|
||||
|
||||
if (d->m_codeFoldingVisible
|
||||
&& TextBlockUserData::canCollapse(cursor.block())
|
||||
&& !TextBlockUserData::hasClosingCollapseInside(cursor.block().next())
|
||||
&& collapseBox(cursor.block()).contains(e->pos()))
|
||||
d->extraAreaHighlightCollapseBlockNumber = cursor.blockNumber();
|
||||
|
||||
// Set whether the mouse cursor is a hand or normal arrow
|
||||
bool hand = (e->pos().x() <= markWidth || d->extraAreaHighlightCollapseBlockNumber >= 0);
|
||||
if (hand != (d->m_extraArea->cursor().shape() == Qt::PointingHandCursor))
|
||||
d->m_extraArea->setCursor(hand ? Qt::PointingHandCursor : Qt::ArrowCursor);
|
||||
|
||||
// Start fading in or out the highlighted folding marker
|
||||
if (highlightBlockNumber != d->extraAreaHighlightCollapseBlockNumber) {
|
||||
d->extraAreaTimeLine->stop();
|
||||
d->extraAreaTimeLine->setDirection(d->extraAreaHighlightCollapseBlockNumber >= 0?
|
||||
@@ -2500,12 +2509,12 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
|
||||
|
||||
if (e->type() == QEvent::MouseButtonPress || e->type() == QEvent::MouseButtonDblClick) {
|
||||
if (e->button() == Qt::LeftButton) {
|
||||
if (TextBlockUserData::canCollapse(cursor.block())
|
||||
if (d->m_codeFoldingVisible && TextBlockUserData::canCollapse(cursor.block())
|
||||
&& !TextBlockUserData::hasClosingCollapseInside(cursor.block().next())
|
||||
&& collapseBox(cursor.block()).contains(e->pos())) {
|
||||
setTextCursor(cursor);
|
||||
toggleBlockVisible(cursor.block());
|
||||
} else if (e->pos().x() > markWidth) {
|
||||
} else if (d->m_marksVisible && e->pos().x() > markWidth) {
|
||||
QTextCursor selection = cursor;
|
||||
selection.setVisualNavigation(true);
|
||||
d->extraAreaSelectionAnchorBlockNumber = selection.blockNumber();
|
||||
@@ -2515,7 +2524,7 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
|
||||
} else {
|
||||
d->extraAreaToggleMarkBlockNumber = cursor.blockNumber();
|
||||
}
|
||||
} else if (e->button() == Qt::RightButton) {
|
||||
} else if (d->m_marksVisible && e->button() == Qt::RightButton) {
|
||||
QMenu * contextMenu = new QMenu(this);
|
||||
emit d->m_editable->markContextMenuRequested(editableInterface(), cursor.blockNumber() + 1, contextMenu);
|
||||
if (!contextMenu->isEmpty())
|
||||
@@ -3397,9 +3406,12 @@ void BaseTextEditor::collapse()
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
||||
QTC_ASSERT(documentLayout, return);
|
||||
QTextBlock block = textCursor().block();
|
||||
QTextBlock curBlock = block;
|
||||
while (block.isValid()) {
|
||||
if (TextBlockUserData::canCollapse(block) && block.next().isVisible()) {
|
||||
if ((block.next().userState()) >> 8 <= (textCursor().block().userState() >> 8))
|
||||
if (block == curBlock || block.next() == curBlock)
|
||||
break;
|
||||
if ((block.next().userState()) >> 8 <= (curBlock.previous().userState() >> 8))
|
||||
break;
|
||||
}
|
||||
block = block.previous();
|
||||
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
TextBlockUserData *data = static_cast<TextBlockUserData*>(block.userData());
|
||||
if (!data || data->collapseMode() != CollapseAfter) {
|
||||
data = static_cast<TextBlockUserData*>(block.next().userData());
|
||||
if (!data || data->collapseMode() != TextBlockUserData::CollapseThis)
|
||||
if (!data || data->collapseMode() != TextBlockUserData::CollapseThis || data->m_ifdefedOut)
|
||||
data = 0;
|
||||
}
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user