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
|
// "%LOCALAPPDATA%\QtProject\qtcreator" on Windows Vista and later
|
||||||
// "$XDG_DATA_HOME/data/QtProject/qtcreator" or "~/.local/share/data/QtProject/qtcreator" on Linux
|
// "$XDG_DATA_HOME/data/QtProject/qtcreator" or "~/.local/share/data/QtProject/qtcreator" on Linux
|
||||||
// "~/Library/Application Support/QtProject/Qt Creator" on Mac
|
// "~/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
|
// Qt Creator X.Y.Z can load plugins from X.Y.(Z-1) etc, so add current and previous
|
||||||
// patch versions
|
// patch versions
|
||||||
|
@@ -2151,4 +2151,13 @@ void PluginManager::setAcceptTermsAndConditionsCallback(
|
|||||||
d->setAcceptTermsAndConditionsCallback(callback);
|
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
|
} // ExtensionSystem
|
||||||
|
@@ -142,6 +142,7 @@ public:
|
|||||||
static QString systemInformation();
|
static QString systemInformation();
|
||||||
|
|
||||||
void setAcceptTermsAndConditionsCallback(const std::function<bool(PluginSpec *)> &callback);
|
void setAcceptTermsAndConditionsCallback(const std::function<bool(PluginSpec *)> &callback);
|
||||||
|
void setTermsAndConditionsAccepted(PluginSpec *spec);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void objectAdded(QObject *obj);
|
void objectAdded(QObject *obj);
|
||||||
|
@@ -411,10 +411,6 @@ public:
|
|||||||
|
|
||||||
BaseSqliteResultRange(BaseSqliteResultRange &) = delete;
|
BaseSqliteResultRange(BaseSqliteResultRange &) = delete;
|
||||||
BaseSqliteResultRange &operator=(BaseSqliteResultRange &) = delete;
|
BaseSqliteResultRange &operator=(BaseSqliteResultRange &) = delete;
|
||||||
|
|
||||||
BaseSqliteResultRange(BaseSqliteResultRange &&other)
|
|
||||||
: m_statement{std::move(other.resetter)}
|
|
||||||
{}
|
|
||||||
BaseSqliteResultRange &operator=(BaseSqliteResultRange &&) = delete;
|
BaseSqliteResultRange &operator=(BaseSqliteResultRange &&) = delete;
|
||||||
|
|
||||||
iterator begin() & { return iterator{m_statement}; }
|
iterator begin() & { return iterator{m_statement}; }
|
||||||
|
@@ -147,7 +147,7 @@ public:
|
|||||||
friend void convertToString(String &string, CompoundBasicId id)
|
friend void convertToString(String &string, CompoundBasicId id)
|
||||||
{
|
{
|
||||||
convertToString(string, id.id);
|
convertToString(string, id.id);
|
||||||
convertToString(string, id.contextId);
|
convertToString(string, id.contextId());
|
||||||
}
|
}
|
||||||
|
|
||||||
friend bool compareId(CompoundBasicId first, CompoundBasicId second)
|
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 Result = std::decay_t<std::invoke_result_t<F, Value&>>,
|
||||||
typename ResultContainer = C<Result>>
|
typename ResultContainer = C<Result>>
|
||||||
Q_REQUIRED_RESULT decltype(auto) transform(SC &&container, F function);
|
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"
|
// "Matching of template template-arguments excludes compatible templates"
|
||||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0522r0.html (P0522R0)
|
// 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
|
// 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);
|
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
|
template<template<typename, typename> class C, // result container type
|
||||||
typename SC, // input container type
|
typename SC, // input container type
|
||||||
typename F, // function type
|
typename F, // function type
|
||||||
|
@@ -155,8 +155,8 @@ OpenEditorsWindow::OpenEditorsWindow(QWidget *parent)
|
|||||||
|
|
||||||
void OpenEditorsWindow::selectAndHide()
|
void OpenEditorsWindow::selectAndHide()
|
||||||
{
|
{
|
||||||
setVisible(false);
|
|
||||||
selectEditor(m_editorView->currentItem());
|
selectEditor(m_editorView->currentItem());
|
||||||
|
setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenEditorsWindow::setVisible(bool visible)
|
void OpenEditorsWindow::setVisible(bool visible)
|
||||||
|
@@ -499,6 +499,10 @@ bool executePluginInstallWizard(const FilePath &archive)
|
|||||||
if (!install())
|
if (!install())
|
||||||
return false;
|
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) {
|
if (data.loadImmediately) {
|
||||||
auto spec = data.pluginSpec.release();
|
auto spec = data.pluginSpec.release();
|
||||||
spec->setEnabledBySettings(true);
|
spec->setEnabledBySettings(true);
|
||||||
|
@@ -474,8 +474,8 @@ QWidget *SpacerField::createWidget(const QString &displayName, JsonFieldPage *pa
|
|||||||
Q_UNUSED(page)
|
Q_UNUSED(page)
|
||||||
int hspace = QApplication::style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
|
int hspace = QApplication::style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
|
||||||
int vspace = QApplication::style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing);
|
int vspace = QApplication::style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing);
|
||||||
int hsize = hspace * m_factor;
|
int hsize = qMax(0, hspace * m_factor);
|
||||||
int vsize = vspace * m_factor;
|
int vsize = qMax(0, vspace * m_factor);
|
||||||
|
|
||||||
auto w = new QWidget();
|
auto w = new QWidget();
|
||||||
w->setMinimumSize(hsize, vsize);
|
w->setMinimumSize(hsize, vsize);
|
||||||
|
@@ -187,7 +187,9 @@ QString Toolchain::detectionSource() const
|
|||||||
|
|
||||||
ToolchainFactory *Toolchain::factory() 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
|
QByteArray Toolchain::id() const
|
||||||
@@ -741,12 +743,11 @@ void ToolchainFactory::autoDetectionToMap(Store &data, bool detected)
|
|||||||
|
|
||||||
Toolchain *ToolchainFactory::createToolchain(Id toolchainType)
|
Toolchain *ToolchainFactory::createToolchain(Id toolchainType)
|
||||||
{
|
{
|
||||||
for (ToolchainFactory *factory : std::as_const(toolchainFactories())) {
|
if (ToolchainFactory * const factory = factoryForType(toolchainType)) {
|
||||||
if (factory->m_supportedToolchainType == toolchainType) {
|
if (Toolchain * const tc = factory->create()) {
|
||||||
if (Toolchain *tc = factory->create()) {
|
QTC_ASSERT(tc->typeId() == toolchainType, qDebug() << toolchainType.toSetting());
|
||||||
tc->d->m_typeId = toolchainType;
|
tc->d->m_typeId = toolchainType; // FIXME: Redundant?
|
||||||
return tc;
|
return tc;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
Reference in New Issue
Block a user