forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.3'
Conflicts: qtcreator.pri Change-Id: Iaca68084799ae9aec257742c395609d6e8aa72cd
This commit is contained in:
6
share/qtcreator/translations/extract-externaltools.xq
Normal file
6
share/qtcreator/translations/extract-externaltools.xq
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
let $prefix := string("QT_TRANSLATE_NOOP("Core::Internal::ExternalTool", "")
|
||||||
|
let $suffix := concat("")", codepoints-to-string(10))
|
||||||
|
for $file in tokenize($files, string("\|"))
|
||||||
|
let $doc := doc($file)
|
||||||
|
for $text in ($doc/*:externaltool/*:description, $doc/*:externaltool/*:displayname, $doc/*:externaltool/*:category)
|
||||||
|
return fn:concat($prefix, data($text), $suffix)
|
||||||
@@ -29506,7 +29506,7 @@ plutôt que dans le répertoire d'installation lors d'une exècution e
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source><html><head/><body><p>A versioned backup of the .user settings file will be used, because the non-versioned file was created by an incompatible newer version of Qt Creator.</p><p>Project settings changes made since the last time this version of Qt Creator was used with this project are ignored, and changes made now will <b>not</b> be propagated to the newer version.</p></body></html></source>
|
<source><html><head/><body><p>A versioned backup of the .user settings file will be used, because the non-versioned file was created by an incompatible newer version of Qt Creator.</p><p>Project settings changes made since the last time this version of Qt Creator was used with this project are ignored, and changes made now will <b>not</b> be propagated to the newer version.</p></body></html></source>
|
||||||
<translation><html><head/><body><p>Un back-up versionné du fichier de paramètres .user sera utilisé parce qu'un fichier non versionné a été créé par une version plus récente et incompatible de Qt Creator.</p><p>Les changements aux préférences du projet effectuées depuis la dernière fois que cette version dfe Qt Creator a été utilisée avec ce projet sont ignorés et les changements effectués dès maintenant ne seront <b>pas</b> propagés à la nouvelle version.</p></body></html></translation>
|
<translation><html><head/><body><p>Un back-up versionné du fichier de paramètres .user sera utilisé parce qu'un fichier non versionné a été créé par une version plus récente et incompatible de Qt Creator.</p><p>Les changements aux préférences du projet effectuées depuis la dernière fois que cette version de Qt Creator a été utilisée avec ce projet sont ignorés et les changements effectués dès maintenant ne seront <b>pas</b> propagés à la nouvelle version.</p></body></html></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Project Settings File from a different Environment?</source>
|
<source>Project Settings File from a different Environment?</source>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -11345,6 +11345,10 @@ You can choose between stashing the changes or discarding them.</source>
|
|||||||
<source>Context Help</source>
|
<source>Context Help</source>
|
||||||
<translation>Контекстная справка</translation>
|
<translation>Контекстная справка</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Report Bug...</source>
|
||||||
|
<translation>Сообщить об ошибке...</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Activate Index in Help mode</source>
|
<source>Activate Index in Help mode</source>
|
||||||
<translation>Показать указатель справки</translation>
|
<translation>Показать указатель справки</translation>
|
||||||
@@ -17973,10 +17977,6 @@ Please build the debugging helpers on the Qt version options page.</source>
|
|||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>QmlProfiler::Internal::QmlProfilerTool</name>
|
<name>QmlProfiler::Internal::QmlProfilerTool</name>
|
||||||
<message>
|
|
||||||
<source>Attach...</source>
|
|
||||||
<translation>Подключить...</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>QML Profiler</source>
|
<source>QML Profiler</source>
|
||||||
<translation>Профилер QML</translation>
|
<translation>Профилер QML</translation>
|
||||||
@@ -18021,10 +18021,6 @@ Please build the debugging helpers on the Qt version options page.</source>
|
|||||||
<source>Elapsed: %1 s</source>
|
<source>Elapsed: %1 s</source>
|
||||||
<translation>Прошло: %1 с</translation>
|
<translation>Прошло: %1 с</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Detach</source>
|
|
||||||
<translation>Отключить</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>QmlProfiler::Internal::RemoteLinuxQmlProfilerRunner</name>
|
<name>QmlProfiler::Internal::RemoteLinuxQmlProfilerRunner</name>
|
||||||
@@ -24258,6 +24254,10 @@ Server list was %2.</source>
|
|||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TextEditor::BaseFileFind</name>
|
<name>TextEditor::BaseFileFind</name>
|
||||||
|
<message>
|
||||||
|
<source>Search</source>
|
||||||
|
<translation>Поиск</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>%1 found</source>
|
<source>%1 found</source>
|
||||||
<translation>%1 найдено</translation>
|
<translation>%1 найдено</translation>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -19,6 +19,7 @@ TRANSLATIONS = $$prependAll(LANGUAGES, $$PWD/qtcreator_,.ts)
|
|||||||
|
|
||||||
MIME_TR_H = $$OUT_PWD/mime_tr.h
|
MIME_TR_H = $$OUT_PWD/mime_tr.h
|
||||||
CUSTOMWIZARD_TR_H = $$OUT_PWD/customwizard_tr.h
|
CUSTOMWIZARD_TR_H = $$OUT_PWD/customwizard_tr.h
|
||||||
|
EXTERNALTOOLS_TR_H = $$OUT_PWD/externaltools_tr.h
|
||||||
|
|
||||||
for(dir, $$list($$files($$IDE_SOURCE_TREE/src/plugins/*))):MIMETYPES_FILES += $$files($$dir/*.mimetypes.xml)
|
for(dir, $$list($$files($$IDE_SOURCE_TREE/src/plugins/*))):MIMETYPES_FILES += $$files($$dir/*.mimetypes.xml)
|
||||||
MIMETYPES_FILES = \"$$join(MIMETYPES_FILES, |)\"
|
MIMETYPES_FILES = \"$$join(MIMETYPES_FILES, |)\"
|
||||||
@@ -26,9 +27,13 @@ MIMETYPES_FILES = \"$$join(MIMETYPES_FILES, |)\"
|
|||||||
for(dir, $$list($$files($$IDE_SOURCE_TREE/share/qtcreator/templates/wizards/*))):CUSTOMWIZARD_FILES += $$files($$dir/wizard.xml)
|
for(dir, $$list($$files($$IDE_SOURCE_TREE/share/qtcreator/templates/wizards/*))):CUSTOMWIZARD_FILES += $$files($$dir/wizard.xml)
|
||||||
CUSTOMWIZARD_FILES = \"$$join(CUSTOMWIZARD_FILES, |)\"
|
CUSTOMWIZARD_FILES = \"$$join(CUSTOMWIZARD_FILES, |)\"
|
||||||
|
|
||||||
|
for(file, $$list($$files($$IDE_SOURCE_TREE/src/share/qtcreator/externaltools/*))):EXTERNALTOOLS_FILES += $$files($$file)
|
||||||
|
EXTERNALTOOLS_FILES = \"$$join(EXTERNALTOOLS_FILES, |)\"
|
||||||
|
|
||||||
extract.commands += \
|
extract.commands += \
|
||||||
$$XMLPATTERNS -output $$MIME_TR_H -param files=$$MIMETYPES_FILES $$PWD/extract-mimetypes.xq $$escape_expand(\\n\\t) \
|
$$XMLPATTERNS -output $$MIME_TR_H -param files=$$MIMETYPES_FILES $$PWD/extract-mimetypes.xq $$escape_expand(\\n\\t) \
|
||||||
$$XMLPATTERNS -output $$CUSTOMWIZARD_TR_H -param files=$$CUSTOMWIZARD_FILES $$PWD/extract-customwizards.xq
|
$$XMLPATTERNS -output $$CUSTOMWIZARD_TR_H -param files=$$CUSTOMWIZARD_FILES $$PWD/extract-customwizards.xq $$escape_expand(\\n\\t) \
|
||||||
|
$$XMLPATTERNS -output $$EXTERNALTOOLS_TR_H -param files=$$EXTERNALTOOLS_FILES $$PWD/extract-externaltools.xq
|
||||||
QMAKE_EXTRA_TARGETS += extract
|
QMAKE_EXTRA_TARGETS += extract
|
||||||
|
|
||||||
plugin_sources = $$files($$IDE_SOURCE_TREE/src/plugins/*)
|
plugin_sources = $$files($$IDE_SOURCE_TREE/src/plugins/*)
|
||||||
|
|||||||
2
src/libs/3rdparty/cplusplus/AST.cpp
vendored
2
src/libs/3rdparty/cplusplus/AST.cpp
vendored
@@ -81,7 +81,7 @@ unsigned BaseSpecifierAST::firstToken() const
|
|||||||
if (access_specifier_token)
|
if (access_specifier_token)
|
||||||
return access_specifier_token;
|
return access_specifier_token;
|
||||||
if (name)
|
if (name)
|
||||||
name->firstToken();
|
return name->firstToken();
|
||||||
// assert?
|
// assert?
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include <QtCore/qdebug.h>
|
#include <QtCore/qdebug.h>
|
||||||
#include <QtCore/qstringlist.h>
|
#include <QtCore/qstringlist.h>
|
||||||
|
#include <QtNetwork/qnetworkproxy.h>
|
||||||
#include <symbiandevicemanager.h>
|
#include <symbiandevicemanager.h>
|
||||||
|
|
||||||
namespace QmlJsDebugClient {
|
namespace QmlJsDebugClient {
|
||||||
@@ -286,6 +287,7 @@ void QDeclarativeDebugConnection::flush()
|
|||||||
void QDeclarativeDebugConnection::connectToHost(const QString &hostName, quint16 port)
|
void QDeclarativeDebugConnection::connectToHost(const QString &hostName, quint16 port)
|
||||||
{
|
{
|
||||||
QTcpSocket *socket = new QTcpSocket(d);
|
QTcpSocket *socket = new QTcpSocket(d);
|
||||||
|
socket->setProxy(QNetworkProxy::NoProxy);
|
||||||
d->device = socket;
|
d->device = socket;
|
||||||
d->connectDeviceSignals();
|
d->connectDeviceSignals();
|
||||||
d->gotHello = false;
|
d->gotHello = false;
|
||||||
|
|||||||
@@ -276,9 +276,9 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments,
|
|||||||
log->append(newline);
|
log->append(newline);
|
||||||
log->append(QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary",
|
log->append(QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary",
|
||||||
"Running %1 %2 ...\n").arg(arguments.qmakeCommand,
|
"Running %1 %2 ...\n").arg(arguments.qmakeCommand,
|
||||||
arguments.qmakeArguments.join(" ")));
|
qmakeArgs.join(" ")));
|
||||||
|
|
||||||
if (!runBuildProcess(proc, arguments.qmakeCommand, arguments.qmakeArguments, 30000, false, log, errorMessage))
|
if (!runBuildProcess(proc, arguments.qmakeCommand, qmakeArgs, 30000, false, log, errorMessage))
|
||||||
return false;
|
return false;
|
||||||
log->append(newline);
|
log->append(newline);
|
||||||
if (makeFullPath.isEmpty()) {
|
if (makeFullPath.isEmpty()) {
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
|
#include <QtCore/QCoreApplication>
|
||||||
#include <QtCore/QXmlStreamReader>
|
#include <QtCore/QXmlStreamReader>
|
||||||
#include <QtCore/QXmlStreamWriter>
|
#include <QtCore/QXmlStreamWriter>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
@@ -316,7 +317,8 @@ static void localizedText(const QStringList &locales, QXmlStreamReader *reader,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (*currentLocale < 0 && currentText->isEmpty()) {
|
if (*currentLocale < 0 && currentText->isEmpty()) {
|
||||||
*currentText = reader->readElementText();
|
*currentText = QCoreApplication::translate("Core::Internal::ExternalTool",
|
||||||
|
reader->readElementText().toLatin1().constData());
|
||||||
} else {
|
} else {
|
||||||
reader->skipCurrentElement();
|
reader->skipCurrentElement();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -239,13 +239,17 @@ void CppHighlighter::highlightBlock(const QString &text)
|
|||||||
int oldState = currentState & 0xff;
|
int oldState = currentState & 0xff;
|
||||||
int oldBraceDepth = currentState >> 8;
|
int oldBraceDepth = currentState >> 8;
|
||||||
if (oldState == tokenize.state() && oldBraceDepth != braceDepth) {
|
if (oldState == tokenize.state() && oldBraceDepth != braceDepth) {
|
||||||
|
BaseTextDocumentLayout::FoldValidator foldValidor;
|
||||||
|
foldValidor.setup(qobject_cast<BaseTextDocumentLayout *>(document()->documentLayout()));
|
||||||
int delta = braceDepth - oldBraceDepth;
|
int delta = braceDepth - oldBraceDepth;
|
||||||
QTextBlock block = currentBlock().next();
|
QTextBlock block = currentBlock().next();
|
||||||
while (block.isValid() && block.userState() != -1) {
|
while (block.isValid() && block.userState() != -1) {
|
||||||
BaseTextDocumentLayout::changeBraceDepth(block, delta);
|
BaseTextDocumentLayout::changeBraceDepth(block, delta);
|
||||||
BaseTextDocumentLayout::changeFoldingIndent(block, delta);
|
BaseTextDocumentLayout::changeFoldingIndent(block, delta);
|
||||||
|
foldValidor.process(block);
|
||||||
block = block.next();
|
block = block.next();
|
||||||
}
|
}
|
||||||
|
foldValidor.finalize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -904,7 +904,7 @@ public slots:
|
|||||||
{
|
{
|
||||||
const QAction *action = qobject_cast<const QAction *>(sender());
|
const QAction *action = qobject_cast<const QAction *>(sender());
|
||||||
QTC_ASSERT(action, return);
|
QTC_ASSERT(action, return);
|
||||||
const ContextData data = action->data().value<ContextData>();
|
const BreakpointMenuContextData data = action->data().value<BreakpointMenuContextData>();
|
||||||
currentEngine()->executeRunToLine(data);
|
currentEngine()->executeRunToLine(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -912,7 +912,7 @@ public slots:
|
|||||||
{
|
{
|
||||||
const QAction *action = qobject_cast<const QAction *>(sender());
|
const QAction *action = qobject_cast<const QAction *>(sender());
|
||||||
QTC_ASSERT(action, return);
|
QTC_ASSERT(action, return);
|
||||||
const ContextData data = action->data().value<ContextData>();
|
const BreakpointMenuContextData data = action->data().value<BreakpointMenuContextData>();
|
||||||
currentEngine()->executeJumpToLine(data);
|
currentEngine()->executeJumpToLine(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -413,7 +413,11 @@ void QmlCppEngine::executeJumpToLine(const ContextData &data)
|
|||||||
|
|
||||||
void QmlCppEngine::executeDebuggerCommand(const QString &command)
|
void QmlCppEngine::executeDebuggerCommand(const QString &command)
|
||||||
{
|
{
|
||||||
d->m_cppEngine->executeDebuggerCommand(command);
|
if (d->m_qmlEngine->state() == InferiorStopOk) {
|
||||||
|
d->m_qmlEngine->executeDebuggerCommand(command);
|
||||||
|
} else {
|
||||||
|
d->m_cppEngine->executeDebuggerCommand(command);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -3915,7 +3915,6 @@ void FakeVimHandler::Private::highlightMatches(const QString &needle)
|
|||||||
sel.cursor = tc;
|
sel.cursor = tc;
|
||||||
sel.format = tc.blockCharFormat();
|
sel.format = tc.blockCharFormat();
|
||||||
sel.format.setBackground(QColor(177, 177, 0));
|
sel.format.setBackground(QColor(177, 177, 0));
|
||||||
sel.format.setForeground(Qt::black);
|
|
||||||
m_searchSelections.append(sel);
|
m_searchSelections.append(sel);
|
||||||
if (document()->characterAt(tc.position()) == ParagraphSeparator)
|
if (document()->characterAt(tc.position()) == ParagraphSeparator)
|
||||||
tc.movePosition(Right, MoveAnchor);
|
tc.movePosition(Right, MoveAnchor);
|
||||||
|
|||||||
@@ -997,6 +997,10 @@ bool FakeVimPluginPrivate::initialize()
|
|||||||
Constants::INSTALL_HANDLER, globalcontext);
|
Constants::INSTALL_HANDLER, globalcontext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence(Constants::INSTALL_KEY));
|
cmd->setDefaultKeySequence(QKeySequence(Constants::INSTALL_KEY));
|
||||||
|
|
||||||
|
ActionContainer *advancedMenu =
|
||||||
|
actionManager()->actionContainer(Core::Constants::M_EDIT_ADVANCED);
|
||||||
|
advancedMenu->addAction(cmd, Core::Constants::G_EDIT_EDITOR);
|
||||||
|
|
||||||
for (int i = 1; i < 10; ++i) {
|
for (int i = 1; i < 10; ++i) {
|
||||||
QAction *act = new QAction(this);
|
QAction *act = new QAction(this);
|
||||||
act->setText(QString("Execute User Action #%1").arg(i));
|
act->setText(QString("Execute User Action #%1").arg(i));
|
||||||
@@ -1008,10 +1012,6 @@ bool FakeVimPluginPrivate::initialize()
|
|||||||
connect(act, SIGNAL(triggered()), SLOT(userActionTriggered()));
|
connect(act, SIGNAL(triggered()), SLOT(userActionTriggered()));
|
||||||
}
|
}
|
||||||
|
|
||||||
ActionContainer *advancedMenu =
|
|
||||||
actionManager()->actionContainer(Core::Constants::M_EDIT_ADVANCED);
|
|
||||||
advancedMenu->addAction(cmd, Core::Constants::G_EDIT_EDITOR);
|
|
||||||
|
|
||||||
connect(m_core, SIGNAL(coreAboutToClose()), this, SLOT(onCoreAboutToClose()));
|
connect(m_core, SIGNAL(coreAboutToClose()), this, SLOT(onCoreAboutToClose()));
|
||||||
|
|
||||||
// EditorManager
|
// EditorManager
|
||||||
|
|||||||
@@ -448,8 +448,11 @@ void BranchModel::checkoutBranch(const QModelIndex &idx)
|
|||||||
}
|
}
|
||||||
if (m_client->synchronousCheckoutBranch(m_workingDirectory, branch, &errorMessage)) {
|
if (m_client->synchronousCheckoutBranch(m_workingDirectory, branch, &errorMessage)) {
|
||||||
if (errorMessage.isEmpty()) {
|
if (errorMessage.isEmpty()) {
|
||||||
static_cast<BranchNode *>(currentBranch().internalPointer())->current = false;
|
QModelIndex currentIdx = currentBranch();
|
||||||
emit dataChanged(currentBranch(), currentBranch());
|
if (currentIdx.isValid()) {
|
||||||
|
static_cast<BranchNode *>(currentIdx.internalPointer())->current = false;
|
||||||
|
emit dataChanged(currentBranch(), currentBranch());
|
||||||
|
}
|
||||||
static_cast<BranchNode *>(idx.internalPointer())->current = true;
|
static_cast<BranchNode *>(idx.internalPointer())->current = true;
|
||||||
emit dataChanged(idx, idx);
|
emit dataChanged(idx, idx);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -575,3 +575,69 @@ QSizeF BaseTextDocumentLayout::documentSize() const
|
|||||||
size.setWidth(qMax((qreal)m_requiredWidth, size.width()));
|
size.setWidth(qMax((qreal)m_requiredWidth, size.width()));
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BaseTextDocumentLayout::FoldValidator::FoldValidator()
|
||||||
|
: m_layout(0)
|
||||||
|
, m_requestDocUpdate(false)
|
||||||
|
, m_insideFold(0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void BaseTextDocumentLayout::FoldValidator::setup(BaseTextDocumentLayout *layout)
|
||||||
|
{
|
||||||
|
m_layout = layout;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BaseTextDocumentLayout::FoldValidator::reset()
|
||||||
|
{
|
||||||
|
m_insideFold = 0;
|
||||||
|
m_requestDocUpdate = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BaseTextDocumentLayout::FoldValidator::process(QTextBlock block)
|
||||||
|
{
|
||||||
|
if (!m_layout)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const QTextBlock &previous = block.previous();
|
||||||
|
if (!previous.isValid())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((BaseTextDocumentLayout::isFolded(previous)
|
||||||
|
&& !BaseTextDocumentLayout::canFold(previous))
|
||||||
|
|| (!BaseTextDocumentLayout::isFolded(previous)
|
||||||
|
&& BaseTextDocumentLayout::canFold(previous)
|
||||||
|
&& !block.isVisible())) {
|
||||||
|
BaseTextDocumentLayout::setFolded(previous, !BaseTextDocumentLayout::isFolded(previous));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BaseTextDocumentLayout::isFolded(previous) && !m_insideFold)
|
||||||
|
m_insideFold = BaseTextDocumentLayout::foldingIndent(block);
|
||||||
|
|
||||||
|
bool toggleVisibility = false;
|
||||||
|
if (m_insideFold) {
|
||||||
|
if (BaseTextDocumentLayout::foldingIndent(block) >= m_insideFold) {
|
||||||
|
if (block.isVisible())
|
||||||
|
toggleVisibility = true;
|
||||||
|
} else {
|
||||||
|
m_insideFold = 0;
|
||||||
|
if (!block.isVisible())
|
||||||
|
toggleVisibility = true;
|
||||||
|
}
|
||||||
|
} else if (!block.isVisible()) {
|
||||||
|
toggleVisibility = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toggleVisibility) {
|
||||||
|
block.setVisible(!block.isVisible());
|
||||||
|
block.setLineCount(block.isVisible() ? qMax(1, block.layout()->lineCount()) : 0);
|
||||||
|
m_requestDocUpdate = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BaseTextDocumentLayout::FoldValidator::finalize()
|
||||||
|
{
|
||||||
|
if (m_requestDocUpdate && m_layout) {
|
||||||
|
m_layout->requestUpdate();
|
||||||
|
m_layout->emitDocumentSizeChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -174,6 +174,22 @@ public:
|
|||||||
static bool isFolded(const QTextBlock &block);
|
static bool isFolded(const QTextBlock &block);
|
||||||
static void setFolded(const QTextBlock &block, bool folded);
|
static void setFolded(const QTextBlock &block, bool folded);
|
||||||
|
|
||||||
|
class TEXTEDITOR_EXPORT FoldValidator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FoldValidator();
|
||||||
|
|
||||||
|
void setup(BaseTextDocumentLayout *layout);
|
||||||
|
void reset();
|
||||||
|
void process(QTextBlock block);
|
||||||
|
void finalize();
|
||||||
|
|
||||||
|
private:
|
||||||
|
BaseTextDocumentLayout *m_layout;
|
||||||
|
bool m_requestDocUpdate;
|
||||||
|
int m_insideFold;
|
||||||
|
};
|
||||||
|
|
||||||
static TextBlockUserData *testUserData(const QTextBlock &block) {
|
static TextBlockUserData *testUserData(const QTextBlock &block) {
|
||||||
return static_cast<TextBlockUserData*>(block.userData());
|
return static_cast<TextBlockUserData*>(block.userData());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include "syntaxhighlighter.h"
|
#include "syntaxhighlighter.h"
|
||||||
#include "basetextdocument.h"
|
#include "basetextdocument.h"
|
||||||
|
#include "basetextdocumentlayout.h"
|
||||||
|
|
||||||
#include <qtextdocument.h>
|
#include <qtextdocument.h>
|
||||||
#include <qtextlayout.h>
|
#include <qtextlayout.h>
|
||||||
@@ -76,10 +77,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void applyFormatChanges(int from, int charsRemoved, int charsAdded);
|
void applyFormatChanges(int from, int charsRemoved, int charsAdded);
|
||||||
|
|
||||||
QVector<QTextCharFormat> formatChanges;
|
QVector<QTextCharFormat> formatChanges;
|
||||||
QTextBlock currentBlock;
|
QTextBlock currentBlock;
|
||||||
bool rehighlightPending;
|
bool rehighlightPending;
|
||||||
bool inReformatBlocks;
|
bool inReformatBlocks;
|
||||||
|
BaseTextDocumentLayout::FoldValidator foldValidator;
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool adjustRange(QTextLayout::FormatRange &range, int from, int charsRemoved, int charsAdded) {
|
static bool adjustRange(QTextLayout::FormatRange &range, int from, int charsRemoved, int charsAdded) {
|
||||||
@@ -180,6 +183,8 @@ void SyntaxHighlighterPrivate::_q_reformatBlocks(int from, int charsRemoved, int
|
|||||||
|
|
||||||
void SyntaxHighlighterPrivate::reformatBlocks(int from, int charsRemoved, int charsAdded)
|
void SyntaxHighlighterPrivate::reformatBlocks(int from, int charsRemoved, int charsAdded)
|
||||||
{
|
{
|
||||||
|
foldValidator.reset();
|
||||||
|
|
||||||
rehighlightPending = false;
|
rehighlightPending = false;
|
||||||
|
|
||||||
QTextBlock block = doc->findBlock(from);
|
QTextBlock block = doc->findBlock(from);
|
||||||
@@ -206,6 +211,8 @@ void SyntaxHighlighterPrivate::reformatBlocks(int from, int charsRemoved, int ch
|
|||||||
}
|
}
|
||||||
|
|
||||||
formatChanges.clear();
|
formatChanges.clear();
|
||||||
|
|
||||||
|
foldValidator.finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyntaxHighlighterPrivate::reformatBlock(const QTextBlock &block, int from, int charsRemoved, int charsAdded)
|
void SyntaxHighlighterPrivate::reformatBlock(const QTextBlock &block, int from, int charsRemoved, int charsAdded)
|
||||||
@@ -220,6 +227,8 @@ void SyntaxHighlighterPrivate::reformatBlock(const QTextBlock &block, int from,
|
|||||||
q->highlightBlock(block.text());
|
q->highlightBlock(block.text());
|
||||||
applyFormatChanges(from, charsRemoved, charsAdded);
|
applyFormatChanges(from, charsRemoved, charsAdded);
|
||||||
|
|
||||||
|
foldValidator.process(currentBlock);
|
||||||
|
|
||||||
currentBlock = QTextBlock();
|
currentBlock = QTextBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -375,6 +384,7 @@ void SyntaxHighlighter::setDocument(QTextDocument *doc)
|
|||||||
this, SLOT(_q_reformatBlocks(int,int,int)));
|
this, SLOT(_q_reformatBlocks(int,int,int)));
|
||||||
d->rehighlightPending = true;
|
d->rehighlightPending = true;
|
||||||
QTimer::singleShot(0, this, SLOT(_q_delayedRehighlight()));
|
QTimer::singleShot(0, this, SLOT(_q_delayedRehighlight()));
|
||||||
|
d->foldValidator.setup(qobject_cast<BaseTextDocumentLayout *>(doc->documentLayout()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,11 +31,8 @@
|
|||||||
-->
|
-->
|
||||||
<externaltool id="lrelease">
|
<externaltool id="lrelease">
|
||||||
<description>Creates qm translation files that can be used by an application from the translator's ts files</description>
|
<description>Creates qm translation files that can be used by an application from the translator's ts files</description>
|
||||||
<description xml:lang="de">Erstellt die von Anwendungen nutzbaren qm-Dateien aus ts-Dateien von Übersetzern</description>
|
|
||||||
<displayname>Release Translations (lrelease)</displayname>
|
<displayname>Release Translations (lrelease)</displayname>
|
||||||
<displayname xml:lang="de">Übersetzungen veröffentlichen (lrelease)</displayname>
|
|
||||||
<category>Linguist</category>
|
<category>Linguist</category>
|
||||||
<category xml:lang="de">Linguist</category>
|
|
||||||
<order>2</order>
|
<order>2</order>
|
||||||
<executable>
|
<executable>
|
||||||
<path>%{CurrentProject:QT_INSTALL_BINS}/lrelease</path>
|
<path>%{CurrentProject:QT_INSTALL_BINS}/lrelease</path>
|
||||||
|
|||||||
@@ -31,11 +31,8 @@
|
|||||||
-->
|
-->
|
||||||
<externaltool id="lupdate">
|
<externaltool id="lupdate">
|
||||||
<description>Synchronizes translator's ts files with the program code</description>
|
<description>Synchronizes translator's ts files with the program code</description>
|
||||||
<description xml:lang="de">Synchronisiert die ts-Übersetzungsdateien mit dem Programmcode</description>
|
|
||||||
<displayname>Update Translations (lupdate)</displayname>
|
<displayname>Update Translations (lupdate)</displayname>
|
||||||
<displayname xml:lang="de">Übersetzungen aktualisieren (lupdate)</displayname>
|
|
||||||
<category>Linguist</category>
|
<category>Linguist</category>
|
||||||
<category xml:lang="de">Linguist</category>
|
|
||||||
<order>1</order>
|
<order>1</order>
|
||||||
<executable>
|
<executable>
|
||||||
<path>%{CurrentProject:QT_INSTALL_BINS}/lupdate</path>
|
<path>%{CurrentProject:QT_INSTALL_BINS}/lupdate</path>
|
||||||
|
|||||||
@@ -31,11 +31,8 @@
|
|||||||
-->
|
-->
|
||||||
<externaltool id="notepad">
|
<externaltool id="notepad">
|
||||||
<description>Opens the current file in Notepad</description>
|
<description>Opens the current file in Notepad</description>
|
||||||
<description xml:lang="de">Öffnet die aktuelle Datei in Notepad</description>
|
|
||||||
<displayname>Edit with Notepad</displayname>
|
<displayname>Edit with Notepad</displayname>
|
||||||
<displayname xml:lang="de">In Notepad öffnen</displayname>
|
|
||||||
<category>Text</category>
|
<category>Text</category>
|
||||||
<category xml:lang="de">Text</category>
|
|
||||||
<executable modifiesdocument="yes">
|
<executable modifiesdocument="yes">
|
||||||
<path>notepad</path>
|
<path>notepad</path>
|
||||||
<arguments>"%{CurrentDocument:FilePath}"</arguments>
|
<arguments>"%{CurrentDocument:FilePath}"</arguments>
|
||||||
|
|||||||
@@ -31,11 +31,8 @@
|
|||||||
-->
|
-->
|
||||||
<externaltool id="sort">
|
<externaltool id="sort">
|
||||||
<description>Sorts the selected text</description>
|
<description>Sorts the selected text</description>
|
||||||
<description xml:lang="de">Sortiert den ausgewählten Text</description>
|
|
||||||
<displayname>Sort Selection</displayname>
|
<displayname>Sort Selection</displayname>
|
||||||
<displayname xml:lang="de">Auswahl Sortieren</displayname>
|
|
||||||
<category>Text</category>
|
<category>Text</category>
|
||||||
<category xml:lang="de">Text</category>
|
|
||||||
<executable output="replaceselection" error="ignore">
|
<executable output="replaceselection" error="ignore">
|
||||||
<path>sort</path>
|
<path>sort</path>
|
||||||
<input>%{CurrentDocument:Selection}</input>
|
<input>%{CurrentDocument:Selection}</input>
|
||||||
|
|||||||
@@ -31,11 +31,8 @@
|
|||||||
-->
|
-->
|
||||||
<externaltool id="vi">
|
<externaltool id="vi">
|
||||||
<description>Opens the current file in vi</description>
|
<description>Opens the current file in vi</description>
|
||||||
<description xml:lang="de">Öffnet die aktuelle Datei in vi</description>
|
|
||||||
<displayname>Edit with vi</displayname>
|
<displayname>Edit with vi</displayname>
|
||||||
<displayname xml:lang="de">In vi öffnen</displayname>
|
|
||||||
<category>Text</category>
|
<category>Text</category>
|
||||||
<category xml:lang="de">Text</category>
|
|
||||||
<executable modifiesdocument="yes">
|
<executable modifiesdocument="yes">
|
||||||
<path>xterm</path>
|
<path>xterm</path>
|
||||||
<arguments>-geom %{CurrentDocument:ColumnCount}x%{CurrentDocument:RowCount}+%{CurrentDocument:XPos}+%{CurrentDocument:YPos} -e vi "%{CurrentDocument:FilePath}" +%{CurrentDocument:Row}</arguments>
|
<arguments>-geom %{CurrentDocument:ColumnCount}x%{CurrentDocument:RowCount}+%{CurrentDocument:XPos}+%{CurrentDocument:YPos} -e vi "%{CurrentDocument:FilePath}" +%{CurrentDocument:Row}</arguments>
|
||||||
|
|||||||
@@ -31,11 +31,8 @@
|
|||||||
-->
|
-->
|
||||||
<externaltool id="vi">
|
<externaltool id="vi">
|
||||||
<description>Opens the current file in vi</description>
|
<description>Opens the current file in vi</description>
|
||||||
<description xml:lang="de">Öffnet die aktuelle Datei in vi</description>
|
|
||||||
<displayname>Edit with vi</displayname>
|
<displayname>Edit with vi</displayname>
|
||||||
<displayname xml:lang="de">In vi öffnen</displayname>
|
|
||||||
<category>Text</category>
|
<category>Text</category>
|
||||||
<category xml:lang="de">Text</category>
|
|
||||||
<executable modifiesdocument="yes">
|
<executable modifiesdocument="yes">
|
||||||
<path>osascript</path>
|
<path>osascript</path>
|
||||||
<input>
|
<input>
|
||||||
|
|||||||
Reference in New Issue
Block a user