Merge remote-tracking branch 'origin/master' into 4.14

Change-Id: I5efcf81bd8f5a5e6f0e5bbcc2fc1f5439e83acef
This commit is contained in:
Eike Ziller
2020-10-08 12:07:09 +02:00
18 changed files with 64 additions and 125 deletions

View File

@@ -293,9 +293,6 @@ public:
{ return _beginLine; } { return _beginLine; }
private: private:
void setArguments(const QVector<Block> &arguments)
{ _arguments = arguments; }
void addArgument(const Block &block) void addArgument(const Block &block)
{ _arguments.append(block); } { _arguments.append(block); }

View File

@@ -225,18 +225,6 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in
return index; return index;
} }
bool ExpressionUnderCursor::isAccessToken(const Token &tk)
{
switch (tk.kind()) {
case T_COLON_COLON:
case T_DOT: case T_ARROW:
case T_DOT_STAR: case T_ARROW_STAR:
return true;
default:
return false;
} // switch
}
QString ExpressionUnderCursor::operator()(const QTextCursor &cursor) QString ExpressionUnderCursor::operator()(const QTextCursor &cursor)
{ {
BackwardsScanner scanner(cursor, _languageFeatures); BackwardsScanner scanner(cursor, _languageFeatures);

View File

@@ -50,7 +50,6 @@ public:
private: private:
int startOfExpression(BackwardsScanner &tk, int index); int startOfExpression(BackwardsScanner &tk, int index);
int startOfExpression_helper(BackwardsScanner &tk, int index); int startOfExpression_helper(BackwardsScanner &tk, int index);
bool isAccessToken(const Token &tk);
private: private:
bool _jumpedComma; bool _jumpedComma;

View File

@@ -1080,25 +1080,6 @@ void ObjectValue::accept(ValueVisitor *visitor) const
visitor->visit(this); visitor->visit(this);
} }
bool ObjectValue::checkPrototype(const ObjectValue *, QSet<const ObjectValue *> *) const
{
#if 0
const int previousSize = processed->size();
processed->insert(this);
if (previousSize != processed->size()) {
if (this == proto)
return false;
if (prototype() && ! prototype()->checkPrototype(proto, processed))
return false;
return true;
}
#endif
return false;
}
void ObjectValue::processMembers(MemberProcessor *processor) const void ObjectValue::processMembers(MemberProcessor *processor) const
{ {
for (auto it = m_members.cbegin(), end = m_members.cend(); it != end; ++it) { for (auto it = m_members.cbegin(), end = m_members.cend(); it != end; ++it) {

View File

@@ -526,10 +526,6 @@ public:
QString originId() const QString originId() const
{ return m_originId; } { return m_originId; }
private:
bool checkPrototype(const ObjectValue *prototype, QSet<const ObjectValue *> *processed) const;
private: private:
ValueOwner *m_valueOwner; ValueOwner *m_valueOwner;
QHash<QString, PropertyData> m_members; QHash<QString, PropertyData> m_members;

View File

@@ -128,8 +128,10 @@ struct SshConnection::SshConnectionPrivate
"-o", "Port=" + QString::number(connParams.port())}; "-o", "Port=" + QString::number(connParams.port())};
const bool keyOnly = connParams.authenticationType == const bool keyOnly = connParams.authenticationType ==
SshConnectionParameters::AuthenticationTypeSpecificKey; SshConnectionParameters::AuthenticationTypeSpecificKey;
if (keyOnly) if (keyOnly) {
args << "-o" << "IdentitiesOnly=yes";
args << "-i" << connParams.privateKeyFile; args << "-i" << connParams.privateKeyFile;
}
if (keyOnly || SshSettings::askpassFilePath().isEmpty()) if (keyOnly || SshSettings::askpassFilePath().isEmpty())
args << "-o" << "BatchMode=yes"; args << "-o" << "BatchMode=yes";
if (sharingEnabled) if (sharingEnabled)

View File

@@ -278,7 +278,7 @@ bool AndroidAvdManager::startAvdAsync(const QString &avdName) const
if (AndroidConfigurations::force32bitEmulator()) if (AndroidConfigurations::force32bitEmulator())
arguments << "-force-32bit"; arguments << "-force-32bit";
arguments << "-partition-size" << QString::number(m_config.partitionSize()) arguments << m_config.emulatorArgs()
<< "-avd" << avdName; << "-avd" << avdName;
qCDebug(avdManagerLog) << "Running command (startAvdAsync):" qCDebug(avdManagerLog) << "Running command (startAvdAsync):"
<< CommandLine(m_config.emulatorToolPath(), arguments).toUserOutput(); << CommandLine(m_config.emulatorToolPath(), arguments).toUserOutput();

View File

@@ -116,7 +116,7 @@ namespace {
const QLatin1String OpenJDKLocationKey("OpenJDKLocation"); const QLatin1String OpenJDKLocationKey("OpenJDKLocation");
const QLatin1String OpenSslPriLocationKey("OpenSSLPriLocation"); const QLatin1String OpenSslPriLocationKey("OpenSSLPriLocation");
const QLatin1String AutomaticKitCreationKey("AutomatiKitCreation"); const QLatin1String AutomaticKitCreationKey("AutomatiKitCreation");
const QLatin1String PartitionSizeKey("PartitionSize"); const QLatin1String EmulatorArgsKey("EmulatorArgs");
const QLatin1String ArmToolchainPrefix("arm-linux-androideabi"); const QLatin1String ArmToolchainPrefix("arm-linux-androideabi");
const QLatin1String X86ToolchainPrefix("x86"); const QLatin1String X86ToolchainPrefix("x86");
@@ -224,7 +224,8 @@ QLatin1String AndroidConfig::displayName(const Abi &abi)
void AndroidConfig::load(const QSettings &settings) void AndroidConfig::load(const QSettings &settings)
{ {
// user settings // user settings
m_partitionSize = settings.value(PartitionSizeKey, 1024).toInt(); m_emulatorArgs = settings.value(EmulatorArgsKey,
QStringList({"-netdelay", "none", "-netspeed", "full"})).toStringList();
m_sdkLocation = FilePath::fromString(settings.value(SDKLocationKey).toString()); m_sdkLocation = FilePath::fromString(settings.value(SDKLocationKey).toString());
m_customNdkList = settings.value(CustomNdkLocationsKey).toStringList(); m_customNdkList = settings.value(CustomNdkLocationsKey).toStringList();
m_sdkManagerToolArgs = settings.value(SDKManagerToolArgsKey).toStringList(); m_sdkManagerToolArgs = settings.value(SDKManagerToolArgsKey).toStringList();
@@ -262,7 +263,7 @@ void AndroidConfig::save(QSettings &settings) const
settings.setValue(SDKManagerToolArgsKey, m_sdkManagerToolArgs); settings.setValue(SDKManagerToolArgsKey, m_sdkManagerToolArgs);
settings.setValue(OpenJDKLocationKey, m_openJDKLocation.toString()); settings.setValue(OpenJDKLocationKey, m_openJDKLocation.toString());
settings.setValue(OpenSslPriLocationKey, m_openSslLocation.toString()); settings.setValue(OpenSslPriLocationKey, m_openSslLocation.toString());
settings.setValue(PartitionSizeKey, m_partitionSize); settings.setValue(EmulatorArgsKey, m_emulatorArgs);
settings.setValue(AutomaticKitCreationKey, m_automaticKitCreation); settings.setValue(AutomaticKitCreationKey, m_automaticKitCreation);
settings.setValue(SdkFullyConfiguredKey, m_sdkFullyConfigured); settings.setValue(SdkFullyConfiguredKey, m_sdkFullyConfigured);
} }
@@ -990,14 +991,14 @@ QString AndroidConfig::toolchainHostFromNdk(const FilePath &ndkPath) const
return toolchainHost; return toolchainHost;
} }
unsigned AndroidConfig::partitionSize() const QStringList AndroidConfig::emulatorArgs() const
{ {
return m_partitionSize; return m_emulatorArgs;
} }
void AndroidConfig::setPartitionSize(unsigned partitionSize) void AndroidConfig::setEmulatorArgs(const QStringList &args)
{ {
m_partitionSize = partitionSize; m_emulatorArgs = args;
} }
bool AndroidConfig::automaticKitCreation() const bool AndroidConfig::automaticKitCreation() const

View File

@@ -146,8 +146,8 @@ public:
QString toolchainHost(const QtSupport::BaseQtVersion *qtVersion) const; QString toolchainHost(const QtSupport::BaseQtVersion *qtVersion) const;
QString toolchainHostFromNdk(const Utils::FilePath &ndkPath) const; QString toolchainHostFromNdk(const Utils::FilePath &ndkPath) const;
unsigned partitionSize() const; QStringList emulatorArgs() const;
void setPartitionSize(unsigned partitionSize); void setEmulatorArgs(const QStringList &args);
bool automaticKitCreation() const; bool automaticKitCreation() const;
void setAutomaticKitCreation(bool b); void setAutomaticKitCreation(bool b);
@@ -215,7 +215,7 @@ private:
Utils::FilePath m_openJDKLocation; Utils::FilePath m_openJDKLocation;
Utils::FilePath m_keystoreLocation; Utils::FilePath m_keystoreLocation;
Utils::FilePath m_openSslLocation; Utils::FilePath m_openSslLocation;
unsigned m_partitionSize = 1024; QStringList m_emulatorArgs;
bool m_automaticKitCreation = true; bool m_automaticKitCreation = true;
QUrl m_sdkToolsUrl; QUrl m_sdkToolsUrl;
QByteArray m_sdkToolsSha256; QByteArray m_sdkToolsSha256;

View File

@@ -52,6 +52,7 @@
#include <QDir> #include <QDir>
#include <QFileDialog> #include <QFileDialog>
#include <QFutureWatcher> #include <QFutureWatcher>
#include <QInputDialog>
#include <QList> #include <QList>
#include <QLoggingCategory> #include <QLoggingCategory>
#include <QMessageBox> #include <QMessageBox>
@@ -119,7 +120,7 @@ private:
void removeAVD(); void removeAVD();
void startAVD(); void startAVD();
void avdActivated(const QModelIndex &); void avdActivated(const QModelIndex &);
void dataPartitionSizeEditingFinished(); void editEmulatorArgsAVD();
void createKitToggled(); void createKitToggled();
void updateUI(); void updateUI();
@@ -428,7 +429,6 @@ AndroidSettingsWidget::AndroidSettingsWidget()
m_androidConfig.setOpenSslLocation(m_androidConfig.sdkLocation() / ("android_openssl")); m_androidConfig.setOpenSslLocation(m_androidConfig.sdkLocation() / ("android_openssl"));
m_ui.openSslPathChooser->setFilePath(m_androidConfig.openSslLocation()); m_ui.openSslPathChooser->setFilePath(m_androidConfig.openSslLocation());
m_ui.DataPartitionSizeSpinBox->setValue(m_androidConfig.partitionSize());
m_ui.CreateKitCheckBox->setChecked(m_androidConfig.automaticKitCreation()); m_ui.CreateKitCheckBox->setChecked(m_androidConfig.automaticKitCreation());
m_ui.AVDTableView->setModel(&m_AVDModel); m_ui.AVDTableView->setModel(&m_AVDModel);
m_ui.AVDTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); m_ui.AVDTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
@@ -489,8 +489,8 @@ AndroidSettingsWidget::AndroidSettingsWidget()
this, &AndroidSettingsWidget::avdActivated); this, &AndroidSettingsWidget::avdActivated);
connect(m_ui.AVDTableView, &QAbstractItemView::clicked, connect(m_ui.AVDTableView, &QAbstractItemView::clicked,
this, &AndroidSettingsWidget::avdActivated); this, &AndroidSettingsWidget::avdActivated);
connect(m_ui.DataPartitionSizeSpinBox, &QAbstractSpinBox::editingFinished, connect(m_ui.AVDAdvancedOptionsPushButton, &QAbstractButton::clicked,
this, &AndroidSettingsWidget::dataPartitionSizeEditingFinished); this, &AndroidSettingsWidget::editEmulatorArgsAVD);
connect(m_ui.CreateKitCheckBox, &QAbstractButton::toggled, connect(m_ui.CreateKitCheckBox, &QAbstractButton::toggled,
this, &AndroidSettingsWidget::createKitToggled); this, &AndroidSettingsWidget::createKitToggled);
connect(m_ui.downloadNDKToolButton, &QAbstractButton::clicked, connect(m_ui.downloadNDKToolButton, &QAbstractButton::clicked,
@@ -807,9 +807,25 @@ void AndroidSettingsWidget::avdActivated(const QModelIndex &index)
m_ui.AVDStartPushButton->setEnabled(index.isValid()); m_ui.AVDStartPushButton->setEnabled(index.isValid());
} }
void AndroidSettingsWidget::dataPartitionSizeEditingFinished() void AndroidSettingsWidget::editEmulatorArgsAVD()
{ {
m_androidConfig.setPartitionSize(m_ui.DataPartitionSizeSpinBox->value()); const QString helpUrl =
"https://developer.android.com/studio/run/emulator-commandline#startup-options";
QInputDialog dialog(this);
dialog.setWindowTitle(tr("Emulator Command-line Startup Options"));
dialog.setLabelText(tr("Emulator command-line startup options (<a href=\"%1\">Help Web Page</a>):").arg(helpUrl));
dialog.setTextValue(m_androidConfig.emulatorArgs().join(' '));
if (auto label = dialog.findChild<QLabel*>()) {
label->setOpenExternalLinks(true);
label->setMinimumWidth(500);
}
if (dialog.exec() != QDialog::Accepted)
return;
m_androidConfig.setEmulatorArgs(QtcProcess::splitArgs(dialog.textValue()));
} }
void AndroidSettingsWidget::createKitToggled() void AndroidSettingsWidget::createKitToggled()

