forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.2'
Change-Id: I05f76a4f5134c4edd91a79b757bcce9d6e7c258b
This commit is contained in:
21
dist/changes-3.2.0
vendored
21
dist/changes-3.2.0
vendored
@@ -10,9 +10,11 @@ git log --cherry-pick --pretty=oneline origin/3.1..origin/master
|
|||||||
General
|
General
|
||||||
* Added "Get Help Online" context menu item to issues pane that searches for
|
* Added "Get Help Online" context menu item to issues pane that searches for
|
||||||
the issue description online in Google
|
the issue description online in Google
|
||||||
* Enabled resizing of the locator field
|
|
||||||
* Added action to file system locator filter ('f') for creating and opening a new file
|
* Added action to file system locator filter ('f') for creating and opening a new file
|
||||||
|
* Added search capability to general messages and most navigation panes
|
||||||
|
* Enabled resizing of the locator field
|
||||||
* Improved look and feel on HiDPI by adding more hi-resolution icons
|
* Improved look and feel on HiDPI by adding more hi-resolution icons
|
||||||
|
* Made keyboard and mouse activation of navigation panes and other trees more consistent
|
||||||
|
|
||||||
Editing
|
Editing
|
||||||
|
|
||||||
@@ -21,14 +23,21 @@ Managing and Building Projects
|
|||||||
QMake Projects
|
QMake Projects
|
||||||
* Added context menu item for copying resource path from entries in QRC files in project tree
|
* Added context menu item for copying resource path from entries in QRC files in project tree
|
||||||
(QTCREATORBUG-11776)
|
(QTCREATORBUG-11776)
|
||||||
|
* Added deployment support to plain C and C++ application wizards
|
||||||
* Removed warning about build directory below source directory for kits with Qt 5.2 and later
|
* Removed warning about build directory below source directory for kits with Qt 5.2 and later
|
||||||
where this is supported (QTCREATORBUG-10024)
|
where this is supported (QTCREATORBUG-10024)
|
||||||
|
* Fixed that adding files to .pri file was missing $$PWD
|
||||||
|
|
||||||
Qbs Projects
|
Qbs Projects
|
||||||
|
* Fixed that run configurations were created for products that are not runnable
|
||||||
|
(QTCREATORBUG-12152)
|
||||||
|
* Fixed that run configurations were created for disabled products (QBS-560)
|
||||||
|
* Fixed that default build directory was ignored
|
||||||
|
|
||||||
Generic Projects
|
Generic Projects
|
||||||
|
|
||||||
Debugging
|
Debugging
|
||||||
|
* Added option to disable automatic centering on currently debugged line in editor
|
||||||
* GDB and LLDB
|
* GDB and LLDB
|
||||||
* Added pretty printers for AVX512 registers
|
* Added pretty printers for AVX512 registers
|
||||||
|
|
||||||
@@ -39,6 +48,7 @@ C++ Support
|
|||||||
(QTCREATORBUG-11859, QTCREATORBUG-11860)
|
(QTCREATORBUG-11859, QTCREATORBUG-11860)
|
||||||
* Fixed indentation of concatenated strings
|
* Fixed indentation of concatenated strings
|
||||||
* Fixed pointer typedef resolving (QTCREATORBUG-10021)
|
* Fixed pointer typedef resolving (QTCREATORBUG-10021)
|
||||||
|
* Fixed scroll wheel behavior in editor's symbols dropdown
|
||||||
|
|
||||||
QML Support
|
QML Support
|
||||||
|
|
||||||
@@ -49,7 +59,10 @@ Diff Viewer
|
|||||||
Version Control Systems
|
Version Control Systems
|
||||||
|
|
||||||
FakeVim
|
FakeVim
|
||||||
|
* Added support for unicode input with 'C-v' in insert mode
|
||||||
* Fixed issues with long command output (QTCREATORBUG-11598)
|
* Fixed issues with long command output (QTCREATORBUG-11598)
|
||||||
|
* Fixed 'gv' after yanking text in visual mode (QTCREATORBUG-12112)
|
||||||
|
* Fixed 'v', 'V' and 'C-v' while in visual mode (QTCREATORBUG-12113)
|
||||||
|
|
||||||
Platform Specific
|
Platform Specific
|
||||||
|
|
||||||
@@ -60,5 +73,11 @@ Windows
|
|||||||
OS X
|
OS X
|
||||||
* Fixed activation of items with Enter in Bookmarks pane
|
* Fixed activation of items with Enter in Bookmarks pane
|
||||||
|
|
||||||
|
Android
|
||||||
|
* Fixed that UI was unresponsive while creating AVD (QTCREATORBUG-10601)
|
||||||
|
Remote Linux
|
||||||
|
* Added custom remote executable run configuration type (QTCREATORBUG-12168)
|
||||||
|
* Fixed issue with environment variables that contain spaces
|
||||||
|
|
||||||
Credits for these changes go to:
|
Credits for these changes go to:
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
\section1 General Questions
|
\section1 General Questions
|
||||||
|
|
||||||
\b {\QC only shows a blank window, or crashes on startup. What's going wrong?}
|
\b {\QC only shows a blank window, a dialog complaining about missing OpenGL support, or crashes on startup. What's going wrong?}
|
||||||
|
|
||||||
Some parts of \QC use Qt Quick 2, which relies on OpenGL API for
|
Some parts of \QC use Qt Quick 2, which relies on OpenGL API for
|
||||||
drawing. The most prominent use of Qt Quick 2 is in the Welcome mode, but it's
|
drawing. The most prominent use of Qt Quick 2 is in the Welcome mode, but it's
|
||||||
@@ -55,7 +55,9 @@
|
|||||||
|
|
||||||
\e{Virtual Machines}
|
\e{Virtual Machines}
|
||||||
|
|
||||||
Try to enable \e{3D acceleration} in your virtual machine's settings.
|
Try to enable \e{3D acceleration} in your virtual machine's settings. For VirtualBox,
|
||||||
|
also make sure you have installed the Guest Addons, including experimental
|
||||||
|
\e{Direct3D support}.
|
||||||
|
|
||||||
\e{Windows}
|
\e{Windows}
|
||||||
|
|
||||||
@@ -67,7 +69,8 @@
|
|||||||
|
|
||||||
\li ANGLE backend: This requires a Windows version newer than Windows XP. If you
|
\li ANGLE backend: This requires a Windows version newer than Windows XP. If you
|
||||||
have problems, try updating your graphics drivers or update your
|
have problems, try updating your graphics drivers or update your
|
||||||
DirectX version.
|
DirectX version. Run \c dxdiag.exe to check whether \e{Direct3D Acceleration}
|
||||||
|
is indeed enabled.
|
||||||
|
|
||||||
\li OpenGL backend: Make sure your graphics driver supports OpenGL 2.1 or newer.
|
\li OpenGL backend: Make sure your graphics driver supports OpenGL 2.1 or newer.
|
||||||
Try to update your graphics driver.
|
Try to update your graphics driver.
|
||||||
|
11
qbs/imports/QtcProcessOutputReader/procoutputreader.js
Normal file
11
qbs/imports/QtcProcessOutputReader/procoutputreader.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
var Process = loadExtension("qbs.Process")
|
||||||
|
|
||||||
|
function readOutput(executable, args)
|
||||||
|
{
|
||||||
|
var p = new Process();
|
||||||
|
var output = "";
|
||||||
|
if (p.exec(executable, args, false) !== -1)
|
||||||
|
output = p.readStdOut().trim(); // Trailing newline.
|
||||||
|
p.close();
|
||||||
|
return output;
|
||||||
|
}
|
@@ -170,8 +170,8 @@ INCLUDEPATH += \
|
|||||||
$$IDE_SOURCE_TREE/src/libs \
|
$$IDE_SOURCE_TREE/src/libs \
|
||||||
$$IDE_SOURCE_TREE/tools
|
$$IDE_SOURCE_TREE/tools
|
||||||
|
|
||||||
QTC_PLUGIN_DIRS = $$(QTC_PLUGIN_DIRS)
|
QTC_PLUGIN_DIRS_FROM_ENVIRONMENT = $$(QTC_PLUGIN_DIRS)
|
||||||
QTC_PLUGIN_DIRS = $$split(QTC_PLUGIN_DIRS, $$QMAKE_DIRLIST_SEP)
|
QTC_PLUGIN_DIRS += $$split(QTC_PLUGIN_DIRS_FROM_ENVIRONMENT, $$QMAKE_DIRLIST_SEP)
|
||||||
QTC_PLUGIN_DIRS += $$IDE_SOURCE_TREE/src/plugins
|
QTC_PLUGIN_DIRS += $$IDE_SOURCE_TREE/src/plugins
|
||||||
for(dir, QTC_PLUGIN_DIRS) {
|
for(dir, QTC_PLUGIN_DIRS) {
|
||||||
INCLUDEPATH += $$dir
|
INCLUDEPATH += $$dir
|
||||||
|
@@ -1793,10 +1793,8 @@ registerCommand("pp", pp)
|
|||||||
|
|
||||||
# Global instance.
|
# Global instance.
|
||||||
if gdb.parameter('height') is None:
|
if gdb.parameter('height') is None:
|
||||||
print("Using MI")
|
|
||||||
theDumper = Dumper()
|
theDumper = Dumper()
|
||||||
else:
|
else:
|
||||||
print("Using CLI")
|
|
||||||
import codecs
|
import codecs
|
||||||
theDumper = CliDumper()
|
theDumper = CliDumper()
|
||||||
|
|
||||||
|
@@ -683,7 +683,7 @@ class Dumper(DumperBase):
|
|||||||
# and later detects that it did stop after all, so it is be
|
# and later detects that it did stop after all, so it is be
|
||||||
# better to mirror that and wait for the spontaneous stop.
|
# better to mirror that and wait for the spontaneous stop.
|
||||||
self.reportState("enginerunandinferiorrunok")
|
self.reportState("enginerunandinferiorrunok")
|
||||||
elif self.startMode_ == AttachToRemoteServer:
|
elif self.startMode_ == AttachToRemoteServer or self.startMode_ == AttachToRemoteProcess:
|
||||||
self.process = self.target.ConnectRemote(
|
self.process = self.target.ConnectRemote(
|
||||||
self.debugger.GetListener(),
|
self.debugger.GetListener(),
|
||||||
self.remoteChannel_, None, error)
|
self.remoteChannel_, None, error)
|
||||||
|
@@ -467,27 +467,27 @@
|
|||||||
|
|
||||||
</contexts>
|
</contexts>
|
||||||
<itemDatas>
|
<itemDatas>
|
||||||
<itemData name="Normal Text" defStyleNum="dsNormal" />
|
<itemData name="Normal Text" defStyleNum="dsNormal" />
|
||||||
<itemData name="Tags" defStyleNum="dsKeyword" color="#ca60ca" bold="1" italic="0" />
|
<itemData name="Tags" defStyleNum="dsKeyword" />
|
||||||
<itemData name="Custom Tags" defStyleNum="dsNormal" color="#458C61" bold="1" italic="0" />
|
<itemData name="Custom Tags" defStyleNum="dsKeyword" />
|
||||||
<itemData name="Word" defStyleNum="dsKeyword" color="#0095ff" bold="1" italic="0" />
|
<itemData name="Word" defStyleNum="dsIdentifier" />
|
||||||
<itemData name="HTML Tag" defStyleNum="dsKeyword" color="#000000" bold="1" italic="0" />
|
<itemData name="HTML Tag" defStyleNum="dsKeyword" />
|
||||||
<itemData name="Entities" defStyleNum="dsOthers" color="#4086C0" bold="1" italic="1" />
|
<itemData name="Entities" defStyleNum="dsOthers" />
|
||||||
<itemData name="Description" defStyleNum="dsString" color="#ff0000" />
|
<itemData name="Description" defStyleNum="dsString" />
|
||||||
<itemData name="Comment" defStyleNum="dsComment" />
|
<itemData name="Comment" defStyleNum="dsComment" />
|
||||||
<itemData name="Region" defStyleNum="dsRegionMarker" />
|
<itemData name="Region" defStyleNum="dsRegionMarker" />
|
||||||
<itemData name="Identifier" defStyleNum="dsOthers" />
|
<itemData name="Identifier" defStyleNum="dsIdentifier" />
|
||||||
<itemData name="HTML Comment" defStyleNum="dsComment" />
|
<itemData name="HTML Comment" defStyleNum="dsComment" />
|
||||||
<itemData name="Types" defStyleNum="dsDataType" />
|
<itemData name="Types" defStyleNum="dsDataType" />
|
||||||
<itemData name="Code" defStyleNum="dsComment" />
|
<itemData name="Code" defStyleNum="dsComment" />
|
||||||
<itemData name="Dot Graph" defStyleNum="dsComment" color="#00A000" selColor="#ffffff" italic="1" />
|
<itemData name="Dot Graph" defStyleNum="dsComment" />
|
||||||
<itemData name="Formulas" defStyleNum="dsComment" color="#00A000" selColor="#ffffff" italic="1" />
|
<itemData name="Formulas" defStyleNum="dsComment" />
|
||||||
<itemData name="Message Sequence Chart" defStyleNum="dsComment" color="#00A000" selColor="#ffffff" italic="1" />
|
<itemData name="Message Sequence Chart" defStyleNum="dsComment" />
|
||||||
<itemData name="Verbatim" defStyleNum="dsComment" />
|
<itemData name="Verbatim" defStyleNum="dsComment" />
|
||||||
<itemData name="Note" defStyleNum="dsKeyword" color="#81ca2d" selColor="#81ca2d" bold="1" italic="0" />
|
<itemData name="Note" defStyleNum="dsKeyword" />
|
||||||
<itemData name="Warning" defStyleNum="dsKeyword" color="#ca9219" selColor="#ca9219" bold="1" italic="0" />
|
<itemData name="Warning" defStyleNum="dsKeyword" />
|
||||||
<itemData name="Attention" defStyleNum="dsKeyword" color="#e85848" selColor="#e85848" bold="1" italic="0" />
|
<itemData name="Attention" defStyleNum="dsKeyword" />
|
||||||
<itemData name="Todo" defStyleNum="dsKeyword" color="#ca60ca" selColor="#ffffff" bold="1" italic="0" />
|
<itemData name="Todo" defStyleNum="dsKeyword" />
|
||||||
</itemDatas>
|
</itemDatas>
|
||||||
</highlighting>
|
</highlighting>
|
||||||
<general>
|
<general>
|
||||||
|
@@ -503,7 +503,7 @@ void QuickItemNodeInstance::resetVertical()
|
|||||||
if (m_height > 0.0) {
|
if (m_height > 0.0) {
|
||||||
setPropertyVariant("height", m_height);
|
setPropertyVariant("height", m_height);
|
||||||
} else {
|
} else {
|
||||||
setPropertyVariant("height", quickItem()->implicitWidth());
|
setPropertyVariant("height", quickItem()->implicitHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -184,7 +184,7 @@ void QmlGraphicsItemNodeInstance::resetVertical()
|
|||||||
if (m_height > 0.0) {
|
if (m_height > 0.0) {
|
||||||
setPropertyVariant("height", m_height);
|
setPropertyVariant("height", m_height);
|
||||||
} else {
|
} else {
|
||||||
setPropertyVariant("height", qmlGraphicsItem()->implicitWidth());
|
setPropertyVariant("height", qmlGraphicsItem()->implicitHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -78,7 +78,7 @@ Rectangle {
|
|||||||
property int pressedY
|
property int pressedY
|
||||||
|
|
||||||
onPressed: {
|
onPressed: {
|
||||||
rootView.startDragAndDropDelayed(itemLibraryEntry)
|
rootView.startDragAndDrop(itemLibraryEntry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -36,6 +36,7 @@
|
|||||||
#include <extensionsystem/pluginspec.h>
|
#include <extensionsystem/pluginspec.h>
|
||||||
#include <qtsingleapplication.h>
|
#include <qtsingleapplication.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/logging.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -286,6 +287,7 @@ static inline QSettings *userSettings()
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
QLoggingCategory::setFilterRules(QLatin1String("qtc.*.debug=false"));
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
// increase the number of file that can be opened in Qt Creator.
|
// increase the number of file that can be opened in Qt Creator.
|
||||||
struct rlimit rl;
|
struct rlimit rl;
|
||||||
|
@@ -33,8 +33,6 @@
|
|||||||
#include "qmljsdocument.h"
|
#include "qmljsdocument.h"
|
||||||
#include "qmljsmodelmanagerinterface.h"
|
#include "qmljsmodelmanagerinterface.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
using namespace LanguageUtils;
|
using namespace LanguageUtils;
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
using namespace QmlJS::AST;
|
using namespace QmlJS::AST;
|
||||||
|
@@ -35,7 +35,6 @@
|
|||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
|
@@ -29,12 +29,15 @@
|
|||||||
|
|
||||||
#include "qmljscodeformatter.h"
|
#include "qmljscodeformatter.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <utils/logging.h>
|
||||||
|
|
||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
|
|
||||||
using namespace QmlJS;
|
namespace QmlJS {
|
||||||
|
|
||||||
|
Q_LOGGING_CATEGORY(formatterLog, "qtc.qmljs.formatter")
|
||||||
|
|
||||||
CodeFormatter::BlockData::BlockData()
|
CodeFormatter::BlockData::BlockData()
|
||||||
: m_indentDepth(0)
|
: m_indentDepth(0)
|
||||||
@@ -65,13 +68,13 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
|
|||||||
m_tokenIndex = 0;
|
m_tokenIndex = 0;
|
||||||
m_newStates.clear();
|
m_newStates.clear();
|
||||||
|
|
||||||
//qDebug() << "Starting to look at " << block.text() << block.blockNumber() + 1;
|
//qCDebug(formatterLog) << "Starting to look at " << block.text() << block.blockNumber() + 1;
|
||||||
|
|
||||||
for (; m_tokenIndex < m_tokens.size(); ) {
|
for (; m_tokenIndex < m_tokens.size(); ) {
|
||||||
m_currentToken = tokenAt(m_tokenIndex);
|
m_currentToken = tokenAt(m_tokenIndex);
|
||||||
const int kind = extendedTokenKind(m_currentToken);
|
const int kind = extendedTokenKind(m_currentToken);
|
||||||
|
|
||||||
//qDebug() << "Token" << m_currentLine.mid(m_currentToken.begin(), m_currentToken.length) << m_tokenIndex << "in line" << block.blockNumber() + 1;
|
//qCDebug(formatterLog) << "Token" << m_currentLine.mid(m_currentToken.begin(), m_currentToken.length) << m_tokenIndex << "in line" << block.blockNumber() + 1;
|
||||||
//dump();
|
//dump();
|
||||||
|
|
||||||
if (kind == Comment
|
if (kind == Comment
|
||||||
@@ -520,7 +523,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
|
|||||||
|
|
||||||
int CodeFormatter::indentFor(const QTextBlock &block)
|
int CodeFormatter::indentFor(const QTextBlock &block)
|
||||||
{
|
{
|
||||||
// qDebug() << "indenting for" << block.blockNumber() + 1;
|
// qCDebug(formatterLog) << "indenting for" << block.blockNumber() + 1;
|
||||||
|
|
||||||
restoreCurrentState(block.previous());
|
restoreCurrentState(block.previous());
|
||||||
correctIndentation(block);
|
correctIndentation(block);
|
||||||
@@ -641,7 +644,7 @@ void CodeFormatter::enter(int newState)
|
|||||||
m_currentState.push(s);
|
m_currentState.push(s);
|
||||||
m_newStates.push(s);
|
m_newStates.push(s);
|
||||||
|
|
||||||
//qDebug() << "enter state" << stateToString(newState);
|
//qCDebug(formatterLog) << "enter state" << stateToString(newState);
|
||||||
|
|
||||||
if (newState == bracket_open)
|
if (newState == bracket_open)
|
||||||
enter(bracket_element_start);
|
enter(bracket_element_start);
|
||||||
@@ -662,7 +665,7 @@ void CodeFormatter::leave(bool statementDone)
|
|||||||
|
|
||||||
int topState = m_currentState.top().type;
|
int topState = m_currentState.top().type;
|
||||||
|
|
||||||
//qDebug() << "left state" << stateToString(poppedState.type) << ", now in state" << stateToString(topState);
|
//qCDebug(formatterLog) << "left state" << stateToString(poppedState.type) << ", now in state" << stateToString(topState);
|
||||||
|
|
||||||
// if statement is done, may need to leave recursively
|
// if statement is done, may need to leave recursively
|
||||||
if (statementDone) {
|
if (statementDone) {
|
||||||
@@ -1003,12 +1006,12 @@ CodeFormatter::TokenKind CodeFormatter::extendedTokenKind(const QmlJS::Token &to
|
|||||||
|
|
||||||
void CodeFormatter::dump() const
|
void CodeFormatter::dump() const
|
||||||
{
|
{
|
||||||
qDebug() << "Current token index" << m_tokenIndex;
|
qCDebug(formatterLog) << "Current token index" << m_tokenIndex;
|
||||||
qDebug() << "Current state:";
|
qCDebug(formatterLog) << "Current state:";
|
||||||
foreach (const State &s, m_currentState) {
|
foreach (const State &s, m_currentState) {
|
||||||
qDebug() << stateToString(s.type) << s.savedIndentDepth;
|
qCDebug(formatterLog) << stateToString(s.type) << s.savedIndentDepth;
|
||||||
}
|
}
|
||||||
qDebug() << "Current indent depth:" << m_indentDepth;
|
qCDebug(formatterLog) << "Current indent depth:" << m_indentDepth;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CodeFormatter::stateToString(int type) const
|
QString CodeFormatter::stateToString(int type) const
|
||||||
@@ -1339,3 +1342,5 @@ void QtStyleCodeFormatter::adjustIndent(const QList<Token> &tokens, int startLex
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace QmlJS
|
||||||
|
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include "qmljscompletioncontextfinder.h"
|
#include "qmljscompletioncontextfinder.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
@@ -130,7 +129,7 @@ void CompletionContextFinder::checkBinding()
|
|||||||
{
|
{
|
||||||
YY_SAVE();
|
YY_SAVE();
|
||||||
|
|
||||||
//qDebug() << "Start line:" << *yyLine << m_startTokenIndex;
|
//qCDebug(qmljsLog) << "Start line:" << *yyLine << m_startTokenIndex;
|
||||||
|
|
||||||
int i = m_startTokenIndex;
|
int i = m_startTokenIndex;
|
||||||
int colonCount = 0;
|
int colonCount = 0;
|
||||||
|
@@ -29,6 +29,9 @@
|
|||||||
|
|
||||||
#ifndef QMLJSCONSTANTS_H
|
#ifndef QMLJSCONSTANTS_H
|
||||||
#define QMLJSCONSTANTS_H
|
#define QMLJSCONSTANTS_H
|
||||||
|
#include "qmljs_global.h"
|
||||||
|
|
||||||
|
#include <utils/logging.h>
|
||||||
|
|
||||||
namespace QmlJS {
|
namespace QmlJS {
|
||||||
|
|
||||||
@@ -68,7 +71,7 @@ enum Enum
|
|||||||
namespace Language {
|
namespace Language {
|
||||||
enum Enum
|
enum Enum
|
||||||
{
|
{
|
||||||
Unknown = 0,
|
NoLanguage = 0,
|
||||||
JavaScript = 1,
|
JavaScript = 1,
|
||||||
Json = 2,
|
Json = 2,
|
||||||
Qml = 3,
|
Qml = 3,
|
||||||
@@ -76,7 +79,8 @@ enum Enum
|
|||||||
QmlQtQuick2 = 5,
|
QmlQtQuick2 = 5,
|
||||||
QmlQbs = 6,
|
QmlQbs = 6,
|
||||||
QmlProject = 7,
|
QmlProject = 7,
|
||||||
QmlTypeInfo = 8
|
QmlTypeInfo = 8,
|
||||||
|
AnyLanguage = 9,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,5 +90,8 @@ const char TASK_INDEX[] = "QmlJSEditor.TaskIndex";
|
|||||||
const char TASK_IMPORT_SCAN[] = "QmlJSEditor.TaskImportScan";
|
const char TASK_IMPORT_SCAN[] = "QmlJSEditor.TaskImportScan";
|
||||||
|
|
||||||
} // namespace Constants
|
} // namespace Constants
|
||||||
|
|
||||||
|
QMLJS_EXPORT Q_DECLARE_LOGGING_CATEGORY(qmljsLog)
|
||||||
|
|
||||||
} // namespace QmlJS
|
} // namespace QmlJS
|
||||||
#endif // QMLJSCONSTANTS_H
|
#endif // QMLJSCONSTANTS_H
|
||||||
|
@@ -97,6 +97,7 @@ bool Document::isQmlLikeLanguage(Language::Enum language)
|
|||||||
case Language::QmlQbs:
|
case Language::QmlQbs:
|
||||||
case Language::QmlProject:
|
case Language::QmlProject:
|
||||||
case Language::QmlTypeInfo:
|
case Language::QmlTypeInfo:
|
||||||
|
case Language::AnyLanguage:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -112,7 +113,8 @@ bool Document::isFullySupportedLanguage(Language::Enum language)
|
|||||||
case Language::QmlQtQuick1:
|
case Language::QmlQtQuick1:
|
||||||
case Language::QmlQtQuick2:
|
case Language::QmlQtQuick2:
|
||||||
return true;
|
return true;
|
||||||
case Language::Unknown:
|
case Language::NoLanguage:
|
||||||
|
case Language::AnyLanguage:
|
||||||
case Language::QmlQbs:
|
case Language::QmlQbs:
|
||||||
case Language::QmlProject:
|
case Language::QmlProject:
|
||||||
case Language::QmlTypeInfo:
|
case Language::QmlTypeInfo:
|
||||||
@@ -131,6 +133,7 @@ bool Document::isQmlLikeOrJsLanguage(Language::Enum language)
|
|||||||
case Language::QmlProject:
|
case Language::QmlProject:
|
||||||
case Language::QmlTypeInfo:
|
case Language::QmlTypeInfo:
|
||||||
case Language::JavaScript:
|
case Language::JavaScript:
|
||||||
|
case Language::AnyLanguage:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -157,12 +160,16 @@ QList<Language::Enum> Document::companionLanguages(Language::Enum language)
|
|||||||
case Language::QmlQtQuick2:
|
case Language::QmlQtQuick2:
|
||||||
langs << Language::Qml << Language::JavaScript;
|
langs << Language::Qml << Language::JavaScript;
|
||||||
break;
|
break;
|
||||||
case Language::Unknown:
|
case Language::AnyLanguage:
|
||||||
langs << Language::JavaScript << Language::Json << Language::QmlProject << Language:: QmlQbs
|
langs << Language::JavaScript << Language::Json << Language::QmlProject << Language:: QmlQbs
|
||||||
<< Language::QmlTypeInfo << Language::QmlQtQuick1 << Language::QmlQtQuick2
|
<< Language::QmlTypeInfo << Language::QmlQtQuick1 << Language::QmlQtQuick2
|
||||||
<< Language::Qml;
|
<< Language::Qml;
|
||||||
break;
|
break;
|
||||||
|
case Language::NoLanguage:
|
||||||
|
return QList<Language::Enum>(); // return at least itself?
|
||||||
}
|
}
|
||||||
|
if (language != Language::AnyLanguage)
|
||||||
|
langs << Language::AnyLanguage;
|
||||||
return langs;
|
return langs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -531,7 +538,7 @@ void Snapshot::insertLibraryInfo(const QString &path, const LibraryInfo &info)
|
|||||||
if (!info.wasFound()) return;
|
if (!info.wasFound()) return;
|
||||||
CoreImport cImport;
|
CoreImport cImport;
|
||||||
cImport.importId = path;
|
cImport.importId = path;
|
||||||
cImport.language = Language::Unknown;
|
cImport.language = Language::AnyLanguage;
|
||||||
QSet<ImportKey> packages;
|
QSet<ImportKey> packages;
|
||||||
foreach (const ModuleApiInfo &moduleInfo, info.moduleApis()) {
|
foreach (const ModuleApiInfo &moduleInfo, info.moduleApis()) {
|
||||||
ImportKey iKey(ImportType::Library, moduleInfo.uri, moduleInfo.version.majorVersion(),
|
ImportKey iKey(ImportType::Library, moduleInfo.uri, moduleInfo.version.majorVersion(),
|
||||||
|
@@ -31,7 +31,6 @@
|
|||||||
#include "qmljscontext.h"
|
#include "qmljscontext.h"
|
||||||
#include "qmljsscopechain.h"
|
#include "qmljsscopechain.h"
|
||||||
#include "parser/qmljsast_p.h"
|
#include "parser/qmljsast_p.h"
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
|
|
||||||
|
@@ -36,7 +36,6 @@
|
|||||||
#include <cplusplus/cppmodelmanagerbase.h>
|
#include <cplusplus/cppmodelmanagerbase.h>
|
||||||
#include <cplusplus/CppDocument.h>
|
#include <cplusplus/CppDocument.h>
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
//using namespace QmlJS;
|
//using namespace QmlJS;
|
||||||
|
@@ -28,8 +28,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qmljsicons.h"
|
#include "qmljsicons.h"
|
||||||
|
|
||||||
|
#include <utils/logging.h>
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QPair>
|
#include <QPair>
|
||||||
@@ -43,6 +45,8 @@ enum {
|
|||||||
|
|
||||||
namespace QmlJS {
|
namespace QmlJS {
|
||||||
|
|
||||||
|
Q_LOGGING_CATEGORY(iconsLog, "qtc.qmljs.icons")
|
||||||
|
|
||||||
Icons *Icons::m_instance = 0;
|
Icons *Icons::m_instance = 0;
|
||||||
|
|
||||||
class IconsPrivate
|
class IconsPrivate
|
||||||
@@ -88,22 +92,22 @@ void Icons::setIconFilesPath(const QString &iconPath)
|
|||||||
d->resourcePath = iconPath;
|
d->resourcePath = iconPath;
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "QmlJSIcons -" << "parsing" << iconPath;
|
qCDebug(iconsLog) << "parsing" << iconPath;
|
||||||
QDir topDir(iconPath);
|
QDir topDir(iconPath);
|
||||||
foreach (const QFileInfo &subDirInfo, topDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
|
foreach (const QFileInfo &subDirInfo, topDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "QmlJSIcons - parsing" << subDirInfo.absoluteFilePath();
|
qCDebug(iconsLog) << "parsing" << subDirInfo.absoluteFilePath();
|
||||||
const QString packageName = subDirInfo.fileName();
|
const QString packageName = subDirInfo.fileName();
|
||||||
QDir subDir(subDirInfo.absoluteFilePath() + QLatin1String("/16x16"));
|
QDir subDir(subDirInfo.absoluteFilePath() + QLatin1String("/16x16"));
|
||||||
foreach (const QFileInfo &iconFile, subDir.entryInfoList(QDir::Files)) {
|
foreach (const QFileInfo &iconFile, subDir.entryInfoList(QDir::Files)) {
|
||||||
QIcon icon(iconFile.absoluteFilePath());
|
QIcon icon(iconFile.absoluteFilePath());
|
||||||
if (icon.isNull()) {
|
if (icon.isNull()) {
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "QmlJSIcons - skipping" << iconFile.absoluteFilePath();
|
qCDebug(iconsLog) << "skipping" << iconFile.absoluteFilePath();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "QmlJSIcons - adding" << packageName << iconFile.baseName() << "icon to database";
|
qCDebug(iconsLog) << "adding" << packageName << iconFile.baseName() << "icon to database";
|
||||||
QPair<QString,QString> element(packageName, iconFile.baseName());
|
QPair<QString,QString> element(packageName, iconFile.baseName());
|
||||||
d->iconHash.insert(element, icon);
|
d->iconHash.insert(element, icon);
|
||||||
}
|
}
|
||||||
@@ -114,7 +118,7 @@ QIcon Icons::icon(const QString &packageName, const QString typeName) const
|
|||||||
{
|
{
|
||||||
QPair<QString,QString> element(packageName, typeName);
|
QPair<QString,QString> element(packageName, typeName);
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "QmlJSIcons - icon for" << packageName << typeName << "requested" << d->iconHash.contains(element);
|
qCDebug(iconsLog) << "icon for" << packageName << typeName << "requested" << d->iconHash.contains(element);
|
||||||
return d->iconHash.value(element);
|
return d->iconHash.value(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include "qmljsqrcparser.h"
|
#include "qmljsqrcparser.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/logging.h>
|
||||||
|
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@
|
|||||||
|
|
||||||
namespace QmlJS {
|
namespace QmlJS {
|
||||||
|
|
||||||
static bool debugImportDependencies = false;
|
Q_LOGGING_CATEGORY(importsLog, "qtc.qmljs.imports")
|
||||||
|
|
||||||
ImportKind::Enum toImportKind(ImportType::Enum type)
|
ImportKind::Enum toImportKind(ImportType::Enum type)
|
||||||
{
|
{
|
||||||
@@ -728,18 +729,18 @@ void ImportDependencies::addCoreImport(const CoreImport &import)
|
|||||||
foreach (const Export &e, import.possibleExports)
|
foreach (const Export &e, import.possibleExports)
|
||||||
m_importCache[e.exportName].append(import.importId);
|
m_importCache[e.exportName].append(import.importId);
|
||||||
m_coreImports.insert(newImport.importId, newImport);
|
m_coreImports.insert(newImport.importId, newImport);
|
||||||
if (debugImportDependencies) {
|
if (importsLog().isDebugEnabled()) {
|
||||||
QDebug dbg(qDebug());
|
QString msg = QString::fromLatin1("added import %1 for").arg(newImport.importId);
|
||||||
dbg << "added import "<< newImport.importId << " for";
|
|
||||||
foreach (const Export &e, newImport.possibleExports)
|
foreach (const Export &e, newImport.possibleExports)
|
||||||
dbg << " " << e.exportName.toString() << "(" << e.pathRequired << ")";
|
msg += QString::fromLatin1("\n %1(%2)").arg(e.exportName.toString(), e.pathRequired);
|
||||||
|
qCDebug(importsLog) << msg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportDependencies::removeCoreImport(const QString &importId)
|
void ImportDependencies::removeCoreImport(const QString &importId)
|
||||||
{
|
{
|
||||||
if (!m_coreImports.contains(importId)) {
|
if (!m_coreImports.contains(importId)) {
|
||||||
qDebug() << "missing importId in removeCoreImport(" << importId << ")";
|
qCWarning(importsLog) << "missing importId in removeCoreImport(" << importId << ")";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CoreImport &cImport = m_coreImports[importId];
|
CoreImport &cImport = m_coreImports[importId];
|
||||||
@@ -754,16 +755,15 @@ void ImportDependencies::removeCoreImport(const QString &importId)
|
|||||||
else
|
else
|
||||||
m_coreImports.remove(importId);
|
m_coreImports.remove(importId);
|
||||||
|
|
||||||
if (debugImportDependencies)
|
qCDebug(importsLog) << "removed import with id:"<< importId;
|
||||||
qDebug() << "removed import with id:"<< importId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportDependencies::removeImportCacheEntry(const ImportKey &importKey, const QString &importId)
|
void ImportDependencies::removeImportCacheEntry(const ImportKey &importKey, const QString &importId)
|
||||||
{
|
{
|
||||||
QStringList &cImp = m_importCache[importKey];
|
QStringList &cImp = m_importCache[importKey];
|
||||||
if (!cImp.removeOne(importId)) {
|
if (!cImp.removeOne(importId)) {
|
||||||
qDebug() << "missing possibleExport backpointer for " << importKey.toString() << " to "
|
qCWarning(importsLog) << "missing possibleExport backpointer for " << importKey.toString() << " to "
|
||||||
<< importId;
|
<< importId;
|
||||||
}
|
}
|
||||||
if (cImp.isEmpty())
|
if (cImp.isEmpty())
|
||||||
m_importCache.remove(importKey);
|
m_importCache.remove(importKey);
|
||||||
@@ -774,7 +774,7 @@ void ImportDependencies::addExport(const QString &importId, const ImportKey &imp
|
|||||||
{
|
{
|
||||||
if (!m_coreImports.contains(importId)) {
|
if (!m_coreImports.contains(importId)) {
|
||||||
CoreImport newImport(importId);
|
CoreImport newImport(importId);
|
||||||
newImport.language = Language::Unknown;
|
newImport.language = Language::AnyLanguage;
|
||||||
newImport.possibleExports.append(Export(importKey, requiredPath, false));
|
newImport.possibleExports.append(Export(importKey, requiredPath, false));
|
||||||
m_coreImports.insert(newImport.importId, newImport);
|
m_coreImports.insert(newImport.importId, newImport);
|
||||||
m_importCache[importKey].append(importId);
|
m_importCache[importKey].append(importId);
|
||||||
@@ -783,35 +783,33 @@ void ImportDependencies::addExport(const QString &importId, const ImportKey &imp
|
|||||||
CoreImport &importValue = m_coreImports[importId];
|
CoreImport &importValue = m_coreImports[importId];
|
||||||
importValue.possibleExports.append(Export(importKey, requiredPath, false));
|
importValue.possibleExports.append(Export(importKey, requiredPath, false));
|
||||||
m_importCache[importKey].append(importId);
|
m_importCache[importKey].append(importId);
|
||||||
if (debugImportDependencies)
|
qCDebug(importsLog) << "added export "<< importKey.toString() << " for id " <<importId
|
||||||
qDebug() << "added export "<< importKey.toString() << " for id " <<importId
|
<< " (" << requiredPath << ")";
|
||||||
<< " (" << requiredPath << ")";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportDependencies::removeExport(const QString &importId, const ImportKey &importKey,
|
void ImportDependencies::removeExport(const QString &importId, const ImportKey &importKey,
|
||||||
const QString &requiredPath)
|
const QString &requiredPath)
|
||||||
{
|
{
|
||||||
if (!m_coreImports.contains(importId)) {
|
if (!m_coreImports.contains(importId)) {
|
||||||
qDebug() << "non existing core import for removeExport(" << importId << ", "
|
qCWarning(importsLog) << "non existing core import for removeExport(" << importId << ", "
|
||||||
<< importKey.toString() << ")";
|
<< importKey.toString() << ")";
|
||||||
} else {
|
} else {
|
||||||
CoreImport &importValue = m_coreImports[importId];
|
CoreImport &importValue = m_coreImports[importId];
|
||||||
if (!importValue.possibleExports.removeOne(Export(importKey, requiredPath, false))) {
|
if (!importValue.possibleExports.removeOne(Export(importKey, requiredPath, false))) {
|
||||||
qDebug() << "non existing export for removeExport(" << importId << ", "
|
qCWarning(importsLog) << "non existing export for removeExport(" << importId << ", "
|
||||||
<< importKey.toString() << ")";
|
<< importKey.toString() << ")";
|
||||||
}
|
}
|
||||||
if (importValue.possibleExports.isEmpty() && importValue.fingerprint.isEmpty())
|
if (importValue.possibleExports.isEmpty() && importValue.fingerprint.isEmpty())
|
||||||
m_coreImports.remove(importId);
|
m_coreImports.remove(importId);
|
||||||
}
|
}
|
||||||
if (!m_importCache.contains(importKey)) {
|
if (!m_importCache.contains(importKey)) {
|
||||||
qDebug() << "missing possibleExport for " << importKey.toString() << " when removing export of "
|
qCWarning(importsLog) << "missing possibleExport for " << importKey.toString()
|
||||||
<< importId;
|
<< " when removing export of " << importId;
|
||||||
} else {
|
} else {
|
||||||
removeImportCacheEntry(importKey, importId);
|
removeImportCacheEntry(importKey, importId);
|
||||||
}
|
}
|
||||||
if (debugImportDependencies)
|
qCDebug(importsLog) << "removed export "<< importKey.toString() << " for id " << importId
|
||||||
qDebug() << "removed export "<< importKey.toString() << " for id " << importId
|
<< " (" << requiredPath << ")";
|
||||||
<< " (" << requiredPath << ")";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportDependencies::iterateOnCoreImports(
|
void ImportDependencies::iterateOnCoreImports(
|
||||||
@@ -838,8 +836,7 @@ void ImportDependencies::iterateOnLibraryImports(
|
|||||||
iter_t i = m_importCache.lowerBound(firstLib);
|
iter_t i = m_importCache.lowerBound(firstLib);
|
||||||
iter_t end = m_importCache.constEnd();
|
iter_t end = m_importCache.constEnd();
|
||||||
while (i != end && i.key().type == ImportType::Library) {
|
while (i != end && i.key().type == ImportType::Library) {
|
||||||
if (debugImportDependencies)
|
qCDebug(importsLog) << "libloop:" << i.key().toString() << i.value();
|
||||||
qDebug() << "libloop:" << i.key().toString() << i.value();
|
|
||||||
foreach (const QString &cImportName, i.value()) {
|
foreach (const QString &cImportName, i.value()) {
|
||||||
CoreImport cImport = coreImport(cImportName);
|
CoreImport cImport = coreImport(cImportName);
|
||||||
if (vContext.languageIsCompatible(cImport.language)) {
|
if (vContext.languageIsCompatible(cImport.language)) {
|
||||||
@@ -847,9 +844,8 @@ void ImportDependencies::iterateOnLibraryImports(
|
|||||||
if (e.visibleInVContext(vContext) && e.exportName.type == ImportType::Library) {
|
if (e.visibleInVContext(vContext) && e.exportName.type == ImportType::Library) {
|
||||||
ImportMatchStrength m = e.exportName.matchImport(i.key(), vContext);
|
ImportMatchStrength m = e.exportName.matchImport(i.key(), vContext);
|
||||||
if (m.hasMatch()) {
|
if (m.hasMatch()) {
|
||||||
if (debugImportDependencies)
|
qCDebug(importsLog) << "import iterate:" << e.exportName.toString()
|
||||||
qDebug() << "import iterate:" << e.exportName.toString()
|
<< " (" << e.pathRequired << "), id:" << cImport.importId;
|
||||||
<< " (" << e.pathRequired << "), id:" << cImport.importId;
|
|
||||||
if (!iterF(m, e, cImport))
|
if (!iterF(m, e, cImport))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -945,16 +941,16 @@ void ImportDependencies::checkConsistency() const
|
|||||||
i.next();
|
i.next();
|
||||||
foreach (const Export &e, i.value().possibleExports) {
|
foreach (const Export &e, i.value().possibleExports) {
|
||||||
if (!m_importCache.value(e.exportName).contains(i.key())) {
|
if (!m_importCache.value(e.exportName).contains(i.key())) {
|
||||||
qDebug() << e.exportName.toString();
|
qCWarning(importsLog) << e.exportName.toString();
|
||||||
qDebug() << i.key();
|
qCWarning(importsLog) << i.key();
|
||||||
|
|
||||||
QMapIterator<ImportKey, QStringList> j(m_importCache);
|
QMapIterator<ImportKey, QStringList> j(m_importCache);
|
||||||
while (j.hasNext()) {
|
while (j.hasNext()) {
|
||||||
j.next();
|
j.next();
|
||||||
qDebug() << j.key().toString() << j.value();
|
qCWarning(importsLog) << j.key().toString() << j.value();
|
||||||
}
|
}
|
||||||
qDebug() << m_importCache.contains(e.exportName);
|
qCWarning(importsLog) << m_importCache.contains(e.exportName);
|
||||||
qDebug() << m_importCache.value(e.exportName);
|
qCWarning(importsLog) << m_importCache.value(e.exportName);
|
||||||
}
|
}
|
||||||
Q_ASSERT(m_importCache.value(e.exportName).contains(i.key()));
|
Q_ASSERT(m_importCache.value(e.exportName).contains(i.key()));
|
||||||
}
|
}
|
||||||
|
@@ -67,7 +67,6 @@
|
|||||||
|
|
||||||
#include <qmljs/qmljsindenter.h>
|
#include <qmljs/qmljsindenter.h>
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
|
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "parser/qmljsast_p.h"
|
#include "parser/qmljsast_p.h"
|
||||||
|
#include "qmljsconstants.h"
|
||||||
#include "qmljscontext.h"
|
#include "qmljscontext.h"
|
||||||
#include "qmljsevaluate.h"
|
#include "qmljsevaluate.h"
|
||||||
#include "qmljsinterpreter.h"
|
#include "qmljsinterpreter.h"
|
||||||
@@ -41,7 +42,6 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
@@ -2492,38 +2492,38 @@ public:
|
|||||||
|
|
||||||
virtual bool processProperty(const QString &name, const Value *)
|
virtual bool processProperty(const QString &name, const Value *)
|
||||||
{
|
{
|
||||||
qDebug() << "property: " << name;
|
qCDebug(qmljsLog) << "property: " << name;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool processEnumerator(const QString &name, const Value *)
|
virtual bool processEnumerator(const QString &name, const Value *)
|
||||||
{
|
{
|
||||||
qDebug() << "enumerator: " << name;
|
qCDebug(qmljsLog) << "enumerator: " << name;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool processSignal(const QString &name, const Value *)
|
virtual bool processSignal(const QString &name, const Value *)
|
||||||
{
|
{
|
||||||
qDebug() << "signal: " << name;
|
qCDebug(qmljsLog) << "signal: " << name;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool processSlot(const QString &name, const Value *)
|
virtual bool processSlot(const QString &name, const Value *)
|
||||||
{
|
{
|
||||||
qDebug() << "slot: " << name;
|
qCDebug(qmljsLog) << "slot: " << name;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool processGeneratedSlot(const QString &name, const Value *)
|
virtual bool processGeneratedSlot(const QString &name, const Value *)
|
||||||
{
|
{
|
||||||
qDebug() << "generated slot: " << name;
|
qCDebug(qmljsLog) << "generated slot: " << name;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void Imports::dump() const
|
void Imports::dump() const
|
||||||
{
|
{
|
||||||
qDebug() << "Imports contents, in search order:";
|
qCDebug(qmljsLog) << "Imports contents, in search order:";
|
||||||
QListIterator<Import> it(m_imports);
|
QListIterator<Import> it(m_imports);
|
||||||
it.toBack();
|
it.toBack();
|
||||||
while (it.hasPrevious()) {
|
while (it.hasPrevious()) {
|
||||||
@@ -2531,7 +2531,7 @@ void Imports::dump() const
|
|||||||
const ObjectValue *import = i.object;
|
const ObjectValue *import = i.object;
|
||||||
const ImportInfo &info = i.info;
|
const ImportInfo &info = i.info;
|
||||||
|
|
||||||
qDebug() << " " << info.path() << " " << info.version().toString() << " as " << info.as() << " : " << import;
|
qCDebug(qmljsLog) << " " << info.path() << " " << info.version().toString() << " as " << info.as() << " : " << import;
|
||||||
MemberDumper dumper;
|
MemberDumper dumper;
|
||||||
import->processMembers(&dumper);
|
import->processMembers(&dumper);
|
||||||
}
|
}
|
||||||
|
@@ -67,8 +67,6 @@
|
|||||||
|
|
||||||
#include <qmljs/qmljslineinfo.h>
|
#include <qmljs/qmljslineinfo.h>
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -38,7 +38,6 @@
|
|||||||
#include "qmljsconstants.h"
|
#include "qmljsconstants.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
using namespace LanguageUtils;
|
using namespace LanguageUtils;
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
|
@@ -39,7 +39,6 @@
|
|||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/runextensions.h>
|
#include <utils/runextensions.h>
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
@@ -55,6 +54,8 @@
|
|||||||
|
|
||||||
namespace QmlJS {
|
namespace QmlJS {
|
||||||
|
|
||||||
|
QMLJS_EXPORT Q_LOGGING_CATEGORY(qmljsLog, "qtc.qmljs.common")
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QmlJS::ModelManagerInterface
|
\class QmlJS::ModelManagerInterface
|
||||||
\brief The ModelManagerInterface class acts as an interface to the
|
\brief The ModelManagerInterface class acts as an interface to the
|
||||||
@@ -95,6 +96,7 @@ static QStringList environmentImportPaths()
|
|||||||
ModelManagerInterface::ModelManagerInterface(QObject *parent)
|
ModelManagerInterface::ModelManagerInterface(QObject *parent)
|
||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
m_shouldScanImports(false),
|
m_shouldScanImports(false),
|
||||||
|
m_defaultProject(0),
|
||||||
m_pluginDumper(new PluginDumper(this))
|
m_pluginDumper(new PluginDumper(this))
|
||||||
{
|
{
|
||||||
m_synchronizer.setCancelOnWait(true);
|
m_synchronizer.setCancelOnWait(true);
|
||||||
@@ -112,6 +114,11 @@ ModelManagerInterface::ModelManagerInterface(QObject *parent)
|
|||||||
qRegisterMetaType<QmlJS::Document::Ptr>("QmlJS::Document::Ptr");
|
qRegisterMetaType<QmlJS::Document::Ptr>("QmlJS::Document::Ptr");
|
||||||
qRegisterMetaType<QmlJS::LibraryInfo>("QmlJS::LibraryInfo");
|
qRegisterMetaType<QmlJS::LibraryInfo>("QmlJS::LibraryInfo");
|
||||||
|
|
||||||
|
m_defaultProjectInfo.qtImportsPath = QLibraryInfo::location(QLibraryInfo::ImportsPath);
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||||
|
m_defaultProjectInfo.qtQmlPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_defaultImportPaths << environmentImportPaths();
|
m_defaultImportPaths << environmentImportPaths();
|
||||||
updateImportPaths();
|
updateImportPaths();
|
||||||
|
|
||||||
@@ -148,7 +155,7 @@ Language::Enum ModelManagerInterface::guessLanguageOfFile(const QString &fileNam
|
|||||||
lMapping = defaultLanguageMapping();
|
lMapping = defaultLanguageMapping();
|
||||||
const QFileInfo info(fileName);
|
const QFileInfo info(fileName);
|
||||||
const QString fileSuffix = info.suffix();
|
const QString fileSuffix = info.suffix();
|
||||||
return lMapping.value(fileSuffix, Language::Unknown);
|
return lMapping.value(fileSuffix, Language::NoLanguage);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList ModelManagerInterface::globPatternsForLanguages(const QList<Language::Enum> languages)
|
QStringList ModelManagerInterface::globPatternsForLanguages(const QList<Language::Enum> languages)
|
||||||
@@ -178,7 +185,7 @@ void ModelManagerInterface::writeWarning(const QString &msg)
|
|||||||
if (ModelManagerInterface *i = instance())
|
if (ModelManagerInterface *i = instance())
|
||||||
i->writeMessageInternal(msg);
|
i->writeMessageInternal(msg);
|
||||||
else
|
else
|
||||||
qDebug() << msg;
|
qCWarning(qmljsLog) << msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelManagerInterface::WorkingCopy ModelManagerInterface::workingCopy()
|
ModelManagerInterface::WorkingCopy ModelManagerInterface::workingCopy()
|
||||||
@@ -203,7 +210,7 @@ QHash<QString, Language::Enum> ModelManagerInterface::languageForSuffix() const
|
|||||||
|
|
||||||
void ModelManagerInterface::writeMessageInternal(const QString &msg) const
|
void ModelManagerInterface::writeMessageInternal(const QString &msg) const
|
||||||
{
|
{
|
||||||
qDebug() << msg;
|
qCWarning(qmljsLog) << msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelManagerInterface::WorkingCopy ModelManagerInterface::workingCopyInternal() const
|
ModelManagerInterface::WorkingCopy ModelManagerInterface::workingCopyInternal() const
|
||||||
@@ -216,7 +223,7 @@ void ModelManagerInterface::addTaskInternal(QFuture<void> result, const QString
|
|||||||
const char *taskId) const
|
const char *taskId) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(result);
|
Q_UNUSED(result);
|
||||||
qDebug() << "started " << taskId << " " << msg;
|
qCDebug(qmljsLog) << "started " << taskId << " " << msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelManagerInterface::loadQmlTypeDescriptionsInternal(const QString &resourcePath)
|
void ModelManagerInterface::loadQmlTypeDescriptionsInternal(const QString &resourcePath)
|
||||||
@@ -253,7 +260,13 @@ void ModelManagerInterface::loadQmlTypeDescriptionsInternal(const QString &resou
|
|||||||
writeMessageInternal(warning);
|
writeMessageInternal(warning);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ModelManagerInterface::setDefaultProject(const ModelManagerInterface::ProjectInfo &pInfo,
|
||||||
|
ProjectExplorer::Project *p)
|
||||||
|
{
|
||||||
|
QMutexLocker l(mutex());
|
||||||
|
m_defaultProject = p;
|
||||||
|
m_defaultProjectInfo = pInfo;
|
||||||
|
}
|
||||||
|
|
||||||
Snapshot ModelManagerInterface::snapshot() const
|
Snapshot ModelManagerInterface::snapshot() const
|
||||||
{
|
{
|
||||||
@@ -321,7 +334,7 @@ void ModelManagerInterface::fileChangedOnDisk(const QString &path)
|
|||||||
{
|
{
|
||||||
QtConcurrent::run(&ModelManagerInterface::parse,
|
QtConcurrent::run(&ModelManagerInterface::parse,
|
||||||
workingCopyInternal(), QStringList() << path,
|
workingCopyInternal(), QStringList() << path,
|
||||||
this, Language::Unknown, true);
|
this, Language::AnyLanguage, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelManagerInterface::removeFiles(const QStringList &files)
|
void ModelManagerInterface::removeFiles(const QStringList &files)
|
||||||
@@ -477,11 +490,13 @@ QList<ModelManagerInterface::ProjectInfo> ModelManagerInterface::projectInfos()
|
|||||||
return m_projects.values();
|
return m_projects.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelManagerInterface::ProjectInfo ModelManagerInterface::projectInfo(ProjectExplorer::Project *project) const
|
ModelManagerInterface::ProjectInfo ModelManagerInterface::projectInfo(
|
||||||
|
ProjectExplorer::Project *project,
|
||||||
|
const ModelManagerInterface::ProjectInfo &defaultValue) const
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&m_mutex);
|
QMutexLocker locker(&m_mutex);
|
||||||
|
|
||||||
return m_projects.value(project, ProjectInfo());
|
return m_projects.value(project, defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelManagerInterface::updateProjectInfo(const ProjectInfo &pinfo, ProjectExplorer::Project *p)
|
void ModelManagerInterface::updateProjectInfo(const ProjectInfo &pinfo, ProjectExplorer::Project *p)
|
||||||
@@ -495,6 +510,8 @@ void ModelManagerInterface::updateProjectInfo(const ProjectInfo &pinfo, ProjectE
|
|||||||
QMutexLocker locker(&m_mutex);
|
QMutexLocker locker(&m_mutex);
|
||||||
oldInfo = m_projects.value(p);
|
oldInfo = m_projects.value(p);
|
||||||
m_projects.insert(p, pinfo);
|
m_projects.insert(p, pinfo);
|
||||||
|
if (p == m_defaultProject)
|
||||||
|
m_defaultProjectInfo = pinfo;
|
||||||
snapshot = m_validSnapshot;
|
snapshot = m_validSnapshot;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -614,7 +631,7 @@ void ModelManagerInterface::updateDocument(Document::Ptr doc)
|
|||||||
void ModelManagerInterface::updateLibraryInfo(const QString &path, const LibraryInfo &info)
|
void ModelManagerInterface::updateLibraryInfo(const QString &path, const LibraryInfo &info)
|
||||||
{
|
{
|
||||||
if (!info.pluginTypeInfoError().isEmpty())
|
if (!info.pluginTypeInfoError().isEmpty())
|
||||||
qDebug() << "Dumping errors for " << path << ":" << info.pluginTypeInfoError();
|
qCWarning(qmljsLog) << "Dumping errors for " << path << ":" << info.pluginTypeInfoError();
|
||||||
|
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&m_mutex);
|
QMutexLocker locker(&m_mutex);
|
||||||
@@ -740,7 +757,7 @@ static bool findNewQmlLibraryInPath(const QString &path,
|
|||||||
const QString path = QDir::cleanPath(componentFileInfo.absolutePath());
|
const QString path = QDir::cleanPath(componentFileInfo.absolutePath());
|
||||||
if (! scannedPaths->contains(path)) {
|
if (! scannedPaths->contains(path)) {
|
||||||
*importedFiles += filesInDirectoryForLanguages(path,
|
*importedFiles += filesInDirectoryForLanguages(path,
|
||||||
Document::companionLanguages(Language::Unknown));
|
Document::companionLanguages(Language::AnyLanguage));
|
||||||
scannedPaths->insert(path);
|
scannedPaths->insert(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -823,7 +840,7 @@ void ModelManagerInterface::parseLoop(QSet<QString> &scannedPaths,
|
|||||||
const QString fileName = files.at(i);
|
const QString fileName = files.at(i);
|
||||||
|
|
||||||
Language::Enum language = guessLanguageOfFile(fileName);
|
Language::Enum language = guessLanguageOfFile(fileName);
|
||||||
if (language == Language::Unknown) {
|
if (language == Language::NoLanguage) {
|
||||||
if (fileName.endsWith(QLatin1String(".qrc")))
|
if (fileName.endsWith(QLatin1String(".qrc")))
|
||||||
modelManager->updateQrcFile(fileName);
|
modelManager->updateQrcFile(fileName);
|
||||||
continue;
|
continue;
|
||||||
@@ -1190,6 +1207,11 @@ void ModelManagerInterface::startCppQmlTypeUpdate()
|
|||||||
m_queuedCppDocuments.clear();
|
m_queuedCppDocuments.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QMutex *ModelManagerInterface::mutex() const
|
||||||
|
{
|
||||||
|
return &m_mutex;
|
||||||
|
}
|
||||||
|
|
||||||
void ModelManagerInterface::asyncReset()
|
void ModelManagerInterface::asyncReset()
|
||||||
{
|
{
|
||||||
m_asyncResetTimer->start();
|
m_asyncResetTimer->start();
|
||||||
@@ -1284,7 +1306,7 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
|
|||||||
foreach (const QString &path, defaultVCtx.paths)
|
foreach (const QString &path, defaultVCtx.paths)
|
||||||
res.maybeAddPath(path);
|
res.maybeAddPath(path);
|
||||||
switch (res.language) {
|
switch (res.language) {
|
||||||
case Language::Unknown:
|
case Language::AnyLanguage:
|
||||||
case Language::Qml:
|
case Language::Qml:
|
||||||
res.maybeAddPath(info.qtQmlPath);
|
res.maybeAddPath(info.qtQmlPath);
|
||||||
// fallthrough
|
// fallthrough
|
||||||
@@ -1307,6 +1329,7 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case Language::NoLanguage:
|
||||||
case Language::JavaScript:
|
case Language::JavaScript:
|
||||||
case Language::QmlTypeInfo:
|
case Language::QmlTypeInfo:
|
||||||
case Language::Json:
|
case Language::Json:
|
||||||
@@ -1322,10 +1345,10 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
|
|||||||
case ViewerContext::AddDefaultPaths:
|
case ViewerContext::AddDefaultPaths:
|
||||||
foreach (const QString &path, defaultVCtx.paths)
|
foreach (const QString &path, defaultVCtx.paths)
|
||||||
res.maybeAddPath(path);
|
res.maybeAddPath(path);
|
||||||
if (res.language == Language::Unknown || res.language == Language::Qml
|
if (res.language == Language::AnyLanguage || res.language == Language::Qml
|
||||||
|| res.language == Language::QmlQtQuick2)
|
|| res.language == Language::QmlQtQuick2)
|
||||||
res.maybeAddPath(info.qtImportsPath);
|
res.maybeAddPath(info.qtImportsPath);
|
||||||
if (res.language == Language::Unknown || res.language == Language::Qml
|
if (res.language == Language::AnyLanguage || res.language == Language::Qml
|
||||||
|| res.language == Language::QmlQtQuick1)
|
|| res.language == Language::QmlQtQuick1)
|
||||||
res.maybeAddPath(info.qtQmlPath);
|
res.maybeAddPath(info.qtQmlPath);
|
||||||
break;
|
break;
|
||||||
@@ -1339,7 +1362,7 @@ ViewerContext ModelManagerInterface::defaultVContext(Language::Enum language,
|
|||||||
bool autoComplete) const
|
bool autoComplete) const
|
||||||
{
|
{
|
||||||
if (!doc.isNull()) {
|
if (!doc.isNull()) {
|
||||||
if (language == Language::Unknown)
|
if (language == Language::AnyLanguage)
|
||||||
language = doc->language();
|
language = doc->language();
|
||||||
else if (language == Language::Qml &&
|
else if (language == Language::Qml &&
|
||||||
(doc->language() == Language::QmlQtQuick1 || doc->language() == Language::QmlQtQuick2))
|
(doc->language() == Language::QmlQtQuick1 || doc->language() == Language::QmlQtQuick2))
|
||||||
@@ -1358,12 +1381,8 @@ ViewerContext ModelManagerInterface::defaultVContext(Language::Enum language,
|
|||||||
|
|
||||||
ModelManagerInterface::ProjectInfo ModelManagerInterface::defaultProjectInfo() const
|
ModelManagerInterface::ProjectInfo ModelManagerInterface::defaultProjectInfo() const
|
||||||
{
|
{
|
||||||
ProjectInfo res;
|
QMutexLocker l(mutex());
|
||||||
res.qtImportsPath = QLibraryInfo::location(QLibraryInfo::ImportsPath);
|
return m_defaultProjectInfo;
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
|
||||||
res.qtQmlPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
|
|
||||||
#endif
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelManagerInterface::setDefaultVContext(const ViewerContext &vContext)
|
void ModelManagerInterface::setDefaultVContext(const ViewerContext &vContext)
|
||||||
|
@@ -171,7 +171,8 @@ public:
|
|||||||
QrcResourceSelector resources = AllQrcResources);
|
QrcResourceSelector resources = AllQrcResources);
|
||||||
|
|
||||||
QList<ProjectInfo> projectInfos() const;
|
QList<ProjectInfo> projectInfos() const;
|
||||||
ProjectInfo projectInfo(ProjectExplorer::Project *project) const;
|
ProjectInfo projectInfo(ProjectExplorer::Project *project,
|
||||||
|
const ModelManagerInterface::ProjectInfo &defaultValue = ProjectInfo()) const;
|
||||||
void updateProjectInfo(const ProjectInfo &pinfo, ProjectExplorer::Project *p);
|
void updateProjectInfo(const ProjectInfo &pinfo, ProjectExplorer::Project *p);
|
||||||
|
|
||||||
void updateDocument(QmlJS::Document::Ptr doc);
|
void updateDocument(QmlJS::Document::Ptr doc);
|
||||||
@@ -218,6 +219,7 @@ protected slots:
|
|||||||
void asyncReset();
|
void asyncReset();
|
||||||
virtual void startCppQmlTypeUpdate();
|
virtual void startCppQmlTypeUpdate();
|
||||||
protected:
|
protected:
|
||||||
|
QMutex *mutex() const;
|
||||||
virtual QHash<QString,Language::Enum> languageForSuffix() const;
|
virtual QHash<QString,Language::Enum> languageForSuffix() const;
|
||||||
virtual void writeMessageInternal(const QString &msg) const;
|
virtual void writeMessageInternal(const QString &msg) const;
|
||||||
virtual WorkingCopy workingCopyInternal() const;
|
virtual WorkingCopy workingCopyInternal() const;
|
||||||
@@ -250,6 +252,7 @@ protected:
|
|||||||
void maybeScan(const QStringList &importPaths, Language::Enum defaultLanguage);
|
void maybeScan(const QStringList &importPaths, Language::Enum defaultLanguage);
|
||||||
void updateImportPaths();
|
void updateImportPaths();
|
||||||
void loadQmlTypeDescriptionsInternal(const QString &path);
|
void loadQmlTypeDescriptionsInternal(const QString &path);
|
||||||
|
void setDefaultProject(const ProjectInfo &pInfo, ProjectExplorer::Project *p);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable QMutex m_mutex;
|
mutable QMutex m_mutex;
|
||||||
@@ -274,6 +277,8 @@ private:
|
|||||||
|
|
||||||
// project integration
|
// project integration
|
||||||
QMap<ProjectExplorer::Project *, ProjectInfo> m_projects;
|
QMap<ProjectExplorer::Project *, ProjectInfo> m_projects;
|
||||||
|
ProjectInfo m_defaultProjectInfo;
|
||||||
|
ProjectExplorer::Project *m_defaultProject;
|
||||||
QMultiHash<QString, ProjectExplorer::Project *> m_fileToProject;
|
QMultiHash<QString, ProjectExplorer::Project *> m_fileToProject;
|
||||||
|
|
||||||
PluginDumper *m_pluginDumper;
|
PluginDumper *m_pluginDumper;
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qmljsqrcparser.h"
|
#include "qmljsqrcparser.h"
|
||||||
|
#include "qmljsconstants.h"
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
@@ -40,7 +41,6 @@
|
|||||||
#include <QMultiHash>
|
#include <QMultiHash>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
namespace QmlJS {
|
namespace QmlJS {
|
||||||
|
|
||||||
@@ -456,7 +456,7 @@ QrcParser::Ptr QrcCachePrivate::addPath(const QString &path)
|
|||||||
}
|
}
|
||||||
QrcParser::Ptr newParser = QrcParser::parseQrcFile(path);
|
QrcParser::Ptr newParser = QrcParser::parseQrcFile(path);
|
||||||
if (!newParser->isValid())
|
if (!newParser->isValid())
|
||||||
qDebug() << "adding invalid qrc " << path << " to the cache:" << newParser->errorMessages();
|
qCWarning(qmljsLog) << "adding invalid qrc " << path << " to the cache:" << newParser->errorMessages();
|
||||||
{
|
{
|
||||||
QMutexLocker l(&m_mutex);
|
QMutexLocker l(&m_mutex);
|
||||||
QPair<QrcParser::Ptr,int> currentValue = m_cache.value(path, qMakePair(QrcParser::Ptr(0), 0));
|
QPair<QrcParser::Ptr,int> currentValue = m_cache.value(path, qMakePair(QrcParser::Ptr(0), 0));
|
||||||
|
@@ -288,7 +288,7 @@ protected:
|
|||||||
result.badnessFromSplits = 0;
|
result.badnessFromSplits = 0;
|
||||||
result.lines = QStringList(line);
|
result.lines = QStringList(line);
|
||||||
|
|
||||||
//qDebug() << "trying to split" << line << possibleSplits << context;
|
//qCDebug(qmljsLog) << "trying to split" << line << possibleSplits << context;
|
||||||
|
|
||||||
// try to split at every possible position
|
// try to split at every possible position
|
||||||
for (int i = possibleSplits.size() - 1; i >= 0; --i) {
|
for (int i = possibleSplits.size() - 1; i >= 0; --i) {
|
||||||
|
@@ -33,16 +33,14 @@
|
|||||||
#include "parser/qmljslexer_p.h"
|
#include "parser/qmljslexer_p.h"
|
||||||
#include "parser/qmljsengine_p.h"
|
#include "parser/qmljsengine_p.h"
|
||||||
|
|
||||||
|
#include <utils/logging.h>
|
||||||
|
|
||||||
#include "qmljsutils.h"
|
#include "qmljsutils.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
enum {
|
namespace QmlJS{
|
||||||
debug = false
|
Q_LOGGING_CATEGORY(simpleReaderLog, "qtc.qmljs.simpleReader")
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
using namespace QmlJS;
|
|
||||||
|
|
||||||
QVariant SimpleReaderNode::property(const QString &name) const
|
QVariant SimpleReaderNode::property(const QString &name) const
|
||||||
{
|
{
|
||||||
@@ -304,8 +302,7 @@ SimpleReaderNode::Ptr SimpleReader::readFromSource(const QString &source)
|
|||||||
|
|
||||||
void SimpleReader::elementStart(const QString &name)
|
void SimpleReader::elementStart(const QString &name)
|
||||||
{
|
{
|
||||||
if (debug)
|
qCDebug(simpleReaderLog) << "elementStart()" << name;
|
||||||
qDebug() << "SimpleReader::elementStart()" << name;
|
|
||||||
|
|
||||||
SimpleReaderNode::Ptr newNode = SimpleReaderNode::create(name, m_currentNode);
|
SimpleReaderNode::Ptr newNode = SimpleReaderNode::create(name, m_currentNode);
|
||||||
|
|
||||||
@@ -321,8 +318,7 @@ void SimpleReader::elementEnd()
|
|||||||
{
|
{
|
||||||
Q_ASSERT(m_currentNode);
|
Q_ASSERT(m_currentNode);
|
||||||
|
|
||||||
if (debug)
|
qCDebug(simpleReaderLog) << "elementEnd()" << m_currentNode.data()->name();
|
||||||
qDebug() << "SimpleReader::elementEnd()" << m_currentNode.data()->name();
|
|
||||||
|
|
||||||
m_currentNode = m_currentNode.data()->parent();
|
m_currentNode = m_currentNode.data()->parent();
|
||||||
}
|
}
|
||||||
@@ -331,11 +327,12 @@ void SimpleReader::propertyDefinition(const QString &name, const QVariant &value
|
|||||||
{
|
{
|
||||||
Q_ASSERT(m_currentNode);
|
Q_ASSERT(m_currentNode);
|
||||||
|
|
||||||
if (debug)
|
qCDebug(simpleReaderLog) << "propertyDefinition()" << m_currentNode.data()->name() << name << value;
|
||||||
qDebug() << "SimpleReader::propertyDefinition()" << m_currentNode.data()->name() << name << value;
|
|
||||||
|
|
||||||
if (m_currentNode.data()->propertyNames().contains(name))
|
if (m_currentNode.data()->propertyNames().contains(name))
|
||||||
addError(tr("Property is defined twice."), currentSourceLocation());
|
addError(tr("Property is defined twice."), currentSourceLocation());
|
||||||
|
|
||||||
m_currentNode.data()->setProperty(name, value);
|
m_currentNode.data()->setProperty(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace QmlJS
|
||||||
|
@@ -56,6 +56,8 @@ ViewerContext::ViewerContext(QStringList selectors, QStringList paths,
|
|||||||
*/
|
*/
|
||||||
bool ViewerContext::languageIsCompatible(Language::Enum l) const
|
bool ViewerContext::languageIsCompatible(Language::Enum l) const
|
||||||
{
|
{
|
||||||
|
if (l == Language::AnyLanguage && language != Language::NoLanguage)
|
||||||
|
return true;
|
||||||
switch (language) {
|
switch (language) {
|
||||||
case Language::JavaScript:
|
case Language::JavaScript:
|
||||||
case Language::Json:
|
case Language::Json:
|
||||||
@@ -70,10 +72,12 @@ bool ViewerContext::languageIsCompatible(Language::Enum l) const
|
|||||||
return l == Language::Qml || l == Language::QmlQtQuick1 || l == Language::JavaScript;
|
return l == Language::Qml || l == Language::QmlQtQuick1 || l == Language::JavaScript;
|
||||||
case Language::QmlQtQuick2:
|
case Language::QmlQtQuick2:
|
||||||
return l == Language::Qml || l == Language::QmlQtQuick2 || l == Language::JavaScript;
|
return l == Language::Qml || l == Language::QmlQtQuick2 || l == Language::JavaScript;
|
||||||
case Language::Unknown: // ?
|
case Language::AnyLanguage:
|
||||||
|
return true;
|
||||||
|
case Language::NoLanguage:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewerContext::maybeAddPath(const QString &path)
|
void ViewerContext::maybeAddPath(const QString &path)
|
||||||
|
@@ -28,11 +28,14 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef LOGGING_H
|
#ifndef LOGGING_H
|
||||||
|
#define LOGGING_H
|
||||||
|
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
//
|
//
|
||||||
// Qt < 5.2 didn't feature categorized logging:
|
// Qt < 5.2 didn't feature categorized logging:
|
||||||
// Just enable qCWarning, qCCritical, but disable qCDebug
|
// Just enable qCWarning, qCCritical, but disable qCDebug
|
||||||
@@ -42,7 +45,8 @@ class QLoggingCategory
|
|||||||
Q_DISABLE_COPY(QLoggingCategory)
|
Q_DISABLE_COPY(QLoggingCategory)
|
||||||
public:
|
public:
|
||||||
explicit QLoggingCategory(const char *category) : name(category) {}
|
explicit QLoggingCategory(const char *category) : name(category) {}
|
||||||
~QLoggingCategory();
|
~QLoggingCategory() {}
|
||||||
|
static void setFilterRules(const QString &) {}
|
||||||
|
|
||||||
bool isDebugEnabled() const { return false; }
|
bool isDebugEnabled() const { return false; }
|
||||||
bool isWarningEnabled() const { return true; }
|
bool isWarningEnabled() const { return true; }
|
||||||
|
@@ -98,7 +98,7 @@ public:
|
|||||||
AnalyzerMode(QObject *parent = 0)
|
AnalyzerMode(QObject *parent = 0)
|
||||||
: IMode(parent)
|
: IMode(parent)
|
||||||
{
|
{
|
||||||
setContext(Context(C_EDITORMANAGER, C_ANALYZEMODE, C_NAVIGATION_PANE));
|
setContext(Context(C_ANALYZEMODE, C_NAVIGATION_PANE));
|
||||||
setDisplayName(tr("Analyze"));
|
setDisplayName(tr("Analyze"));
|
||||||
setIcon(QIcon(QLatin1String(":/images/analyzer_mode.png")));
|
setIcon(QIcon(QLatin1String(":/images/analyzer_mode.png")));
|
||||||
setPriority(P_MODE_ANALYZE);
|
setPriority(P_MODE_ANALYZE);
|
||||||
@@ -279,6 +279,10 @@ void AnalyzerManagerPrivate::delayedInit()
|
|||||||
splitter->addWidget(mainWindowSplitter);
|
splitter->addWidget(mainWindowSplitter);
|
||||||
splitter->setStretchFactor(0, 0);
|
splitter->setStretchFactor(0, 0);
|
||||||
splitter->setStretchFactor(1, 1);
|
splitter->setStretchFactor(1, 1);
|
||||||
|
Core::IContext *modeContextObject = new Core::IContext(this);
|
||||||
|
modeContextObject->setContext(Core::Context(Core::Constants::C_EDITORMANAGER));
|
||||||
|
modeContextObject->setWidget(splitter);
|
||||||
|
Core::ICore::addContextObject(modeContextObject);
|
||||||
m_mode->setWidget(splitter);
|
m_mode->setWidget(splitter);
|
||||||
|
|
||||||
AnalyzerPlugin::instance()->addAutoReleasedObject(m_mode);
|
AnalyzerPlugin::instance()->addAutoReleasedObject(m_mode);
|
||||||
|
@@ -67,12 +67,12 @@ AndroidDeployConfigurationFactory::AndroidDeployConfigurationFactory(QObject *pa
|
|||||||
setObjectName(QLatin1String("AndroidDeployConfigurationFactory"));
|
setObjectName(QLatin1String("AndroidDeployConfigurationFactory"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidDeployConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
|
bool AndroidDeployConfigurationFactory::canCreate(Target *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
return availableCreationIds(parent).contains(id);
|
return availableCreationIds(parent).contains(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
DeployConfiguration *AndroidDeployConfigurationFactory::create(Target *parent, const Core::Id id)
|
DeployConfiguration *AndroidDeployConfigurationFactory::create(Target *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
AndroidDeployConfiguration *dc = new AndroidDeployConfiguration(parent, id);
|
AndroidDeployConfiguration *dc = new AndroidDeployConfiguration(parent, id);
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(Target *
|
|||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AndroidDeployConfigurationFactory::displayNameForId(const Core::Id id) const
|
QString AndroidDeployConfigurationFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
if (id.name().startsWith(ANDROID_DC_PREFIX)
|
if (id.name().startsWith(ANDROID_DC_PREFIX)
|
||||||
|| id.name().startsWith(ANDROID_DC2_PREFIX))
|
|| id.name().startsWith(ANDROID_DC2_PREFIX))
|
||||||
|
@@ -62,8 +62,8 @@ class AndroidDeployConfigurationFactory : public ProjectExplorer::DeployConfigur
|
|||||||
public:
|
public:
|
||||||
explicit AndroidDeployConfigurationFactory(QObject *parent = 0);
|
explicit AndroidDeployConfigurationFactory(QObject *parent = 0);
|
||||||
|
|
||||||
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
|
bool canCreate(ProjectExplorer::Target *parent, Core::Id id) const;
|
||||||
ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id);
|
ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, Core::Id id);
|
||||||
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
||||||
ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
|
ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
|
||||||
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const;
|
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const;
|
||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
|
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
|
||||||
// used to translate the ids to names to display to the user
|
// used to translate the ids to names to display to the user
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool canHandle(ProjectExplorer::Target *parent) const;
|
bool canHandle(ProjectExplorer::Target *parent) const;
|
||||||
|
@@ -87,19 +87,19 @@ QList<Core::Id> AndroidDeployQtStepFactory::availableCreationIds(ProjectExplorer
|
|||||||
return QList<Core::Id>() << AndroidDeployQtStep::Id;
|
return QList<Core::Id>() << AndroidDeployQtStep::Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AndroidDeployQtStepFactory::displayNameForId(const Core::Id id) const
|
QString AndroidDeployQtStepFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
if (id == AndroidDeployQtStep::Id)
|
if (id == AndroidDeployQtStep::Id)
|
||||||
return tr("Deploy to Android device or emulator");
|
return tr("Deploy to Android device or emulator");
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidDeployQtStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
|
bool AndroidDeployQtStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
return availableCreationIds(parent).contains(id);
|
return availableCreationIds(parent).contains(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::BuildStep *AndroidDeployQtStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
|
ProjectExplorer::BuildStep *AndroidDeployQtStepFactory::create(ProjectExplorer::BuildStepList *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
Q_ASSERT(canCreate(parent, id));
|
Q_ASSERT(canCreate(parent, id));
|
||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
|
@@ -50,11 +50,11 @@ public:
|
|||||||
explicit AndroidDeployQtStepFactory(QObject *parent = 0);
|
explicit AndroidDeployQtStepFactory(QObject *parent = 0);
|
||||||
|
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
|
|
||||||
bool canCreate(ProjectExplorer::BuildStepList *parent,
|
bool canCreate(ProjectExplorer::BuildStepList *parent,
|
||||||
const Core::Id id) const;
|
const Core::Id id) const;
|
||||||
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
||||||
|
|
||||||
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
||||||
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
|
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
|
||||||
|
@@ -64,19 +64,19 @@ QList<Core::Id> AndroidDeployStepFactory::availableCreationIds(BuildStepList *pa
|
|||||||
return QList<Core::Id>() << AndroidDeployStep::Id;
|
return QList<Core::Id>() << AndroidDeployStep::Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AndroidDeployStepFactory::displayNameForId(const Core::Id id) const
|
QString AndroidDeployStepFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
if (id == AndroidDeployStep::Id)
|
if (id == AndroidDeployStep::Id)
|
||||||
return tr("Deploy to Android device or emulator");
|
return tr("Deploy to Android device or emulator");
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidDeployStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const
|
bool AndroidDeployStepFactory::canCreate(BuildStepList *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
return availableCreationIds(parent).contains(id);
|
return availableCreationIds(parent).contains(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *AndroidDeployStepFactory::create(BuildStepList *parent, const Core::Id id)
|
BuildStep *AndroidDeployStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
Q_ASSERT(canCreate(parent, id));
|
Q_ASSERT(canCreate(parent, id));
|
||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
|
@@ -42,11 +42,11 @@ public:
|
|||||||
explicit AndroidDeployStepFactory(QObject *parent = 0);
|
explicit AndroidDeployStepFactory(QObject *parent = 0);
|
||||||
|
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
|
|
||||||
bool canCreate(ProjectExplorer::BuildStepList *parent,
|
bool canCreate(ProjectExplorer::BuildStepList *parent,
|
||||||
const Core::Id id) const;
|
const Core::Id id) const;
|
||||||
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
||||||
|
|
||||||
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
||||||
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
|
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
|
||||||
|
@@ -62,19 +62,19 @@ QList<Core::Id> AndroidPackageCreationFactory::availableCreationIds(BuildStepLis
|
|||||||
return QList<Core::Id>() << AndroidPackageCreationStep::CreatePackageId;
|
return QList<Core::Id>() << AndroidPackageCreationStep::CreatePackageId;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AndroidPackageCreationFactory::displayNameForId(const Core::Id id) const
|
QString AndroidPackageCreationFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
if (id == AndroidPackageCreationStep::CreatePackageId)
|
if (id == AndroidPackageCreationStep::CreatePackageId)
|
||||||
return tr("Create Android (.apk) Package");
|
return tr("Create Android (.apk) Package");
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidPackageCreationFactory::canCreate(BuildStepList *parent, const Core::Id id) const
|
bool AndroidPackageCreationFactory::canCreate(BuildStepList *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
return availableCreationIds(parent).contains(id);
|
return availableCreationIds(parent).contains(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *AndroidPackageCreationFactory::create(BuildStepList *parent, const Core::Id id)
|
BuildStep *AndroidPackageCreationFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
Q_ASSERT(canCreate(parent, id));
|
Q_ASSERT(canCreate(parent, id));
|
||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
|
@@ -42,11 +42,11 @@ public:
|
|||||||
explicit AndroidPackageCreationFactory(QObject *parent = 0);
|
explicit AndroidPackageCreationFactory(QObject *parent = 0);
|
||||||
|
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
|
|
||||||
bool canCreate(ProjectExplorer::BuildStepList *parent,
|
bool canCreate(ProjectExplorer::BuildStepList *parent,
|
||||||
const Core::Id id) const;
|
const Core::Id id) const;
|
||||||
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
||||||
|
|
||||||
bool canRestore(ProjectExplorer::BuildStepList *parent,
|
bool canRestore(ProjectExplorer::BuildStepList *parent,
|
||||||
const QVariantMap &map) const;
|
const QVariantMap &map) const;
|
||||||
|
@@ -54,21 +54,21 @@ QList<Core::Id> AndroidPackageInstallationFactory::availableCreationIds(BuildSte
|
|||||||
return QList<Core::Id>();
|
return QList<Core::Id>();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AndroidPackageInstallationFactory::displayNameForId(const Core::Id id) const
|
QString AndroidPackageInstallationFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
if (id == AndroidPackageInstallationStep::Id)
|
if (id == AndroidPackageInstallationStep::Id)
|
||||||
return tr("Deploy to device");
|
return tr("Deploy to device");
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidPackageInstallationFactory::canCreate(BuildStepList *parent, const Core::Id id) const
|
bool AndroidPackageInstallationFactory::canCreate(BuildStepList *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(parent);
|
Q_UNUSED(parent);
|
||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *AndroidPackageInstallationFactory::create(BuildStepList *parent, const Core::Id id)
|
BuildStep *AndroidPackageInstallationFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
Q_UNUSED(parent);
|
Q_UNUSED(parent);
|
||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
|
@@ -42,11 +42,11 @@ public:
|
|||||||
explicit AndroidPackageInstallationFactory(QObject *parent = 0);
|
explicit AndroidPackageInstallationFactory(QObject *parent = 0);
|
||||||
|
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
|
|
||||||
bool canCreate(ProjectExplorer::BuildStepList *parent,
|
bool canCreate(ProjectExplorer::BuildStepList *parent,
|
||||||
const Core::Id id) const;
|
const Core::Id id) const;
|
||||||
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
||||||
|
|
||||||
bool canRestore(ProjectExplorer::BuildStepList *parent,
|
bool canRestore(ProjectExplorer::BuildStepList *parent,
|
||||||
const QVariantMap &map) const;
|
const QVariantMap &map) const;
|
||||||
|
@@ -55,7 +55,7 @@ namespace Internal {
|
|||||||
|
|
||||||
static const char ANDROID_RC_ID_PREFIX[] = "Qt4ProjectManager.AndroidRunConfiguration:";
|
static const char ANDROID_RC_ID_PREFIX[] = "Qt4ProjectManager.AndroidRunConfiguration:";
|
||||||
|
|
||||||
static QString pathFromId(const Core::Id id)
|
static QString pathFromId(Core::Id id)
|
||||||
{
|
{
|
||||||
return id.suffixAfter(ANDROID_RC_ID_PREFIX);
|
return id.suffixAfter(ANDROID_RC_ID_PREFIX);
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ AndroidRunConfigurationFactory::AndroidRunConfigurationFactory(QObject *parent)
|
|||||||
setObjectName(QLatin1String("AndroidRunConfigurationFactory"));
|
setObjectName(QLatin1String("AndroidRunConfigurationFactory"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
|
bool AndroidRunConfigurationFactory::canCreate(Target *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
if (!canHandle(parent))
|
if (!canHandle(parent))
|
||||||
return false;
|
return false;
|
||||||
@@ -103,12 +103,12 @@ QList<Core::Id> AndroidRunConfigurationFactory::availableCreationIds(Target *par
|
|||||||
return QmakeProject::idsForNodes(base, nodes);
|
return QmakeProject::idsForNodes(base, nodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AndroidRunConfigurationFactory::displayNameForId(const Core::Id id) const
|
QString AndroidRunConfigurationFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
return QFileInfo(pathFromId(id)).completeBaseName();
|
return QFileInfo(pathFromId(id)).completeBaseName();
|
||||||
}
|
}
|
||||||
|
|
||||||
RunConfiguration *AndroidRunConfigurationFactory::doCreate(Target *parent, const Core::Id id)
|
RunConfiguration *AndroidRunConfigurationFactory::doCreate(Target *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
return new AndroidRunConfiguration(parent, id, pathFromId(id));
|
return new AndroidRunConfiguration(parent, id, pathFromId(id));
|
||||||
}
|
}
|
||||||
|
@@ -50,10 +50,10 @@ class AndroidRunConfigurationFactory : public QmakeProjectManager::QmakeRunConfi
|
|||||||
public:
|
public:
|
||||||
explicit AndroidRunConfigurationFactory(QObject *parent = 0);
|
explicit AndroidRunConfigurationFactory(QObject *parent = 0);
|
||||||
|
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode = UserCreate) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode = UserCreate) const;
|
||||||
|
|
||||||
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
|
bool canCreate(ProjectExplorer::Target *parent, Core::Id id) const;
|
||||||
|
|
||||||
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool canHandle(ProjectExplorer::Target *t) const;
|
bool canHandle(ProjectExplorer::Target *t) const;
|
||||||
|
|
||||||
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id);
|
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, Core::Id id);
|
||||||
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
|
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
|
||||||
const QVariantMap &map);
|
const QVariantMap &map);
|
||||||
};
|
};
|
||||||
|
@@ -104,7 +104,7 @@ void JavaCompletionAssistProvider::init() const
|
|||||||
m_keywords.append(QLatin1String(keywords[i]));
|
m_keywords.append(QLatin1String(keywords[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JavaCompletionAssistProvider::supportsEditor(const Core::Id &editorId) const
|
bool JavaCompletionAssistProvider::supportsEditor(Core::Id editorId) const
|
||||||
{
|
{
|
||||||
return editorId == Constants::JAVA_EDITOR_ID;
|
return editorId == Constants::JAVA_EDITOR_ID;
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ public:
|
|||||||
|
|
||||||
void init() const;
|
void init() const;
|
||||||
|
|
||||||
bool supportsEditor(const Core::Id &editorId) const;
|
bool supportsEditor(Core::Id editorId) const;
|
||||||
TextEditor::IAssistProcessor *createProcessor() const;
|
TextEditor::IAssistProcessor *createProcessor() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -69,19 +69,19 @@ QList<Core::Id> AutogenStepFactory::availableCreationIds(BuildStepList *parent)
|
|||||||
return QList<Core::Id>() << Core::Id(AUTOGEN_STEP_ID);
|
return QList<Core::Id>() << Core::Id(AUTOGEN_STEP_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AutogenStepFactory::displayNameForId(const Core::Id id) const
|
QString AutogenStepFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
if (id == AUTOGEN_STEP_ID)
|
if (id == AUTOGEN_STEP_ID)
|
||||||
return tr("Autogen", "Display name for AutotoolsProjectManager::AutogenStep id.");
|
return tr("Autogen", "Display name for AutotoolsProjectManager::AutogenStep id.");
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AutogenStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const
|
bool AutogenStepFactory::canCreate(BuildStepList *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
return canHandle(parent) && Core::Id(AUTOGEN_STEP_ID) == id;
|
return canHandle(parent) && Core::Id(AUTOGEN_STEP_ID) == id;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *AutogenStepFactory::create(BuildStepList *parent, const Core::Id id)
|
BuildStep *AutogenStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
if (!canCreate(parent, id))
|
if (!canCreate(parent, id))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -133,7 +133,7 @@ AutogenStep::AutogenStep(BuildStepList *bsl) :
|
|||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
AutogenStep::AutogenStep(BuildStepList *bsl, const Core::Id id) :
|
AutogenStep::AutogenStep(BuildStepList *bsl, Core::Id id) :
|
||||||
AbstractProcessStep(bsl, id)
|
AbstractProcessStep(bsl, id)
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
|
@@ -61,9 +61,9 @@ public:
|
|||||||
AutogenStepFactory(QObject *parent = 0);
|
AutogenStepFactory(QObject *parent = 0);
|
||||||
|
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
|
bool canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const;
|
||||||
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
||||||
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
|
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
|
||||||
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
|
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
|
||||||
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
||||||
@@ -110,7 +110,7 @@ signals:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
AutogenStep(ProjectExplorer::BuildStepList *bsl, AutogenStep *bs);
|
AutogenStep(ProjectExplorer::BuildStepList *bsl, AutogenStep *bs);
|
||||||
AutogenStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id);
|
AutogenStep(ProjectExplorer::BuildStepList *bsl, Core::Id id);
|
||||||
|
|
||||||
bool fromMap(const QVariantMap &map);
|
bool fromMap(const QVariantMap &map);
|
||||||
|
|
||||||
|
@@ -68,19 +68,19 @@ QList<Core::Id> AutoreconfStepFactory::availableCreationIds(BuildStepList *paren
|
|||||||
return QList<Core::Id>() << Core::Id(AUTORECONF_STEP_ID);
|
return QList<Core::Id>() << Core::Id(AUTORECONF_STEP_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AutoreconfStepFactory::displayNameForId(const Core::Id id) const
|
QString AutoreconfStepFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
if (id == AUTORECONF_STEP_ID)
|
if (id == AUTORECONF_STEP_ID)
|
||||||
return tr("Autoreconf", "Display name for AutotoolsProjectManager::AutoreconfStep id.");
|
return tr("Autoreconf", "Display name for AutotoolsProjectManager::AutoreconfStep id.");
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AutoreconfStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const
|
bool AutoreconfStepFactory::canCreate(BuildStepList *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
return canHandle(parent) && Core::Id(AUTORECONF_STEP_ID) == id;
|
return canHandle(parent) && Core::Id(AUTORECONF_STEP_ID) == id;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *AutoreconfStepFactory::create(BuildStepList *parent, const Core::Id id)
|
BuildStep *AutoreconfStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
if (!canCreate(parent, id))
|
if (!canCreate(parent, id))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -132,7 +132,7 @@ AutoreconfStep::AutoreconfStep(BuildStepList *bsl) :
|
|||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoreconfStep::AutoreconfStep(BuildStepList *bsl, const Core::Id id) :
|
AutoreconfStep::AutoreconfStep(BuildStepList *bsl, Core::Id id) :
|
||||||
AbstractProcessStep(bsl, id)
|
AbstractProcessStep(bsl, id)
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
|
@@ -60,10 +60,10 @@ public:
|
|||||||
AutoreconfStepFactory(QObject *parent = 0);
|
AutoreconfStepFactory(QObject *parent = 0);
|
||||||
|
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
|
|
||||||
bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
|
bool canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const;
|
||||||
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
||||||
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
|
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
|
||||||
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
|
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
|
||||||
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
||||||
@@ -110,7 +110,7 @@ signals:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
AutoreconfStep(ProjectExplorer::BuildStepList *bsl, AutoreconfStep *bs);
|
AutoreconfStep(ProjectExplorer::BuildStepList *bsl, AutoreconfStep *bs);
|
||||||
AutoreconfStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id);
|
AutoreconfStep(ProjectExplorer::BuildStepList *bsl, Core::Id id);
|
||||||
|
|
||||||
bool fromMap(const QVariantMap &map);
|
bool fromMap(const QVariantMap &map);
|
||||||
|
|
||||||
|
@@ -70,7 +70,7 @@ NamedWidget *AutotoolsBuildConfiguration::createConfigWidget()
|
|||||||
return new AutotoolsBuildSettingsWidget(this);
|
return new AutotoolsBuildSettingsWidget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(ProjectExplorer::Target *parent, const Core::Id id)
|
AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(ProjectExplorer::Target *parent, Core::Id id)
|
||||||
: BuildConfiguration(parent, id)
|
: BuildConfiguration(parent, id)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@@ -56,7 +56,7 @@ public:
|
|||||||
BuildType buildType() const;
|
BuildType buildType() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AutotoolsBuildConfiguration(ProjectExplorer::Target *parent, const Core::Id id);
|
AutotoolsBuildConfiguration(ProjectExplorer::Target *parent, Core::Id id);
|
||||||
AutotoolsBuildConfiguration(ProjectExplorer::Target *parent, AutotoolsBuildConfiguration *source);
|
AutotoolsBuildConfiguration(ProjectExplorer::Target *parent, AutotoolsBuildConfiguration *source);
|
||||||
|
|
||||||
friend class AutotoolsBuildSettingsWidget;
|
friend class AutotoolsBuildSettingsWidget;
|
||||||
|
@@ -41,6 +41,7 @@ AutotoolsProjectFile::AutotoolsProjectFile(AutotoolsProject *project, const QStr
|
|||||||
m_project(project)
|
m_project(project)
|
||||||
{
|
{
|
||||||
setId("Autotools.ProjectFile");
|
setId("Autotools.ProjectFile");
|
||||||
|
setMimeType(QLatin1String(Constants::MAKEFILE_MIMETYPE));
|
||||||
setFilePath(fileName);
|
setFilePath(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,11 +64,6 @@ QString AutotoolsProjectFile::suggestedFileName() const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AutotoolsProjectFile::mimeType() const
|
|
||||||
{
|
|
||||||
return QLatin1String(Constants::MAKEFILE_MIMETYPE);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AutotoolsProjectFile::isModified() const
|
bool AutotoolsProjectFile::isModified() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@@ -59,7 +59,6 @@ public:
|
|||||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
||||||
QString defaultPath() const;
|
QString defaultPath() const;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const;
|
||||||
QString mimeType() const;
|
|
||||||
bool isModified() const;
|
bool isModified() const;
|
||||||
bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
||||||
|
@@ -69,19 +69,19 @@ QList<Core::Id> ConfigureStepFactory::availableCreationIds(BuildStepList *parent
|
|||||||
return QList<Core::Id>() << Core::Id(CONFIGURE_STEP_ID);
|
return QList<Core::Id>() << Core::Id(CONFIGURE_STEP_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ConfigureStepFactory::displayNameForId(const Core::Id id) const
|
QString ConfigureStepFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
if (id == CONFIGURE_STEP_ID)
|
if (id == CONFIGURE_STEP_ID)
|
||||||
return tr("Configure", "Display name for AutotoolsProjectManager::ConfigureStep id.");
|
return tr("Configure", "Display name for AutotoolsProjectManager::ConfigureStep id.");
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConfigureStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const
|
bool ConfigureStepFactory::canCreate(BuildStepList *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
return canHandle(parent) && id == CONFIGURE_STEP_ID;
|
return canHandle(parent) && id == CONFIGURE_STEP_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *ConfigureStepFactory::create(BuildStepList *parent, const Core::Id id)
|
BuildStep *ConfigureStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
if (!canCreate(parent, id))
|
if (!canCreate(parent, id))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -133,7 +133,7 @@ ConfigureStep::ConfigureStep(BuildStepList* bsl) :
|
|||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigureStep::ConfigureStep(BuildStepList *bsl, const Core::Id id) :
|
ConfigureStep::ConfigureStep(BuildStepList *bsl, Core::Id id) :
|
||||||
AbstractProcessStep(bsl, id)
|
AbstractProcessStep(bsl, id)
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
|
@@ -60,10 +60,10 @@ public:
|
|||||||
ConfigureStepFactory(QObject *parent = 0);
|
ConfigureStepFactory(QObject *parent = 0);
|
||||||
|
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
|
|
||||||
bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
|
bool canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const;
|
||||||
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
||||||
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
|
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
|
||||||
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
|
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
|
||||||
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
||||||
@@ -109,7 +109,7 @@ signals:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
ConfigureStep(ProjectExplorer::BuildStepList *bsl, ConfigureStep *bs);
|
ConfigureStep(ProjectExplorer::BuildStepList *bsl, ConfigureStep *bs);
|
||||||
ConfigureStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id);
|
ConfigureStep(ProjectExplorer::BuildStepList *bsl, Core::Id id);
|
||||||
|
|
||||||
bool fromMap(const QVariantMap &map);
|
bool fromMap(const QVariantMap &map);
|
||||||
|
|
||||||
|
@@ -74,21 +74,21 @@ QList<Core::Id> MakeStepFactory::availableCreationIds(BuildStepList *parent) con
|
|||||||
return QList<Core::Id>();
|
return QList<Core::Id>();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MakeStepFactory::displayNameForId(const Core::Id id) const
|
QString MakeStepFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
if (id == MAKE_STEP_ID)
|
if (id == MAKE_STEP_ID)
|
||||||
return tr("Make", "Display name for AutotoolsProjectManager::MakeStep id.");
|
return tr("Make", "Display name for AutotoolsProjectManager::MakeStep id.");
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MakeStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const
|
bool MakeStepFactory::canCreate(BuildStepList *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
if (parent->target()->project()->id() == AUTOTOOLS_PROJECT_ID)
|
if (parent->target()->project()->id() == AUTOTOOLS_PROJECT_ID)
|
||||||
return id == MAKE_STEP_ID;
|
return id == MAKE_STEP_ID;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *MakeStepFactory::create(BuildStepList *parent, const Core::Id id)
|
BuildStep *MakeStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
if (!canCreate(parent, id))
|
if (!canCreate(parent, id))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -133,7 +133,7 @@ MakeStep::MakeStep(BuildStepList* bsl) :
|
|||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
MakeStep::MakeStep(BuildStepList *bsl, const Core::Id id) :
|
MakeStep::MakeStep(BuildStepList *bsl, Core::Id id) :
|
||||||
AbstractProcessStep(bsl, id),
|
AbstractProcessStep(bsl, id),
|
||||||
m_clean(false)
|
m_clean(false)
|
||||||
{
|
{
|
||||||
|
@@ -61,10 +61,10 @@ public:
|
|||||||
MakeStepFactory(QObject *parent = 0);
|
MakeStepFactory(QObject *parent = 0);
|
||||||
|
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
|
|
||||||
bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
|
bool canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const;
|
||||||
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
||||||
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
|
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
|
||||||
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
|
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
|
||||||
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
||||||
@@ -110,7 +110,7 @@ signals:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
MakeStep(ProjectExplorer::BuildStepList *bsl, MakeStep *bs);
|
MakeStep(ProjectExplorer::BuildStepList *bsl, MakeStep *bs);
|
||||||
MakeStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id);
|
MakeStep(ProjectExplorer::BuildStepList *bsl, Core::Id id);
|
||||||
|
|
||||||
bool fromMap(const QVariantMap &map);
|
bool fromMap(const QVariantMap &map);
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@ class BareMetalGdbCommandsDeployStep : public ProjectExplorer::BuildStep
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BareMetalGdbCommandsDeployStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id);
|
BareMetalGdbCommandsDeployStep(ProjectExplorer::BuildStepList *bsl, Core::Id id);
|
||||||
BareMetalGdbCommandsDeployStep(ProjectExplorer::BuildStepList *bsl,
|
BareMetalGdbCommandsDeployStep(ProjectExplorer::BuildStepList *bsl,
|
||||||
BareMetalGdbCommandsDeployStep *other);
|
BareMetalGdbCommandsDeployStep *other);
|
||||||
~BareMetalGdbCommandsDeployStep();
|
~BareMetalGdbCommandsDeployStep();
|
||||||
|
@@ -46,7 +46,7 @@ class BareMetalRunConfiguration : public ProjectExplorer::RunConfiguration
|
|||||||
friend class BareMetalRunConfigurationWidget;
|
friend class BareMetalRunConfigurationWidget;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BareMetalRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id,
|
explicit BareMetalRunConfiguration(ProjectExplorer::Target *parent, Core::Id id,
|
||||||
const QString &projectFilePath);
|
const QString &projectFilePath);
|
||||||
|
|
||||||
bool isEnabled() const;
|
bool isEnabled() const;
|
||||||
|
@@ -63,7 +63,7 @@ BareMetalRunConfigurationFactory::~BareMetalRunConfigurationFactory()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BareMetalRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
|
bool BareMetalRunConfigurationFactory::canCreate(Target *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
if (!canHandle(parent))
|
if (!canHandle(parent))
|
||||||
return false;
|
return false;
|
||||||
@@ -97,13 +97,13 @@ QList<Core::Id> BareMetalRunConfigurationFactory::availableCreationIds(Target *p
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BareMetalRunConfigurationFactory::displayNameForId(const Core::Id id) const
|
QString BareMetalRunConfigurationFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
return tr("%1 (on GDB server or hardware debugger)")
|
return tr("%1 (on GDB server or hardware debugger)")
|
||||||
.arg(QFileInfo(pathFromId(id)).completeBaseName());
|
.arg(QFileInfo(pathFromId(id)).completeBaseName());
|
||||||
}
|
}
|
||||||
|
|
||||||
RunConfiguration *BareMetalRunConfigurationFactory::doCreate(Target *parent, const Core::Id id)
|
RunConfiguration *BareMetalRunConfigurationFactory::doCreate(Target *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
return new BareMetalRunConfiguration(parent, id, pathFromId(id));
|
return new BareMetalRunConfiguration(parent, id, pathFromId(id));
|
||||||
|
@@ -43,10 +43,10 @@ public:
|
|||||||
explicit BareMetalRunConfigurationFactory(QObject *parent = 0);
|
explicit BareMetalRunConfigurationFactory(QObject *parent = 0);
|
||||||
~BareMetalRunConfigurationFactory();
|
~BareMetalRunConfigurationFactory();
|
||||||
|
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const;
|
||||||
|
|
||||||
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
|
bool canCreate(ProjectExplorer::Target *parent, Core::Id id) const;
|
||||||
|
|
||||||
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool canHandle(const ProjectExplorer::Target *target) const;
|
bool canHandle(const ProjectExplorer::Target *target) const;
|
||||||
|
|
||||||
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id);
|
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, Core::Id id);
|
||||||
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
|
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
|
||||||
const QVariantMap &map);
|
const QVariantMap &map);
|
||||||
};
|
};
|
||||||
|
@@ -97,7 +97,7 @@ public:
|
|||||||
m_widget->highlightSearchResults(txt.toLatin1(), textDocumentFlagsForFindFlags(findFlags));
|
m_widget->highlightSearchResults(txt.toLatin1(), textDocumentFlagsForFindFlags(findFlags));
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearResults()
|
void clearHighlights()
|
||||||
{
|
{
|
||||||
m_widget->highlightSearchResults(QByteArray());
|
m_widget->highlightSearchResults(QByteArray());
|
||||||
}
|
}
|
||||||
@@ -206,17 +206,13 @@ public:
|
|||||||
Core::IDocument(parent)
|
Core::IDocument(parent)
|
||||||
{
|
{
|
||||||
setId(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
|
setId(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
|
||||||
|
setMimeType(QLatin1String(BINEditor::Constants::C_BINEDITOR_MIMETYPE));
|
||||||
m_widget = parent;
|
m_widget = parent;
|
||||||
connect(m_widget, SIGNAL(dataRequested(quint64)),
|
connect(m_widget, SIGNAL(dataRequested(quint64)),
|
||||||
this, SLOT(provideData(quint64)));
|
this, SLOT(provideData(quint64)));
|
||||||
connect(m_widget, SIGNAL(newRangeRequested(quint64)),
|
connect(m_widget, SIGNAL(newRangeRequested(quint64)),
|
||||||
this, SLOT(provideNewRange(quint64)));
|
this, SLOT(provideNewRange(quint64)));
|
||||||
}
|
}
|
||||||
~BinEditorDocument() {}
|
|
||||||
|
|
||||||
QString mimeType() const {
|
|
||||||
return QLatin1String(BINEditor::Constants::C_BINEDITOR_MIMETYPE);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool setContents(const QByteArray &contents)
|
bool setContents(const QByteArray &contents)
|
||||||
{
|
{
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
import qbs
|
import qbs
|
||||||
import qbs.File
|
import qbs.File
|
||||||
|
import qbs.Process
|
||||||
|
import QtcProcessOutputReader
|
||||||
|
|
||||||
QtcPlugin {
|
QtcPlugin {
|
||||||
name: "ClangCodeModel"
|
name: "ClangCodeModel"
|
||||||
@@ -11,14 +13,12 @@ QtcPlugin {
|
|||||||
Depends { name: "TextEditor" }
|
Depends { name: "TextEditor" }
|
||||||
Depends { name: "Utils" }
|
Depends { name: "Utils" }
|
||||||
|
|
||||||
property string llvmInstallDir: qbs.getEnv("LLVM_INSTALL_DIR")
|
property string llvmInstallDirFromEnv: qbs.getEnv("LLVM_INSTALL_DIR")
|
||||||
condition: llvmInstallDir && !llvmInstallDir.isEmpty
|
|
||||||
|
|
||||||
property bool clangCompletion: true
|
property bool clangCompletion: true
|
||||||
property bool clangHighlighting: true
|
property bool clangHighlighting: true
|
||||||
property bool clangIndexing: false
|
property bool clangIndexing: false
|
||||||
|
|
||||||
// Not used atm; we just rely on the LLVM_INSTALL_DIR environment variable.
|
|
||||||
property string llvmConfig: {
|
property string llvmConfig: {
|
||||||
var llvmConfigVariants = [
|
var llvmConfigVariants = [
|
||||||
"llvm-config", "llvm-config-3.2", "llvm-config-3.3", "llvm-config-3.4",
|
"llvm-config", "llvm-config-3.2", "llvm-config-3.3", "llvm-config-3.4",
|
||||||
@@ -26,10 +26,12 @@ QtcPlugin {
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Prefer llvm-config* from LLVM_INSTALL_DIR
|
// Prefer llvm-config* from LLVM_INSTALL_DIR
|
||||||
for (var i = 0; i < llvmConfigVariants.length; ++i) {
|
if (llvmInstallDirFromEnv) {
|
||||||
var variant = llvmInstallDir + "/bin/" + llvmConfigVariants[i];
|
for (var i = 0; i < llvmConfigVariants.length; ++i) {
|
||||||
if (File.exists(variant))
|
var variant = llvmInstallDirFromEnv + "/bin/" + llvmConfigVariants[i];
|
||||||
return variant;
|
if (File.exists(variant))
|
||||||
|
return variant;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find llvm-config* in PATH
|
// Find llvm-config* in PATH
|
||||||
@@ -44,20 +46,17 @@ QtcPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback
|
return undefined;
|
||||||
return "llvm-config";
|
|
||||||
}
|
}
|
||||||
|
condition: llvmConfig
|
||||||
|
|
||||||
|
property string llvmIncludeDir: QtcProcessOutputReader.readOutput(llvmConfig, ["--includedir"])
|
||||||
|
property string llvmLibDir: QtcProcessOutputReader.readOutput(llvmConfig, ["--libdir"])
|
||||||
|
property string llvmVersion: QtcProcessOutputReader.readOutput(llvmConfig, ["--version"])
|
||||||
|
.replace(/(\d+\.\d+).*/, "$1")
|
||||||
|
|
||||||
property string llvmIncludeDir: llvmInstallDir + "/include"
|
|
||||||
cpp.includePaths: base.concat(llvmIncludeDir)
|
cpp.includePaths: base.concat(llvmIncludeDir)
|
||||||
|
cpp.libraryPaths: base.concat(llvmLibDir)
|
||||||
property stringList llvmLibDirs: {
|
|
||||||
var list = [llvmInstallDir + "/lib"];
|
|
||||||
if (qbs.targetOS.contains("windows"))
|
|
||||||
list.push(llvmInstallDir + "/bin");
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
cpp.libraryPaths: base.concat(llvmLibDirs)
|
|
||||||
cpp.rpaths: cpp.libraryPaths
|
cpp.rpaths: cpp.libraryPaths
|
||||||
|
|
||||||
property string llvmLib: "clang"
|
property string llvmLib: "clang"
|
||||||
@@ -65,6 +64,19 @@ QtcPlugin {
|
|||||||
? ["advapi32", "shell32"] : []
|
? ["advapi32", "shell32"] : []
|
||||||
cpp.dynamicLibraries: base.concat(llvmLib).concat(additionalLibraries)
|
cpp.dynamicLibraries: base.concat(llvmLib).concat(additionalLibraries)
|
||||||
|
|
||||||
|
cpp.defines: {
|
||||||
|
var defines = base;
|
||||||
|
defines.push('CLANG_VERSION="' + llvmVersion + '"');
|
||||||
|
defines.push('CLANG_RESOURCE_DIR="' + llvmLibDir + '/clang/' + llvmVersion + '/include"');
|
||||||
|
if (clangCompletion)
|
||||||
|
defines.push("CLANG_COMPLETION");
|
||||||
|
if (clangHighlighting)
|
||||||
|
defines.push("CLANG_HIGHLIGHTING");
|
||||||
|
if (clangIndexing)
|
||||||
|
defines.push("CLANG_INDEXING");
|
||||||
|
return defines;
|
||||||
|
}
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
name: "Completion support"
|
name: "Completion support"
|
||||||
condition: product.clangCompletion
|
condition: product.clangCompletion
|
||||||
|
@@ -46,7 +46,7 @@ CMakeFileCompletionAssistProvider::CMakeFileCompletionAssistProvider(CMakeSettin
|
|||||||
CMakeFileCompletionAssistProvider::~CMakeFileCompletionAssistProvider()
|
CMakeFileCompletionAssistProvider::~CMakeFileCompletionAssistProvider()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
bool CMakeFileCompletionAssistProvider::supportsEditor(const Core::Id &editorId) const
|
bool CMakeFileCompletionAssistProvider::supportsEditor(Core::Id editorId) const
|
||||||
{
|
{
|
||||||
return editorId == CMakeProjectManager::Constants::CMAKE_EDITOR_ID;
|
return editorId == CMakeProjectManager::Constants::CMAKE_EDITOR_ID;
|
||||||
}
|
}
|
||||||
|
@@ -45,7 +45,7 @@ public:
|
|||||||
CMakeFileCompletionAssistProvider(CMakeSettingsPage *settingsPage);
|
CMakeFileCompletionAssistProvider(CMakeSettingsPage *settingsPage);
|
||||||
~CMakeFileCompletionAssistProvider();
|
~CMakeFileCompletionAssistProvider();
|
||||||
|
|
||||||
bool supportsEditor(const Core::Id &editorId) const;
|
bool supportsEditor(Core::Id editorId) const;
|
||||||
TextEditor::IAssistProcessor *createProcessor() const;
|
TextEditor::IAssistProcessor *createProcessor() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -739,7 +739,10 @@ void CMakeProject::updateApplicationAndDeploymentTargets()
|
|||||||
absoluteSourcePath.append(QLatin1Char('/'));
|
absoluteSourcePath.append(QLatin1Char('/'));
|
||||||
if (deploymentStream.device()) {
|
if (deploymentStream.device()) {
|
||||||
while (!deploymentStream.atEnd()) {
|
while (!deploymentStream.atEnd()) {
|
||||||
QStringList file = deploymentStream.readLine().split(QLatin1Char(':'));
|
QString line = deploymentStream.readLine();
|
||||||
|
if (!line.contains(QLatin1Char(':')))
|
||||||
|
continue;
|
||||||
|
QStringList file = line.split(QLatin1Char(':'));
|
||||||
deploymentData.addFile(absoluteSourcePath + file.at(0), deploymentPrefix + file.at(1));
|
deploymentData.addFile(absoluteSourcePath + file.at(0), deploymentPrefix + file.at(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -767,6 +770,7 @@ CMakeFile::CMakeFile(CMakeProject *parent, QString fileName)
|
|||||||
: Core::IDocument(parent), m_project(parent)
|
: Core::IDocument(parent), m_project(parent)
|
||||||
{
|
{
|
||||||
setId("Cmake.ProjectFile");
|
setId("Cmake.ProjectFile");
|
||||||
|
setMimeType(QLatin1String(Constants::CMAKEMIMETYPE));
|
||||||
setFilePath(fileName);
|
setFilePath(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -790,12 +794,6 @@ QString CMakeFile::suggestedFileName() const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CMakeFile::mimeType() const
|
|
||||||
{
|
|
||||||
return QLatin1String(Constants::CMAKEMIMETYPE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool CMakeFile::isModified() const
|
bool CMakeFile::isModified() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@@ -194,7 +194,6 @@ public:
|
|||||||
|
|
||||||
QString defaultPath() const;
|
QString defaultPath() const;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const;
|
||||||
QString mimeType() const;
|
|
||||||
|
|
||||||
bool isModified() const;
|
bool isModified() const;
|
||||||
bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const;
|
||||||
|
@@ -365,7 +365,7 @@ QList<Core::Id> CMakeRunConfigurationFactory::availableCreationIds(Target *paren
|
|||||||
}
|
}
|
||||||
|
|
||||||
// used to translate the ids to names to display to the user
|
// used to translate the ids to names to display to the user
|
||||||
QString CMakeRunConfigurationFactory::displayNameForId(const Core::Id id) const
|
QString CMakeRunConfigurationFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
return buildTargetFromId(id);
|
return buildTargetFromId(id);
|
||||||
}
|
}
|
||||||
@@ -377,7 +377,7 @@ bool CMakeRunConfigurationFactory::canHandle(Target *parent) const
|
|||||||
return qobject_cast<CMakeProject *>(parent->project());
|
return qobject_cast<CMakeProject *>(parent->project());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMakeRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
|
bool CMakeRunConfigurationFactory::canCreate(Target *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
if (!canHandle(parent))
|
if (!canHandle(parent))
|
||||||
return false;
|
return false;
|
||||||
@@ -385,7 +385,7 @@ bool CMakeRunConfigurationFactory::canCreate(Target *parent, const Core::Id id)
|
|||||||
return project->hasBuildTarget(buildTargetFromId(id));
|
return project->hasBuildTarget(buildTargetFromId(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
RunConfiguration *CMakeRunConfigurationFactory::doCreate(Target *parent, const Core::Id id)
|
RunConfiguration *CMakeRunConfigurationFactory::doCreate(Target *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
CMakeProject *project = static_cast<CMakeProject *>(parent->project());
|
CMakeProject *project = static_cast<CMakeProject *>(parent->project());
|
||||||
const QString title(buildTargetFromId(id));
|
const QString title(buildTargetFromId(id));
|
||||||
|
@@ -133,13 +133,13 @@ public:
|
|||||||
explicit CMakeRunConfigurationFactory(QObject *parent = 0);
|
explicit CMakeRunConfigurationFactory(QObject *parent = 0);
|
||||||
~CMakeRunConfigurationFactory();
|
~CMakeRunConfigurationFactory();
|
||||||
|
|
||||||
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
|
bool canCreate(ProjectExplorer::Target *parent, Core::Id id) const;
|
||||||
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
||||||
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const;
|
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const;
|
||||||
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product);
|
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product);
|
||||||
|
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const;
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
|
|
||||||
static Core::Id idFromBuildTarget(const QString &target);
|
static Core::Id idFromBuildTarget(const QString &target);
|
||||||
static QString buildTargetFromId(Core::Id id);
|
static QString buildTargetFromId(Core::Id id);
|
||||||
@@ -147,7 +147,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool canHandle(ProjectExplorer::Target *parent) const;
|
bool canHandle(ProjectExplorer::Target *parent) const;
|
||||||
|
|
||||||
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id);
|
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, Core::Id id);
|
||||||
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
|
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
|
||||||
const QVariantMap &map);
|
const QVariantMap &map);
|
||||||
};
|
};
|
||||||
|
@@ -70,7 +70,7 @@ MakeStep::MakeStep(BuildStepList *bsl) :
|
|||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
MakeStep::MakeStep(BuildStepList *bsl, const Core::Id id) :
|
MakeStep::MakeStep(BuildStepList *bsl, Core::Id id) :
|
||||||
AbstractProcessStep(bsl, id), m_clean(false)
|
AbstractProcessStep(bsl, id), m_clean(false)
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
@@ -452,14 +452,14 @@ MakeStepFactory::~MakeStepFactory()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MakeStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const
|
bool MakeStepFactory::canCreate(BuildStepList *parent, Core::Id id) const
|
||||||
{
|
{
|
||||||
if (parent->target()->project()->id() == Constants::CMAKEPROJECT_ID)
|
if (parent->target()->project()->id() == Constants::CMAKEPROJECT_ID)
|
||||||
return id == MS_ID;
|
return id == MS_ID;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *MakeStepFactory::create(BuildStepList *parent, const Core::Id id)
|
BuildStep *MakeStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
{
|
{
|
||||||
if (!canCreate(parent, id))
|
if (!canCreate(parent, id))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -506,7 +506,7 @@ QList<Core::Id> MakeStepFactory::availableCreationIds(ProjectExplorer::BuildStep
|
|||||||
return QList<Core::Id>();
|
return QList<Core::Id>();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MakeStepFactory::displayNameForId(const Core::Id id) const
|
QString MakeStepFactory::displayNameForId(Core::Id id) const
|
||||||
{
|
{
|
||||||
if (id == MS_ID)
|
if (id == MS_ID)
|
||||||
return tr("Make", "Display name for CMakeProjectManager::MakeStep id.");
|
return tr("Make", "Display name for CMakeProjectManager::MakeStep id.");
|
||||||
|
@@ -95,7 +95,7 @@ protected:
|
|||||||
void processFinished(int exitCode, QProcess::ExitStatus status);
|
void processFinished(int exitCode, QProcess::ExitStatus status);
|
||||||
|
|
||||||
MakeStep(ProjectExplorer::BuildStepList *bsl, MakeStep *bs);
|
MakeStep(ProjectExplorer::BuildStepList *bsl, MakeStep *bs);
|
||||||
MakeStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id);
|
MakeStep(ProjectExplorer::BuildStepList *bsl, Core::Id id);
|
||||||
|
|
||||||
bool fromMap(const QVariantMap &map);
|
bool fromMap(const QVariantMap &map);
|
||||||
|
|
||||||
@@ -145,15 +145,15 @@ public:
|
|||||||
explicit MakeStepFactory(QObject *parent = 0);
|
explicit MakeStepFactory(QObject *parent = 0);
|
||||||
virtual ~MakeStepFactory();
|
virtual ~MakeStepFactory();
|
||||||
|
|
||||||
bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
|
bool canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const;
|
||||||
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
||||||
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
|
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
|
||||||
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
|
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
|
||||||
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
||||||
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
|
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
|
||||||
|
|
||||||
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(Core::Id id) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -117,13 +117,13 @@ using namespace Core::Internal;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn QAction *ActionContainer::insertLocation(const Id &group) const
|
\fn QAction *ActionContainer::insertLocation(Id group) const
|
||||||
Returns an action representing the \a group,
|
Returns an action representing the \a group,
|
||||||
that could be used with \c{QWidget::insertAction}.
|
that could be used with \c{QWidget::insertAction}.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void ActionContainer::appendGroup(const Id &group)
|
\fn void ActionContainer::appendGroup(Id group)
|
||||||
Adds a group with the given \a identifier to the action container. Using groups
|
Adds a group with the given \a identifier to the action container. Using groups
|
||||||
you can segment your action container into logical parts and add actions and
|
you can segment your action container into logical parts and add actions and
|
||||||
menus directly to these parts.
|
menus directly to these parts.
|
||||||
@@ -132,7 +132,7 @@ using namespace Core::Internal;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void ActionContainer::addAction(Command *action, const Id &group = Id())
|
\fn void ActionContainer::addAction(Command *action, Id group = Id())
|
||||||
Add the \a action as a menu item to this action container. The action is added as the
|
Add the \a action as a menu item to this action container. The action is added as the
|
||||||
last item of the specified \a group.
|
last item of the specified \a group.
|
||||||
\sa appendGroup()
|
\sa appendGroup()
|
||||||
@@ -140,7 +140,7 @@ using namespace Core::Internal;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void ActionContainer::addMenu(ActionContainer *menu, const Id &group = Id())
|
\fn void ActionContainer::addMenu(ActionContainer *menu, Id group = Id())
|
||||||
Add the \a menu as a submenu to this action container. The menu is added as the
|
Add the \a menu as a submenu to this action container. The menu is added as the
|
||||||
last item of the specified \a group.
|
last item of the specified \a group.
|
||||||
\sa appendGroup()
|
\sa appendGroup()
|
||||||
|
@@ -40,7 +40,7 @@ namespace Internal {
|
|||||||
|
|
||||||
struct Group
|
struct Group
|
||||||
{
|
{
|
||||||
Group(const Id &id) : id(id) {}
|
Group(Id id) : id(id) {}
|
||||||
Id id;
|
Id id;
|
||||||
QList<QObject *> items; // Command * or ActionContainer *
|
QList<QObject *> items; // Command * or ActionContainer *
|
||||||
};
|
};
|
||||||
|
@@ -122,7 +122,7 @@ WizardEventLoop::WizardResult WizardEventLoop::execWizardPage(QWizard &wizard)
|
|||||||
connect(&wizard, SIGNAL(currentIdChanged(int)), eventLoop, SLOT(pageChanged(int)));
|
connect(&wizard, SIGNAL(currentIdChanged(int)), eventLoop, SLOT(pageChanged(int)));
|
||||||
connect(&wizard, SIGNAL(accepted()), eventLoop, SLOT(accepted()));
|
connect(&wizard, SIGNAL(accepted()), eventLoop, SLOT(accepted()));
|
||||||
connect(&wizard, SIGNAL(rejected()), eventLoop, SLOT(rejected()));
|
connect(&wizard, SIGNAL(rejected()), eventLoop, SLOT(rejected()));
|
||||||
wizard.setAttribute(Qt::WA_ShowModal, true);
|
wizard.setWindowFlags(wizard.windowFlags() | Qt::WindowStaysOnTopHint);
|
||||||
wizard.show();
|
wizard.show();
|
||||||
}
|
}
|
||||||
const WizardResult result = eventLoop->execWizardPageI();
|
const WizardResult result = eventLoop->execWizardPageI();
|
||||||
@@ -138,7 +138,7 @@ WizardEventLoop::WizardResult WizardEventLoop::execWizardPage(QWizard &wizard)
|
|||||||
WizardEventLoop::WizardResult WizardEventLoop::execWizardPageI()
|
WizardEventLoop::WizardResult WizardEventLoop::execWizardPageI()
|
||||||
{
|
{
|
||||||
m_result = Rejected;
|
m_result = Rejected;
|
||||||
exec(QEventLoop::DialogExec);
|
exec();
|
||||||
return m_result;
|
return m_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -92,6 +92,7 @@ SOURCES += mainwindow.cpp \
|
|||||||
fileutils.cpp \
|
fileutils.cpp \
|
||||||
featureprovider.cpp \
|
featureprovider.cpp \
|
||||||
idocument.cpp \
|
idocument.cpp \
|
||||||
|
idocumentfactory.cpp \
|
||||||
textdocument.cpp \
|
textdocument.cpp \
|
||||||
documentmanager.cpp \
|
documentmanager.cpp \
|
||||||
removefiledialog.cpp \
|
removefiledialog.cpp \
|
||||||
|
@@ -54,7 +54,7 @@ QtcPlugin {
|
|||||||
"icorelistener.cpp", "icorelistener.h",
|
"icorelistener.cpp", "icorelistener.h",
|
||||||
"id.cpp", "id.h",
|
"id.cpp", "id.h",
|
||||||
"idocument.cpp", "idocument.h",
|
"idocument.cpp", "idocument.h",
|
||||||
"idocumentfactory.h",
|
"idocumentfactory.cpp", "idocumentfactory.h",
|
||||||
"ifilewizardextension.h",
|
"ifilewizardextension.h",
|
||||||
"imode.cpp", "imode.h",
|
"imode.cpp", "imode.h",
|
||||||
"inavigationwidgetfactory.cpp", "inavigationwidgetfactory.h",
|
"inavigationwidgetfactory.cpp", "inavigationwidgetfactory.h",
|
||||||
|
@@ -31,15 +31,19 @@
|
|||||||
#include "ui_newdialog.h"
|
#include "ui_newdialog.h"
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
#include <coreplugin/documentmanager.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QModelIndex>
|
|
||||||
#include <QAbstractProxyModel>
|
#include <QAbstractProxyModel>
|
||||||
#include <QSortFilterProxyModel>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QStandardItem>
|
|
||||||
#include <QItemDelegate>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QItemDelegate>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
#include <QModelIndex>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QSortFilterProxyModel>
|
||||||
|
#include <QStandardItem>
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(Core::IWizardFactory*)
|
Q_DECLARE_METATYPE(Core::IWizardFactory*)
|
||||||
|
|
||||||
@@ -183,12 +187,16 @@ Q_DECLARE_METATYPE(WizardFactoryContainer)
|
|||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Core::Internal;
|
using namespace Core::Internal;
|
||||||
|
|
||||||
|
QString NewDialog::m_lastCategory = QString();
|
||||||
|
|
||||||
NewDialog::NewDialog(QWidget *parent) :
|
NewDialog::NewDialog(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
m_ui(new Core::Internal::Ui::NewDialog),
|
m_ui(new Core::Internal::Ui::NewDialog),
|
||||||
m_okButton(0)
|
m_okButton(0)
|
||||||
{
|
{
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||||
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
QPalette p = m_ui->frame->palette();
|
QPalette p = m_ui->frame->palette();
|
||||||
p.setColor(QPalette::Window, p.color(QPalette::Base));
|
p.setColor(QPalette::Window, p.color(QPalette::Base));
|
||||||
@@ -236,8 +244,12 @@ static bool wizardFactoryLessThan(const IWizardFactory *f1, const IWizardFactory
|
|||||||
return f1->id().compare(f2->id()) < 0;
|
return f1->id().compare(f2->id()) < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewDialog::setWizardFactories(QList<IWizardFactory*> factories)
|
void NewDialog::setWizardFactories(QList<IWizardFactory *> factories,
|
||||||
|
const QString &defaultLocation,
|
||||||
|
const QVariantMap &extraVariables)
|
||||||
{
|
{
|
||||||
|
m_defaultLocation = defaultLocation;
|
||||||
|
m_extraVariables = extraVariables;
|
||||||
qStableSort(factories.begin(), factories.end(), wizardFactoryLessThan);
|
qStableSort(factories.begin(), factories.end(), wizardFactoryLessThan);
|
||||||
|
|
||||||
m_model->clear();
|
m_model->clear();
|
||||||
@@ -287,14 +299,13 @@ void NewDialog::setWizardFactories(QList<IWizardFactory*> factories)
|
|||||||
parentItem->removeRow(0);
|
parentItem->removeRow(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::IWizardFactory *NewDialog::showDialog()
|
void NewDialog::showDialog()
|
||||||
{
|
{
|
||||||
static QString lastCategory;
|
|
||||||
QModelIndex idx;
|
QModelIndex idx;
|
||||||
|
|
||||||
if (!lastCategory.isEmpty())
|
if (!m_lastCategory.isEmpty())
|
||||||
foreach (QStandardItem* item, m_categoryItems) {
|
foreach (QStandardItem* item, m_categoryItems) {
|
||||||
if (item->data(Qt::UserRole) == lastCategory)
|
if (item->data(Qt::UserRole) == m_lastCategory)
|
||||||
idx = m_twoLevelProxyModel->mapToSource(m_model->indexFromItem(item));
|
idx = m_twoLevelProxyModel->mapToSource(m_model->indexFromItem(item));
|
||||||
}
|
}
|
||||||
if (!idx.isValid())
|
if (!idx.isValid())
|
||||||
@@ -312,18 +323,7 @@ Core::IWizardFactory *NewDialog::showDialog()
|
|||||||
currentItemChanged(m_ui->templatesView->rootIndex().child(0,0));
|
currentItemChanged(m_ui->templatesView->rootIndex().child(0,0));
|
||||||
|
|
||||||
updateOkButton();
|
updateOkButton();
|
||||||
|
show();
|
||||||
const int retVal = exec();
|
|
||||||
|
|
||||||
idx = m_ui->templateCategoryView->currentIndex();
|
|
||||||
QStandardItem *currentItem = m_model->itemFromIndex(m_twoLevelProxyModel->mapToSource(idx));
|
|
||||||
if (currentItem)
|
|
||||||
lastCategory = currentItem->data(Qt::UserRole).toString();
|
|
||||||
|
|
||||||
if (retVal != Accepted)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return currentWizardFactory();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString NewDialog::selectedPlatform() const
|
QString NewDialog::selectedPlatform() const
|
||||||
@@ -333,6 +333,18 @@ QString NewDialog::selectedPlatform() const
|
|||||||
return m_ui->comboBox->itemData(index).toString();
|
return m_ui->comboBox->itemData(index).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NewDialog::event(QEvent *event)
|
||||||
|
{
|
||||||
|
if (event->type() == QEvent::ShortcutOverride) {
|
||||||
|
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
|
||||||
|
if (ke->key() == Qt::Key_Escape && !ke->modifiers()) {
|
||||||
|
ke->accept();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QDialog::event(event);
|
||||||
|
}
|
||||||
|
|
||||||
NewDialog::~NewDialog()
|
NewDialog::~NewDialog()
|
||||||
{
|
{
|
||||||
delete m_ui;
|
delete m_ui;
|
||||||
@@ -422,10 +434,48 @@ void NewDialog::currentItemChanged(const QModelIndex &index)
|
|||||||
updateOkButton();
|
updateOkButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NewDialog::saveState()
|
||||||
|
{
|
||||||
|
QModelIndex idx = m_ui->templateCategoryView->currentIndex();
|
||||||
|
QStandardItem *currentItem = m_model->itemFromIndex(m_twoLevelProxyModel->mapToSource(idx));
|
||||||
|
if (currentItem)
|
||||||
|
m_lastCategory = currentItem->data(Qt::UserRole).toString();
|
||||||
|
}
|
||||||
|
|
||||||
void NewDialog::okButtonClicked()
|
void NewDialog::okButtonClicked()
|
||||||
{
|
{
|
||||||
if (m_ui->templatesView->currentIndex().isValid())
|
if (m_ui->templatesView->currentIndex().isValid()) {
|
||||||
accept();
|
hide();
|
||||||
|
saveState();
|
||||||
|
|
||||||
|
IWizardFactory *wizard = currentWizardFactory();
|
||||||
|
QTC_ASSERT(wizard, accept(); return);
|
||||||
|
QString path = m_defaultLocation;
|
||||||
|
if (path.isEmpty()) {
|
||||||
|
switch (wizard->kind()) {
|
||||||
|
case IWizardFactory::ProjectWizard:
|
||||||
|
// Project wizards: Check for projects directory or
|
||||||
|
// use last visited directory of file dialog. Never start
|
||||||
|
// at current.
|
||||||
|
path = DocumentManager::useProjectsDirectory() ?
|
||||||
|
DocumentManager::projectsDirectory() :
|
||||||
|
DocumentManager::fileDialogLastVisitedDirectory();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
path = DocumentManager::fileDialogInitialDirectory();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wizard->runWizard(path, ICore::dialogParent(), selectedPlatform(), m_extraVariables);
|
||||||
|
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void NewDialog::reject()
|
||||||
|
{
|
||||||
|
saveState();
|
||||||
|
QDialog::reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewDialog::updateOkButton()
|
void NewDialog::updateOkButton()
|
||||||
|
@@ -60,21 +60,28 @@ public:
|
|||||||
explicit NewDialog(QWidget *parent);
|
explicit NewDialog(QWidget *parent);
|
||||||
virtual ~NewDialog();
|
virtual ~NewDialog();
|
||||||
|
|
||||||
void setWizardFactories(QList<IWizardFactory*> factories);
|
void setWizardFactories(QList<IWizardFactory*> factories, const QString &defaultLocation, const QVariantMap &extraVariables);
|
||||||
|
|
||||||
Core::IWizardFactory *showDialog();
|
void showDialog();
|
||||||
QString selectedPlatform() const;
|
QString selectedPlatform() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool event(QEvent *);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void currentCategoryChanged(const QModelIndex &);
|
void currentCategoryChanged(const QModelIndex &);
|
||||||
void currentItemChanged(const QModelIndex &);
|
void currentItemChanged(const QModelIndex &);
|
||||||
void okButtonClicked();
|
void okButtonClicked();
|
||||||
|
void reject();
|
||||||
void updateOkButton();
|
void updateOkButton();
|
||||||
void setSelectedPlatform(const QString &platform);
|
void setSelectedPlatform(const QString &platform);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Core::IWizardFactory *currentWizardFactory() const;
|
Core::IWizardFactory *currentWizardFactory() const;
|
||||||
void addItem(QStandardItem *topLevelCategoryItem, IWizardFactory *factory);
|
void addItem(QStandardItem *topLevelCategoryItem, IWizardFactory *factory);
|
||||||
|
void saveState();
|
||||||
|
|
||||||
|
static QString m_lastCategory;
|
||||||
|
|
||||||
Ui::NewDialog *m_ui;
|
Ui::NewDialog *m_ui;
|
||||||
QStandardItemModel *m_model;
|
QStandardItemModel *m_model;
|
||||||
@@ -83,6 +90,8 @@ private:
|
|||||||
QPushButton *m_okButton;
|
QPushButton *m_okButton;
|
||||||
QIcon m_dummyIcon;
|
QIcon m_dummyIcon;
|
||||||
QList<QStandardItem*> m_categoryItems;
|
QList<QStandardItem*> m_categoryItems;
|
||||||
|
QString m_defaultLocation;
|
||||||
|
QVariantMap m_extraVariables;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/fancylineedit.h>
|
#include <utils/fancylineedit.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
@@ -353,6 +354,9 @@ void SettingsDialog::showPage(Id categoryId, Id pageId)
|
|||||||
initialPage = Id::fromSetting(settings->value(QLatin1String(pageKeyC)));
|
initialPage = Id::fromSetting(settings->value(QLatin1String(pageKeyC)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!initialCategory.isValid()) // no category given and no old setting
|
||||||
|
return;
|
||||||
|
|
||||||
int initialCategoryIndex = -1;
|
int initialCategoryIndex = -1;
|
||||||
int initialPageIndex = -1;
|
int initialPageIndex = -1;
|
||||||
const QList<Category*> &categories = m_model->categories();
|
const QList<Category*> &categories = m_model->categories();
|
||||||
@@ -360,13 +364,22 @@ void SettingsDialog::showPage(Id categoryId, Id pageId)
|
|||||||
Category *category = categories.at(i);
|
Category *category = categories.at(i);
|
||||||
if (category->id == initialCategory) {
|
if (category->id == initialCategory) {
|
||||||
initialCategoryIndex = i;
|
initialCategoryIndex = i;
|
||||||
for (int j = 0; j < category->pages.size(); ++j) {
|
if (initialPage.isValid()) {
|
||||||
IOptionsPage *page = category->pages.at(j);
|
for (int j = 0; j < category->pages.size(); ++j) {
|
||||||
if (page->id() == initialPage)
|
IOptionsPage *page = category->pages.at(j);
|
||||||
initialPageIndex = j;
|
if (page->id() == initialPage)
|
||||||
|
initialPageIndex = j;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QTC_ASSERT(initialCategoryIndex != -1,
|
||||||
|
qDebug("Unknown category: %s", initialCategory.name().constData()); return);
|
||||||
|
QTC_ASSERT(!initialPage.isValid() || initialPageIndex != -1,
|
||||||
|
qDebug("Unknown page: %s", initialPage.name().constData()));
|
||||||
|
|
||||||
if (initialCategoryIndex != -1) {
|
if (initialCategoryIndex != -1) {
|
||||||
const QModelIndex modelIndex = m_proxyModel->mapFromSource(m_model->index(initialCategoryIndex));
|
const QModelIndex modelIndex = m_proxyModel->mapFromSource(m_model->index(initialCategoryIndex));
|
||||||
m_categoryList->setCurrentIndex(modelIndex);
|
m_categoryList->setCurrentIndex(modelIndex);
|
||||||
|
@@ -1133,7 +1133,7 @@ void DocumentManager::checkForReload()
|
|||||||
\a editorId defaults to the empty id, which lets \QC figure out
|
\a editorId defaults to the empty id, which lets \QC figure out
|
||||||
the best editor itself.
|
the best editor itself.
|
||||||
*/
|
*/
|
||||||
void DocumentManager::addToRecentFiles(const QString &fileName, const Id &editorId)
|
void DocumentManager::addToRecentFiles(const QString &fileName, Id editorId)
|
||||||
{
|
{
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
@@ -74,7 +74,7 @@ public:
|
|||||||
static void unexpectFileChange(const QString &fileName);
|
static void unexpectFileChange(const QString &fileName);
|
||||||
|
|
||||||
// recent files
|
// recent files
|
||||||
static void addToRecentFiles(const QString &fileName, const Id &editorId = Id());
|
static void addToRecentFiles(const QString &fileName, Id editorId = Id());
|
||||||
Q_SLOT void clearRecentFiles();
|
Q_SLOT void clearRecentFiles();
|
||||||
static QList<RecentFile> recentFiles();
|
static QList<RecentFile> recentFiles();
|
||||||
|
|
||||||
|
@@ -27,12 +27,13 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "editmode.h"
|
|
||||||
#include "coreconstants.h"
|
#include "coreconstants.h"
|
||||||
|
#include "editmode.h"
|
||||||
|
#include "icore.h"
|
||||||
#include "modemanager.h"
|
#include "modemanager.h"
|
||||||
#include "minisplitter.h"
|
#include "minisplitter.h"
|
||||||
#include "outputpane.h"
|
|
||||||
#include "navigationwidget.h"
|
#include "navigationwidget.h"
|
||||||
|
#include "outputpane.h"
|
||||||
#include "rightpane.h"
|
#include "rightpane.h"
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
@@ -85,9 +86,13 @@ EditMode::EditMode() :
|
|||||||
this, SLOT(grabEditorManager(Core::IMode*)));
|
this, SLOT(grabEditorManager(Core::IMode*)));
|
||||||
m_splitter->setFocusProxy(EditorManager::instance());
|
m_splitter->setFocusProxy(EditorManager::instance());
|
||||||
|
|
||||||
|
IContext *modeContextObject = new IContext(this);
|
||||||
|
modeContextObject->setContext(Context(Constants::C_EDITORMANAGER));
|
||||||
|
modeContextObject->setWidget(m_splitter);
|
||||||
|
ICore::addContextObject(modeContextObject);
|
||||||
|
|
||||||
setWidget(m_splitter);
|
setWidget(m_splitter);
|
||||||
setContext(Context(Constants::C_EDIT_MODE,
|
setContext(Context(Constants::C_EDIT_MODE,
|
||||||
Constants::C_EDITORMANAGER,
|
|
||||||
Constants::C_NAVIGATION_PANE));
|
Constants::C_NAVIGATION_PANE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -175,7 +175,7 @@ void DocumentModel::addEditor(IEditor *editor, bool *isNewDocument)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentModel::addRestoredDocument(const QString &fileName, const QString &displayName, const Id &id)
|
void DocumentModel::addRestoredDocument(const QString &fileName, const QString &displayName, Id id)
|
||||||
{
|
{
|
||||||
Entry *entry = new Entry;
|
Entry *entry = new Entry;
|
||||||
entry->m_fileName = fileName;
|
entry->m_fileName = fileName;
|
||||||
|
@@ -83,7 +83,7 @@ public:
|
|||||||
|
|
||||||
// editor manager related functions, nobody else should call it
|
// editor manager related functions, nobody else should call it
|
||||||
static void addEditor(IEditor *editor, bool *isNewDocument);
|
static void addEditor(IEditor *editor, bool *isNewDocument);
|
||||||
static void addRestoredDocument(const QString &fileName, const QString &displayName, const Id &id);
|
static void addRestoredDocument(const QString &fileName, const QString &displayName, Id id);
|
||||||
static Entry *firstRestoredEntry();
|
static Entry *firstRestoredEntry();
|
||||||
static void removeEditor(IEditor *editor, bool *lastOneForDocument);
|
static void removeEditor(IEditor *editor, bool *lastOneForDocument);
|
||||||
static void removeDocument(const QString &fileName);
|
static void removeDocument(const QString &fileName);
|
||||||
|
@@ -1393,7 +1393,7 @@ EditorManager::ExternalEditorList
|
|||||||
/* For something that has a 'QString id' (IEditorFactory
|
/* For something that has a 'QString id' (IEditorFactory
|
||||||
* or IExternalEditor), find the one matching a id. */
|
* or IExternalEditor), find the one matching a id. */
|
||||||
template <class EditorFactoryLike>
|
template <class EditorFactoryLike>
|
||||||
EditorFactoryLike *findById(const Core::Id &id)
|
EditorFactoryLike *findById(Core::Id id)
|
||||||
{
|
{
|
||||||
return ExtensionSystem::PluginManager::getObject<EditorFactoryLike>(
|
return ExtensionSystem::PluginManager::getObject<EditorFactoryLike>(
|
||||||
[&id](EditorFactoryLike *efl) {
|
[&id](EditorFactoryLike *efl) {
|
||||||
@@ -1401,7 +1401,7 @@ EditorFactoryLike *findById(const Core::Id &id)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
IEditor *EditorManager::createEditor(const Id &editorId, const QString &fileName)
|
IEditor *EditorManager::createEditor(Id editorId, const QString &fileName)
|
||||||
{
|
{
|
||||||
if (debugEditorManager)
|
if (debugEditorManager)
|
||||||
qDebug() << Q_FUNC_INFO << editorId.name() << fileName;
|
qDebug() << Q_FUNC_INFO << editorId.name() << fileName;
|
||||||
@@ -1503,7 +1503,7 @@ Core::Id EditorManager::getOpenWithEditorId(const QString &fileName,
|
|||||||
return selectedId;
|
return selectedId;
|
||||||
}
|
}
|
||||||
|
|
||||||
IEditor *EditorManager::openEditor(const QString &fileName, const Id &editorId,
|
IEditor *EditorManager::openEditor(const QString &fileName, Id editorId,
|
||||||
OpenEditorFlags flags, bool *newEditor)
|
OpenEditorFlags flags, bool *newEditor)
|
||||||
{
|
{
|
||||||
if (flags & EditorManager::OpenInOtherSplit) {
|
if (flags & EditorManager::OpenInOtherSplit) {
|
||||||
@@ -1518,7 +1518,7 @@ IEditor *EditorManager::openEditor(const QString &fileName, const Id &editorId,
|
|||||||
}
|
}
|
||||||
|
|
||||||
IEditor *EditorManager::openEditorAt(const QString &fileName, int line, int column,
|
IEditor *EditorManager::openEditorAt(const QString &fileName, int line, int column,
|
||||||
const Id &editorId, OpenEditorFlags flags, bool *newEditor)
|
Id editorId, OpenEditorFlags flags, bool *newEditor)
|
||||||
{
|
{
|
||||||
m_instance->cutForwardNavigationHistory();
|
m_instance->cutForwardNavigationHistory();
|
||||||
m_instance->addCurrentPositionToNavigationHistory();
|
m_instance->addCurrentPositionToNavigationHistory();
|
||||||
@@ -1586,7 +1586,7 @@ bool EditorManager::isAutoSaveFile(const QString &fileName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QString &fileName,
|
IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QString &fileName,
|
||||||
const Id &editorId, OpenEditorFlags flags, bool *newEditor)
|
Id editorId, OpenEditorFlags flags, bool *newEditor)
|
||||||
{
|
{
|
||||||
if (debugEditorManager)
|
if (debugEditorManager)
|
||||||
qDebug() << Q_FUNC_INFO << fileName << editorId.name();
|
qDebug() << Q_FUNC_INFO << fileName << editorId.name();
|
||||||
@@ -1654,7 +1654,7 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EditorManager::openExternalEditor(const QString &fileName, const Core::Id &editorId)
|
bool EditorManager::openExternalEditor(const QString &fileName, Core::Id editorId)
|
||||||
{
|
{
|
||||||
IExternalEditor *ee = findById<IExternalEditor>(editorId);
|
IExternalEditor *ee = findById<IExternalEditor>(editorId);
|
||||||
if (!ee)
|
if (!ee)
|
||||||
@@ -1676,7 +1676,7 @@ QStringList EditorManager::getOpenFileNames()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IEditor *EditorManager::openEditorWithContents(const Id &editorId,
|
IEditor *EditorManager::openEditorWithContents(Id editorId,
|
||||||
QString *titlePattern,
|
QString *titlePattern,
|
||||||
const QByteArray &contents,
|
const QByteArray &contents,
|
||||||
OpenEditorFlags flags)
|
OpenEditorFlags flags)
|
||||||
|
@@ -109,16 +109,16 @@ public:
|
|||||||
Q_DECLARE_FLAGS(OpenEditorFlags, OpenEditorFlag)
|
Q_DECLARE_FLAGS(OpenEditorFlags, OpenEditorFlag)
|
||||||
|
|
||||||
static QString splitLineNumber(QString *fileName);
|
static QString splitLineNumber(QString *fileName);
|
||||||
static IEditor *openEditor(const QString &fileName, const Id &editorId = Id(),
|
static IEditor *openEditor(const QString &fileName, Id editorId = Id(),
|
||||||
OpenEditorFlags flags = NoFlags, bool *newEditor = 0);
|
OpenEditorFlags flags = NoFlags, bool *newEditor = 0);
|
||||||
static IEditor *openEditorAt(const QString &fileName, int line, int column = 0,
|
static IEditor *openEditorAt(const QString &fileName, int line, int column = 0,
|
||||||
const Id &editorId = Id(), OpenEditorFlags flags = NoFlags,
|
Id editorId = Id(), OpenEditorFlags flags = NoFlags,
|
||||||
bool *newEditor = 0);
|
bool *newEditor = 0);
|
||||||
static IEditor *openEditorWithContents(const Id &editorId, QString *titlePattern = 0,
|
static IEditor *openEditorWithContents(Id editorId, QString *titlePattern = 0,
|
||||||
const QByteArray &contents = QByteArray(),
|
const QByteArray &contents = QByteArray(),
|
||||||
OpenEditorFlags flags = NoFlags);
|
OpenEditorFlags flags = NoFlags);
|
||||||
|
|
||||||
static bool openExternalEditor(const QString &fileName, const Id &editorId);
|
static bool openExternalEditor(const QString &fileName, Id editorId);
|
||||||
|
|
||||||
static QStringList getOpenFileNames();
|
static QStringList getOpenFileNames();
|
||||||
static Id getOpenWithEditorId(const QString &fileName, bool *isExternalEditor = 0);
|
static Id getOpenWithEditorId(const QString &fileName, bool *isExternalEditor = 0);
|
||||||
@@ -252,7 +252,7 @@ private:
|
|||||||
~EditorManager();
|
~EditorManager();
|
||||||
static void init();
|
static void init();
|
||||||
|
|
||||||
static IEditor *createEditor(const Id &id = Id(), const QString &fileName = QString());
|
static IEditor *createEditor(Id id = Id(), const QString &fileName = QString());
|
||||||
static void addEditor(IEditor *editor);
|
static void addEditor(IEditor *editor);
|
||||||
static void removeEditor(IEditor *editor);
|
static void removeEditor(IEditor *editor);
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@ private:
|
|||||||
OpenEditorFlags flags = NoFlags);
|
OpenEditorFlags flags = NoFlags);
|
||||||
static void activateView(Internal::EditorView *view);
|
static void activateView(Internal::EditorView *view);
|
||||||
static IEditor *openEditor(Internal::EditorView *view, const QString &fileName,
|
static IEditor *openEditor(Internal::EditorView *view, const QString &fileName,
|
||||||
const Id &id = Id(), OpenEditorFlags flags = NoFlags, bool *newEditor = 0);
|
Id id = Id(), OpenEditorFlags flags = NoFlags, bool *newEditor = 0);
|
||||||
static int visibleDocumentsCount();
|
static int visibleDocumentsCount();
|
||||||
|
|
||||||
static void setCurrentEditor(IEditor *editor, bool ignoreNavigationHistory = false);
|
static void setCurrentEditor(IEditor *editor, bool ignoreNavigationHistory = false);
|
||||||
|
@@ -31,10 +31,14 @@
|
|||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
Core::IDocument *Core::IEditorFactory::open(const QString &)
|
Core::IEditorFactory::IEditorFactory(QObject *parent)
|
||||||
|
: IDocumentFactory(parent)
|
||||||
{
|
{
|
||||||
qWarning("This should never be called, use IEditorFactor::createEditor, "
|
setOpener([](const QString &) -> Core::IDocument * {
|
||||||
"or EditorManager::openEditor instead!");
|
qWarning("This should never be called, use IEditorFactor::createEditor, "
|
||||||
QTC_CHECK(false);
|
"or EditorManager::openEditor instead!");
|
||||||
return 0;
|
QTC_CHECK(false);
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,10 +41,9 @@ class CORE_EXPORT IEditorFactory : public Core::IDocumentFactory
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IEditorFactory(QObject *parent = 0) : IDocumentFactory(parent) {}
|
IEditorFactory(QObject *parent = 0);
|
||||||
|
|
||||||
virtual IEditor *createEditor() = 0;
|
virtual IEditor *createEditor() = 0;
|
||||||
virtual IDocument *open(const QString &);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
@@ -133,7 +133,7 @@ void BaseTextFind::resetIncrementalSearch()
|
|||||||
d->m_incrementalWrappedState = false;
|
d->m_incrementalWrappedState = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseTextFind::clearResults()
|
void BaseTextFind::clearHighlights()
|
||||||
{
|
{
|
||||||
emit highlightAll(QString(), 0);
|
emit highlightAll(QString(), 0);
|
||||||
}
|
}
|
||||||
|
@@ -53,7 +53,7 @@ public:
|
|||||||
bool supportsReplace() const;
|
bool supportsReplace() const;
|
||||||
FindFlags supportedFindFlags() const;
|
FindFlags supportedFindFlags() const;
|
||||||
void resetIncrementalSearch();
|
void resetIncrementalSearch();
|
||||||
void clearResults();
|
void clearHighlights();
|
||||||
QString currentFindString() const;
|
QString currentFindString() const;
|
||||||
QString completedFindString() const;
|
QString completedFindString() const;
|
||||||
|
|
||||||
|
@@ -60,10 +60,10 @@ void CurrentDocumentFind::resetIncrementalSearch()
|
|||||||
m_currentFind->resetIncrementalSearch();
|
m_currentFind->resetIncrementalSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CurrentDocumentFind::clearResults()
|
void CurrentDocumentFind::clearHighlights()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_currentFind, return);
|
QTC_ASSERT(m_currentFind, return);
|
||||||
m_currentFind->clearResults();
|
m_currentFind->clearHighlights();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CurrentDocumentFind::isEnabled() const
|
bool CurrentDocumentFind::isEnabled() const
|
||||||
@@ -175,7 +175,7 @@ void CurrentDocumentFind::acceptCandidate()
|
|||||||
return;
|
return;
|
||||||
removeFindSupportConnections();
|
removeFindSupportConnections();
|
||||||
if (m_currentFind)
|
if (m_currentFind)
|
||||||
m_currentFind->clearResults();
|
m_currentFind->clearHighlights();
|
||||||
|
|
||||||
if (m_currentWidget)
|
if (m_currentWidget)
|
||||||
disconnect(Aggregation::Aggregate::parentAggregate(m_currentWidget), SIGNAL(changed()),
|
disconnect(Aggregation::Aggregate::parentAggregate(m_currentWidget), SIGNAL(changed()),
|
||||||
|
@@ -45,7 +45,7 @@ public:
|
|||||||
CurrentDocumentFind();
|
CurrentDocumentFind();
|
||||||
|
|
||||||
void resetIncrementalSearch();
|
void resetIncrementalSearch();
|
||||||
void clearResults();
|
void clearHighlights();
|
||||||
bool supportsReplace() const;
|
bool supportsReplace() const;
|
||||||
FindFlags supportedFindFlags() const;
|
FindFlags supportedFindFlags() const;
|
||||||
QString currentFindString() const;
|
QString currentFindString() const;
|
||||||
|
@@ -325,8 +325,11 @@ bool FindToolBar::eventFilter(QObject *obj, QEvent *event)
|
|||||||
void FindToolBar::adaptToCandidate()
|
void FindToolBar::adaptToCandidate()
|
||||||
{
|
{
|
||||||
updateFindAction();
|
updateFindAction();
|
||||||
if (findToolBarPlaceHolder() == Core::FindToolBarPlaceHolder::getCurrent())
|
if (findToolBarPlaceHolder() == Core::FindToolBarPlaceHolder::getCurrent()) {
|
||||||
m_currentDocumentFind->acceptCandidate();
|
m_currentDocumentFind->acceptCandidate();
|
||||||
|
if (isVisible())
|
||||||
|
m_currentDocumentFind->highlightAll(getFindText(), effectiveFindFlags());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FindToolBar::updateFindAction()
|
void FindToolBar::updateFindAction()
|
||||||
@@ -406,7 +409,7 @@ void FindToolBar::invokeReplaceEnter()
|
|||||||
void FindToolBar::invokeClearResults()
|
void FindToolBar::invokeClearResults()
|
||||||
{
|
{
|
||||||
if (m_currentDocumentFind->isEnabled())
|
if (m_currentDocumentFind->isEnabled())
|
||||||
m_currentDocumentFind->clearResults();
|
m_currentDocumentFind->clearHighlights();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -471,7 +474,7 @@ void FindToolBar::invokeFindIncremental()
|
|||||||
if (result == IFindSupport::NotYetFound)
|
if (result == IFindSupport::NotYetFound)
|
||||||
m_findIncrementalTimer.start(50);
|
m_findIncrementalTimer.start(50);
|
||||||
if (text.isEmpty())
|
if (text.isEmpty())
|
||||||
m_currentDocumentFind->clearResults();
|
m_currentDocumentFind->clearHighlights();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ public:
|
|||||||
virtual bool supportsReplace() const = 0;
|
virtual bool supportsReplace() const = 0;
|
||||||
virtual FindFlags supportedFindFlags() const = 0;
|
virtual FindFlags supportedFindFlags() const = 0;
|
||||||
virtual void resetIncrementalSearch() = 0;
|
virtual void resetIncrementalSearch() = 0;
|
||||||
virtual void clearResults() = 0;
|
virtual void clearHighlights() = 0;
|
||||||
virtual QString currentFindString() const = 0;
|
virtual QString currentFindString() const = 0;
|
||||||
virtual QString completedFindString() const = 0;
|
virtual QString completedFindString() const = 0;
|
||||||
|
|
||||||
|
@@ -83,7 +83,7 @@ void TreeViewFind::resetIncrementalSearch()
|
|||||||
d->m_incrementalWrappedState = false;
|
d->m_incrementalWrappedState = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TreeViewFind::clearResults()
|
void TreeViewFind::clearHighlights()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -56,7 +56,7 @@ public:
|
|||||||
bool supportsReplace() const;
|
bool supportsReplace() const;
|
||||||
FindFlags supportedFindFlags() const;
|
FindFlags supportedFindFlags() const;
|
||||||
void resetIncrementalSearch();
|
void resetIncrementalSearch();
|
||||||
void clearResults();
|
void clearHighlights();
|
||||||
QString currentFindString() const;
|
QString currentFindString() const;
|
||||||
QString completedFindString() const;
|
QString completedFindString() const;
|
||||||
|
|
||||||
|
@@ -141,7 +141,7 @@ Id GeneratedFile::editorId() const
|
|||||||
return m_d->editorId;
|
return m_d->editorId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneratedFile::setEditorId(const Id &id)
|
void GeneratedFile::setEditorId(Id id)
|
||||||
{
|
{
|
||||||
m_d->editorId = id;
|
m_d->editorId = id;
|
||||||
}
|
}
|
||||||
|
@@ -77,7 +77,7 @@ public:
|
|||||||
|
|
||||||
// Id of editor to open the file with
|
// Id of editor to open the file with
|
||||||
Id editorId() const;
|
Id editorId() const;
|
||||||
void setEditorId(const Id &id);
|
void setEditorId(Id id);
|
||||||
|
|
||||||
bool write(QString *errorMessage) const;
|
bool write(QString *errorMessage) const;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user