forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/15.0'"
This commit is contained in:
@@ -196,7 +196,7 @@ static inline FilePaths getPluginPaths()
|
||||
// "%LOCALAPPDATA%\QtProject\qtcreator" on Windows Vista and later
|
||||
// "$XDG_DATA_HOME/data/QtProject/qtcreator" or "~/.local/share/data/QtProject/qtcreator" on Linux
|
||||
// "~/Library/Application Support/QtProject/Qt Creator" on Mac
|
||||
const FilePath userPluginPath = appInfo().userPluginsRoot;
|
||||
const FilePath userPluginPath = appInfo().userPluginsRoot.parentDir();
|
||||
|
||||
// Qt Creator X.Y.Z can load plugins from X.Y.(Z-1) etc, so add current and previous
|
||||
// patch versions
|
||||
|
@@ -2151,4 +2151,13 @@ void PluginManager::setAcceptTermsAndConditionsCallback(
|
||||
d->setAcceptTermsAndConditionsCallback(callback);
|
||||
}
|
||||
|
||||
void PluginManager::setTermsAndConditionsAccepted(PluginSpec *spec)
|
||||
{
|
||||
if (spec->termsAndConditions()) {
|
||||
d->pluginsWithAcceptedTermsAndConditions.append(spec->id());
|
||||
if (d->settings)
|
||||
d->settings->setValue(C_TANDCACCEPTED_PLUGINS, d->pluginsWithAcceptedTermsAndConditions);
|
||||
}
|
||||
}
|
||||
|
||||
} // ExtensionSystem
|
||||
|
@@ -142,6 +142,7 @@ public:
|
||||
static QString systemInformation();
|
||||
|
||||
void setAcceptTermsAndConditionsCallback(const std::function<bool(PluginSpec *)> &callback);
|
||||
void setTermsAndConditionsAccepted(PluginSpec *spec);
|
||||
|
||||
signals:
|
||||
void objectAdded(QObject *obj);
|
||||
|
@@ -411,10 +411,6 @@ public:
|
||||
|
||||
BaseSqliteResultRange(BaseSqliteResultRange &) = delete;
|
||||
BaseSqliteResultRange &operator=(BaseSqliteResultRange &) = delete;
|
||||
|
||||
BaseSqliteResultRange(BaseSqliteResultRange &&other)
|
||||
: m_statement{std::move(other.resetter)}
|
||||
{}
|
||||
BaseSqliteResultRange &operator=(BaseSqliteResultRange &&) = delete;
|
||||
|
||||
iterator begin() & { return iterator{m_statement}; }
|
||||
|
@@ -147,7 +147,7 @@ public:
|
||||
friend void convertToString(String &string, CompoundBasicId id)
|
||||
{
|
||||
convertToString(string, id.id);
|
||||
convertToString(string, id.contextId);
|
||||
convertToString(string, id.contextId());
|
||||
}
|
||||
|
||||
friend bool compareId(CompoundBasicId first, CompoundBasicId second)
|
||||
|
@@ -273,7 +273,7 @@ template<template<typename> class C, // result container type
|
||||
typename Result = std::decay_t<std::invoke_result_t<F, Value&>>,
|
||||
typename ResultContainer = C<Result>>
|
||||
Q_REQUIRED_RESULT decltype(auto) transform(SC &&container, F function);
|
||||
#ifdef Q_CC_CLANG
|
||||
#if __cpp_template_template_args < 201611L
|
||||
// "Matching of template template-arguments excludes compatible templates"
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0522r0.html (P0522R0)
|
||||
// in C++17 makes the above match e.g. C=std::vector even though that takes two
|
||||
@@ -899,7 +899,7 @@ Q_REQUIRED_RESULT decltype(auto) transform(SC &&container, F function)
|
||||
return transform<ResultContainer>(std::forward<SC>(container), function);
|
||||
}
|
||||
|
||||
#ifdef Q_CC_CLANG
|
||||
#if __cpp_template_template_args < 201611L
|
||||
template<template<typename, typename> class C, // result container type
|
||||
typename SC, // input container type
|
||||
typename F, // function type
|
||||
|
@@ -155,8 +155,8 @@ OpenEditorsWindow::OpenEditorsWindow(QWidget *parent)
|
||||
|
||||
void OpenEditorsWindow::selectAndHide()
|
||||
{
|
||||
setVisible(false);
|
||||
selectEditor(m_editorView->currentItem());
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
void OpenEditorsWindow::setVisible(bool visible)
|
||||
|
@@ -499,6 +499,10 @@ bool executePluginInstallWizard(const FilePath &archive)
|
||||
if (!install())
|
||||
return false;
|
||||
|
||||
// install() would have failed if the user did not accept the terms and conditions
|
||||
// so we can safely set them as accepted here.
|
||||
PluginManager::instance()->setTermsAndConditionsAccepted(data.pluginSpec.get());
|
||||
|
||||
if (data.loadImmediately) {
|
||||
auto spec = data.pluginSpec.release();
|
||||
spec->setEnabledBySettings(true);
|
||||
|
@@ -474,8 +474,8 @@ QWidget *SpacerField::createWidget(const QString &displayName, JsonFieldPage *pa
|
||||
Q_UNUSED(page)
|
||||
int hspace = QApplication::style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
|
||||
int vspace = QApplication::style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing);
|
||||
int hsize = hspace * m_factor;
|
||||
int vsize = vspace * m_factor;
|
||||
int hsize = qMax(0, hspace * m_factor);
|
||||
int vsize = qMax(0, vspace * m_factor);
|
||||
|
||||
auto w = new QWidget();
|
||||
w->setMinimumSize(hsize, vsize);
|
||||
|
@@ -187,7 +187,9 @@ QString Toolchain::detectionSource() const
|
||||
|
||||
ToolchainFactory *Toolchain::factory() const
|
||||
{
|
||||
return ToolchainFactory::factoryForType(typeId());
|
||||
ToolchainFactory * const factory = ToolchainFactory::factoryForType(typeId());
|
||||
QTC_ASSERT(factory, qDebug() << typeId());
|
||||
return factory;
|
||||
}
|
||||
|
||||
QByteArray Toolchain::id() const
|
||||
@@ -741,14 +743,13 @@ void ToolchainFactory::autoDetectionToMap(Store &data, bool detected)
|
||||
|
||||
Toolchain *ToolchainFactory::createToolchain(Id toolchainType)
|
||||
{
|
||||
for (ToolchainFactory *factory : std::as_const(toolchainFactories())) {
|
||||
if (factory->m_supportedToolchainType == toolchainType) {
|
||||
if (Toolchain *tc = factory->create()) {
|
||||
tc->d->m_typeId = toolchainType;
|
||||
if (ToolchainFactory * const factory = factoryForType(toolchainType)) {
|
||||
if (Toolchain * const tc = factory->create()) {
|
||||
QTC_ASSERT(tc->typeId() == toolchainType, qDebug() << toolchainType.toSetting());
|
||||
tc->d->m_typeId = toolchainType; // FIXME: Redundant?
|
||||
return tc;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user