View File

@@ -313,32 +313,6 @@
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="DataPartitionSizeLable">
<property name="text">
<string>System/data partition size:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="DataPartitionSizeSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="suffix">
<string> Mb</string>
</property>
<property name="maximum">
<number>99999</number>
</property>
<property name="value">
<number>1024</number>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="AVDStartPushButton"> <widget class="QPushButton" name="AVDStartPushButton">
<property name="enabled"> <property name="enabled">
@@ -420,6 +394,13 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QPushButton" name="AVDAdvancedOptionsPushButton">
<property name="text">
<string>Advanced Options...</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

View File

@@ -154,7 +154,7 @@ MakefileParser::TopTarget MakefileParser::topTarget() const
return BuiltSources; return BuiltSources;
if (id == QLatin1String("SUBDIRS") || id == QLatin1String("DIST_SUBDIRS")) if (id == QLatin1String("SUBDIRS") || id == QLatin1String("DIST_SUBDIRS"))
return SubDirs; return SubDirs;
if (id.endsWith(QLatin1String("_SOURCES"))) if (id.endsWith("_SOURCES") || id.endsWith("_HEADERS"))
return Sources; return Sources;
return Undefined; return Undefined;
@@ -174,7 +174,7 @@ void MakefileParser::parseBinPrograms()
void MakefileParser::parseSources() void MakefileParser::parseSources()
{ {
QTC_ASSERT(m_line.contains(QLatin1String("_SOURCES")), return); QTC_ASSERT(m_line.contains("_SOURCES") || m_line.contains("_HEADERS"), return);
bool hasVariables = false; bool hasVariables = false;
m_sources.append(targetValues(&hasVariables)); m_sources.append(targetValues(&hasVariables));

View File

@@ -136,41 +136,6 @@ void Selector::mouseRelease(QMouseEvent *event, GraphicsScene *scene)
m_rect = QRectF(); m_rect = QRectF();
} }
bool Selector::isOverMovableItem(const QPointF &pos, GraphicsScene *scene)
{
auto intersect = [pos](QGraphicsObject *item) {
return item->mapRectToScene(item->boundingRect()).contains(pos);
};
const auto frames = scene->keyframes();
for (auto *frame : frames) {
if (intersect(frame))
return true;
if (auto *leftHandle = frame->leftHandle()) {
if (intersect(leftHandle))
return true;
}
if (auto *rightHandle = frame->rightHandle()) {
if (intersect(rightHandle))
return true;
}
}
return false;
}
bool Selector::isOverSelectedKeyframe(const QPointF &pos, GraphicsScene *scene)
{
const auto frames = scene->selectedKeyframes();
for (auto *frame : frames) {
QRectF frameRect = frame->mapRectToScene(frame->boundingRect());
if (frameRect.contains(pos))
return true;
}
return false;
}
bool Selector::select(const SelectionTool &tool, const QPointF &pos, GraphicsScene *scene) bool Selector::select(const SelectionTool &tool, const QPointF &pos, GraphicsScene *scene)
{ {
auto selectWidthTool = [this, auto selectWidthTool = [this,

View File

@@ -50,10 +50,6 @@ public:
void mouseRelease(QMouseEvent *event, GraphicsScene *scene); void mouseRelease(QMouseEvent *event, GraphicsScene *scene);
private: private:
bool isOverSelectedKeyframe(const QPointF &pos, GraphicsScene *scene);
bool isOverMovableItem(const QPointF &pos, GraphicsScene *scene);
bool select(const SelectionTool &tool, const QPointF &pos, GraphicsScene *scene); bool select(const SelectionTool &tool, const QPointF &pos, GraphicsScene *scene);
bool pressSelection(SelectionMode mode, const QPointF &pos, GraphicsScene *scene); bool pressSelection(SelectionMode mode, const QPointF &pos, GraphicsScene *scene);

View File

@@ -68,6 +68,7 @@ public:
QString qmlPath() const; QString qmlPath() const;
QString qmlSource() const; QString qmlSource() const;
QString requiredImport() const; QString requiredImport() const;
QString customComponentSource() const;
using Property = QmlDesigner::PropertyContainer; using Property = QmlDesigner::PropertyContainer;
@@ -84,6 +85,7 @@ public:
void setQmlPath(const QString &qml); void setQmlPath(const QString &qml);
void setRequiredImport(const QString &requiredImport); void setRequiredImport(const QString &requiredImport);
void addHints(const QHash<QString, QString> &hints); void addHints(const QHash<QString, QString> &hints);
void setCustomComponentSource(const QString &source);
private: private:
std::shared_ptr<Internal::ItemLibraryEntryData> m_data; std::shared_ptr<Internal::ItemLibraryEntryData> m_data;

View File

@@ -50,6 +50,7 @@ public:
QString qmlSource; QString qmlSource;
QString requiredImport; QString requiredImport;
QHash<QString, QString> hints; QHash<QString, QString> hints;
QString customComponentSource;
}; };
} // namespace Internal } // namespace Internal
@@ -104,6 +105,11 @@ QString ItemLibraryEntry::requiredImport() const
return m_data->requiredImport; return m_data->requiredImport;
} }
QString ItemLibraryEntry::customComponentSource() const
{
return m_data->customComponentSource;
}
int ItemLibraryEntry::majorVersion() const int ItemLibraryEntry::majorVersion() const
{ {
return m_data->majorVersion; return m_data->majorVersion;
@@ -178,6 +184,11 @@ void ItemLibraryEntry::addHints(const QHash<QString, QString> &hints)
Utils::addToHash(&m_data->hints, hints); Utils::addToHash(&m_data->hints, hints);
} }
void ItemLibraryEntry::setCustomComponentSource(const QString &source)
{
m_data->customComponentSource = source;
}
void ItemLibraryEntry::addProperty(PropertyName &name, QString &type, QVariant &value) void ItemLibraryEntry::addProperty(PropertyName &name, QString &type, QVariant &value)
{ {
Property property; Property property;
@@ -200,6 +211,7 @@ QDataStream& operator<<(QDataStream& stream, const ItemLibraryEntry &itemLibrary
stream << itemLibraryEntry.m_data->properties; stream << itemLibraryEntry.m_data->properties;
stream << itemLibraryEntry.m_data->qml; stream << itemLibraryEntry.m_data->qml;
stream << itemLibraryEntry.m_data->qmlSource; stream << itemLibraryEntry.m_data->qmlSource;
stream << itemLibraryEntry.m_data->customComponentSource;
return stream; return stream;
} }
@@ -223,6 +235,7 @@ QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry)
stream >> itemLibraryEntry.m_data->properties; stream >> itemLibraryEntry.m_data->properties;
stream >> itemLibraryEntry.m_data->qml; stream >> itemLibraryEntry.m_data->qml;
stream >> itemLibraryEntry.m_data->qmlSource; stream >> itemLibraryEntry.m_data->qmlSource;
stream >> itemLibraryEntry.m_data->customComponentSource;
return stream; return stream;
} }
@@ -242,6 +255,7 @@ QDebug operator<<(QDebug debug, const ItemLibraryEntry &itemLibraryEntry)
debug << itemLibraryEntry.m_data->properties; debug << itemLibraryEntry.m_data->properties;
debug << itemLibraryEntry.m_data->qml; debug << itemLibraryEntry.m_data->qml;
debug << itemLibraryEntry.m_data->qmlSource; debug << itemLibraryEntry.m_data->qmlSource;
debug << itemLibraryEntry.m_data->customComponentSource;
return debug.space(); return debug.space();
} }

View File

@@ -336,6 +336,7 @@ void SubComponentManager::registerQmlFile(const QFileInfo &fileInfo, const QStri
itemLibraryEntry.setType(componentName.toUtf8()); itemLibraryEntry.setType(componentName.toUtf8());
itemLibraryEntry.setName(baseComponentName); itemLibraryEntry.setName(baseComponentName);
itemLibraryEntry.setCategory(tr("My QML Components")); itemLibraryEntry.setCategory(tr("My QML Components"));
itemLibraryEntry.setCustomComponentSource(fileInfo.absoluteFilePath());
if (!qualifier.isEmpty()) { if (!qualifier.isEmpty()) {
itemLibraryEntry.setRequiredImport(fixedQualifier); itemLibraryEntry.setRequiredImport(fixedQualifier);
} }

View File

@@ -1,7 +1,7 @@
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libfoo.la lib_LTLIBRARIES = libfoo.la
libfoo_la_SOURCES = foo.c libfoo_la_SOURCES = foo.c foo.h
bin_PROGRAMS = main bin_PROGRAMS = main
main_SOURCES = main.c main_SOURCES = main.c