forked from qt-creator/qt-creator
Vcs/Text search: Remove a few addAutoReleaseObject uses
Using a QObject parent suffices here. Change-Id: I4dc5448511d55bf14fbd8f810e91336a49e94094 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -157,7 +157,7 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
|
||||
auto vcsCtrl = initializeVcs<BazaarControl>(context, m_client);
|
||||
connect(m_client, &VcsBaseClient::changed, vcsCtrl, &BazaarControl::changed);
|
||||
|
||||
addAutoReleasedObject(new OptionsPage(vcsCtrl));
|
||||
new OptionsPage(vcsCtrl, this);
|
||||
|
||||
const auto describeFunc = [this](const QString &source, const QString &id) {
|
||||
m_client->view(source, id);
|
||||
@@ -165,14 +165,13 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
|
||||
const int editorCount = sizeof(editorParameters) / sizeof(VcsBaseEditorParameters);
|
||||
const auto widgetCreator = []() { return new BazaarEditorWidget; };
|
||||
for (int i = 0; i < editorCount; i++)
|
||||
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc));
|
||||
new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc, this);
|
||||
|
||||
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitEditorParameters,
|
||||
[]() { return new CommitEditor(&submitEditorParameters); }));
|
||||
(void) new VcsSubmitEditorFactory(&submitEditorParameters,
|
||||
[]() { return new CommitEditor(&submitEditorParameters); }, this);
|
||||
|
||||
const QString prefix = QLatin1String("bzr");
|
||||
m_commandLocator = new CommandLocator("Bazaar", prefix, prefix);
|
||||
addAutoReleasedObject(m_commandLocator);
|
||||
m_commandLocator = new CommandLocator("Bazaar", prefix, prefix, this);
|
||||
|
||||
createMenu(context);
|
||||
|
||||
|
@@ -65,8 +65,8 @@ void OptionsPageWidget::setSettings(const VcsBaseClientSettings &s)
|
||||
m_ui.timeout->setValue(s.intValue(BazaarSettings::timeoutKey));
|
||||
}
|
||||
|
||||
OptionsPage::OptionsPage(Core::IVersionControl *control) :
|
||||
VcsClientOptionsPage(control, BazaarPlugin::instance()->client())
|
||||
OptionsPage::OptionsPage(Core::IVersionControl *control, QObject *parent) :
|
||||
VcsClientOptionsPage(control, BazaarPlugin::instance()->client(), parent)
|
||||
{
|
||||
setId(VcsBase::Constants::VCS_ID_BAZAAR);
|
||||
setDisplayName(tr("Bazaar"));
|
||||
|
@@ -54,7 +54,7 @@ class OptionsPage : public VcsBase::VcsClientOptionsPage
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
OptionsPage(Core::IVersionControl *control);
|
||||
OptionsPage(Core::IVersionControl *control, QObject *parent);
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -423,10 +423,10 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
|
||||
connect(SessionManager::instance(), &SessionManager::startupProjectChanged,
|
||||
this, &ClearCasePlugin::projectChanged);
|
||||
|
||||
addAutoReleasedObject(new SettingsPage);
|
||||
new SettingsPage(this);
|
||||
|
||||
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new ClearCaseSubmitEditor(&submitParameters); }));
|
||||
new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new ClearCaseSubmitEditor(&submitParameters); }, this);
|
||||
|
||||
// any editor responds to describe (when clicking a version)
|
||||
const auto describeFunc = [this](const QString &source, const QString &changeNr) {
|
||||
@@ -435,13 +435,12 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
|
||||
const int editorCount = sizeof(editorParameters)/sizeof(VcsBaseEditorParameters);
|
||||
const auto widgetCreator = []() { return new ClearCaseEditorWidget; };
|
||||
for (int i = 0; i < editorCount; i++)
|
||||
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc));
|
||||
new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc, this);
|
||||
|
||||
const QString description = QLatin1String("ClearCase");
|
||||
const QString prefix = QLatin1String("cc");
|
||||
// register cc prefix in Locator
|
||||
m_commandLocator = new CommandLocator("cc", description, prefix);
|
||||
addAutoReleasedObject(m_commandLocator);
|
||||
m_commandLocator = new CommandLocator("cc", description, prefix, this);
|
||||
|
||||
//register actions
|
||||
ActionContainer *toolsContainer = ActionManager::actionContainer(M_TOOLS);
|
||||
|
@@ -104,7 +104,8 @@ void SettingsPageWidget::setSettings(const ClearCaseSettings &s)
|
||||
m_ui.indexOnlyVOBsEdit->setText(s.indexOnlyVOBs);
|
||||
}
|
||||
|
||||
SettingsPage::SettingsPage()
|
||||
SettingsPage::SettingsPage(QObject *parent)
|
||||
: VcsBaseOptionsPage(parent)
|
||||
{
|
||||
setId(ClearCase::Constants::VCS_ID_CLEARCASE);
|
||||
setDisplayName(tr("ClearCase"));
|
||||
|
@@ -57,7 +57,7 @@ class SettingsPage : public VcsBase::VcsBaseOptionsPage
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SettingsPage();
|
||||
explicit SettingsPage(QObject *parent);
|
||||
|
||||
QWidget *widget() override;
|
||||
void apply() override;
|
||||
|
@@ -204,10 +204,10 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
|
||||
m_client = new CvsClient;
|
||||
|
||||
addAutoReleasedObject(new SettingsPage(versionControl()));
|
||||
new SettingsPage(versionControl(), this);
|
||||
|
||||
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new CvsSubmitEditor(&submitParameters); }));
|
||||
new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new CvsSubmitEditor(&submitParameters); }, this);
|
||||
|
||||
const auto describeFunc = [this](const QString &source, const QString &changeNr) {
|
||||
QString errorMessage;
|
||||
@@ -217,11 +217,10 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
const int editorCount = sizeof(editorParameters) / sizeof(editorParameters[0]);
|
||||
const auto widgetCreator = []() { return new CvsEditorWidget; };
|
||||
for (int i = 0; i < editorCount; i++)
|
||||
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc));
|
||||
new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc, this);
|
||||
|
||||
const QString prefix = QLatin1String("cvs");
|
||||
m_commandLocator = new CommandLocator("CVS", prefix, prefix);
|
||||
addAutoReleasedObject(m_commandLocator);
|
||||
m_commandLocator = new CommandLocator("CVS", prefix, prefix, this);
|
||||
|
||||
// Register actions
|
||||
ActionContainer *toolsContainer = ActionManager::actionContainer(M_TOOLS);
|
||||
|
@@ -72,8 +72,8 @@ void SettingsPageWidget::setSettings(const VcsBaseClientSettings &s)
|
||||
m_ui.describeByCommitIdCheckBox->setChecked(s.boolValue(CvsSettings::describeByCommitIdKey));
|
||||
}
|
||||
|
||||
SettingsPage::SettingsPage(Core::IVersionControl *control) :
|
||||
VcsClientOptionsPage(control, CvsPlugin::instance()->client())
|
||||
SettingsPage::SettingsPage(Core::IVersionControl *control, QObject *parent) :
|
||||
VcsClientOptionsPage(control, CvsPlugin::instance()->client(), parent)
|
||||
{
|
||||
setId(VcsBase::Constants::VCS_ID_CVS);
|
||||
setDisplayName(tr("CVS"));
|
||||
|
@@ -54,7 +54,7 @@ class SettingsPage : public VcsBase::VcsClientOptionsPage
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SettingsPage(Core::IVersionControl *control);
|
||||
SettingsPage(Core::IVersionControl *control, QObject *parent);
|
||||
};
|
||||
|
||||
} // namespace Cvs
|
||||
|
@@ -293,7 +293,7 @@ bool GerritPlugin::initialize(ActionContainer *ac)
|
||||
connect(pushAction, &QAction::triggered, this, [this]() { push(); });
|
||||
ac->addAction(m_pushToGerritCommand);
|
||||
|
||||
GitPlugin::instance()->addAutoReleasedObject(new GerritOptionsPage(m_parameters));
|
||||
new GerritOptionsPage(m_parameters, this);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -218,7 +218,8 @@ static bool isGitDirectory(const QString &path)
|
||||
return gitVc == VcsManager::findVersionControlForDirectory(path, 0);
|
||||
}
|
||||
|
||||
GitGrep::GitGrep()
|
||||
GitGrep::GitGrep(QObject *parent)
|
||||
: SearchEngine(parent)
|
||||
{
|
||||
m_widget = new QWidget;
|
||||
auto layout = new QHBoxLayout(m_widget);
|
||||
|
@@ -39,7 +39,7 @@ class GitGrep : public TextEditor::SearchEngine
|
||||
Q_DECLARE_TR_FUNCTIONS(GitGrep)
|
||||
|
||||
public:
|
||||
GitGrep();
|
||||
explicit GitGrep(QObject *parent);
|
||||
~GitGrep() override;
|
||||
QString title() const override;
|
||||
QString toolTip() const override;
|
||||
|
@@ -299,12 +299,11 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
auto vc = initializeVcs<GitVersionControl>(context, m_gitClient);
|
||||
|
||||
// Create the settings Page
|
||||
auto settingsPage = new SettingsPage(vc);
|
||||
addAutoReleasedObject(settingsPage);
|
||||
auto settingsPage = new SettingsPage(vc, this);
|
||||
connect(settingsPage, &SettingsPage::settingsChanged,
|
||||
this, &GitPlugin::updateRepositoryBrowserAction);
|
||||
|
||||
addAutoReleasedObject(new GitGrep);
|
||||
new GitGrep(this);
|
||||
|
||||
const auto describeFunc = [this](const QString &source, const QString &id) {
|
||||
m_gitClient->show(source, id);
|
||||
@@ -312,14 +311,13 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
const int editorCount = sizeof(editorParameters) / sizeof(editorParameters[0]);
|
||||
const auto widgetCreator = []() { return new GitEditorWidget; };
|
||||
for (int i = 0; i < editorCount; i++)
|
||||
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc));
|
||||
new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc, this);
|
||||
|
||||
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new GitSubmitEditor(&submitParameters); }));
|
||||
new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new GitSubmitEditor(&submitParameters); }, this);
|
||||
|
||||
const QString prefix = "git";
|
||||
m_commandLocator = new CommandLocator("Git", prefix, prefix);
|
||||
addAutoReleasedObject(m_commandLocator);
|
||||
m_commandLocator = new CommandLocator("Git", prefix, prefix, this);
|
||||
|
||||
//register actions
|
||||
ActionContainer *toolsContainer = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
||||
|
@@ -106,8 +106,8 @@ void SettingsPageWidget::updateNoteField()
|
||||
}
|
||||
|
||||
// -------- SettingsPage
|
||||
SettingsPage::SettingsPage(Core::IVersionControl *control) :
|
||||
VcsClientOptionsPage(control, GitPlugin::client())
|
||||
SettingsPage::SettingsPage(Core::IVersionControl *control, QObject *parent) :
|
||||
VcsClientOptionsPage(control, GitPlugin::client(), parent)
|
||||
{
|
||||
setId(VcsBase::Constants::VCS_ID_GIT);
|
||||
setDisplayName(tr("Git"));
|
||||
|
@@ -59,7 +59,7 @@ class SettingsPage : public VcsBase::VcsClientOptionsPage
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SettingsPage(Core::IVersionControl *control);
|
||||
SettingsPage(Core::IVersionControl *control, QObject *parent);
|
||||
void apply() override;
|
||||
};
|
||||
|
||||
|
@@ -124,7 +124,7 @@ bool MercurialPlugin::initialize(const QStringList & /* arguments */, QString *
|
||||
m_client = new MercurialClient;
|
||||
auto vc = initializeVcs<MercurialControl>(context, m_client);
|
||||
|
||||
addAutoReleasedObject(new OptionsPage(vc));
|
||||
new OptionsPage(vc, this);
|
||||
|
||||
connect(m_client, &VcsBaseClient::changed, vc, &MercurialControl::changed);
|
||||
connect(m_client, &MercurialClient::needUpdate, this, &MercurialPlugin::update);
|
||||
@@ -135,14 +135,13 @@ bool MercurialPlugin::initialize(const QStringList & /* arguments */, QString *
|
||||
const int editorCount = sizeof(editorParameters)/sizeof(editorParameters[0]);
|
||||
const auto widgetCreator = []() { return new MercurialEditorWidget; };
|
||||
for (int i = 0; i < editorCount; i++)
|
||||
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc));
|
||||
new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc, this);
|
||||
|
||||
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitEditorParameters,
|
||||
[]() { return new CommitEditor(&submitEditorParameters); }));
|
||||
new VcsSubmitEditorFactory(&submitEditorParameters,
|
||||
[]() { return new CommitEditor(&submitEditorParameters); }, this);
|
||||
|
||||
const QString prefix = QLatin1String("hg");
|
||||
m_commandLocator = new Core::CommandLocator("Mercurial", prefix, prefix);
|
||||
addAutoReleasedObject(m_commandLocator);
|
||||
m_commandLocator = new Core::CommandLocator("Mercurial", prefix, prefix, this);
|
||||
|
||||
createMenu(context);
|
||||
|
||||
|
@@ -68,8 +68,8 @@ void OptionsPageWidget::setSettings(const VcsBaseClientSettings &s)
|
||||
m_ui.timeout->setValue(s.intValue(MercurialSettings::timeoutKey));
|
||||
}
|
||||
|
||||
OptionsPage::OptionsPage(Core::IVersionControl *control) :
|
||||
VcsClientOptionsPage(control, MercurialPlugin::client())
|
||||
OptionsPage::OptionsPage(Core::IVersionControl *control, QObject *parent) :
|
||||
VcsClientOptionsPage(control, MercurialPlugin::client(), parent)
|
||||
{
|
||||
setId(VcsBase::Constants::VCS_ID_MERCURIAL);
|
||||
setDisplayName(tr("Mercurial"));
|
||||
|
@@ -53,7 +53,7 @@ class OptionsPage : public VcsBase::VcsClientOptionsPage
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
OptionsPage(Core::IVersionControl *control);
|
||||
OptionsPage(Core::IVersionControl *control, QObject *parent);
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -189,11 +189,11 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
||||
|
||||
m_settings.fromSettings(ICore::settings());
|
||||
|
||||
addAutoReleasedObject(new SettingsPage);
|
||||
new SettingsPage(this);
|
||||
|
||||
// Editor factories
|
||||
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new PerforceSubmitEditor(&submitParameters); }));
|
||||
new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new PerforceSubmitEditor(&submitParameters); }, this);
|
||||
|
||||
const auto describeFunc = [this](const QString &source, const QString &n) {
|
||||
describe(source, n);
|
||||
@@ -201,11 +201,10 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
||||
const int editorCount = sizeof(editorParameters) / sizeof(editorParameters[0]);
|
||||
const auto widgetCreator = []() { return new PerforceEditorWidget; };
|
||||
for (int i = 0; i < editorCount; i++)
|
||||
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc));
|
||||
new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc, this);
|
||||
|
||||
const QString prefix = QLatin1String("p4");
|
||||
m_commandLocator = new CommandLocator("Perforce", prefix, prefix);
|
||||
addAutoReleasedObject(m_commandLocator);
|
||||
m_commandLocator = new CommandLocator("Perforce", prefix, prefix, this);
|
||||
|
||||
ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
||||
|
||||
|
@@ -117,7 +117,8 @@ void SettingsPageWidget::setStatusError(const QString &t)
|
||||
m_ui.errorLabel->setText(t);
|
||||
}
|
||||
|
||||
SettingsPage::SettingsPage()
|
||||
SettingsPage::SettingsPage(QObject *parent)
|
||||
: VcsBaseOptionsPage(parent)
|
||||
{
|
||||
setId(VcsBase::Constants::VCS_ID_PERFORCE);
|
||||
setDisplayName(tr("Perforce"));
|
||||
|
@@ -64,7 +64,7 @@ class SettingsPage : public VcsBase::VcsBaseOptionsPage
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SettingsPage();
|
||||
explicit SettingsPage(QObject *parent);
|
||||
~SettingsPage() override;
|
||||
|
||||
QWidget *widget() override;
|
||||
|
@@ -132,8 +132,9 @@ void runSilverSeacher(FutureInterfaceType &fi, FileFindParameters parameters)
|
||||
|
||||
namespace SilverSearcher {
|
||||
|
||||
FindInFilesSilverSearcher::FindInFilesSilverSearcher()
|
||||
: m_widget(0),
|
||||
FindInFilesSilverSearcher::FindInFilesSilverSearcher(QObject *parent)
|
||||
: SearchEngine(parent),
|
||||
m_widget(0),
|
||||
m_path("ag"),
|
||||
m_toolName("SilverSearcher")
|
||||
{
|
||||
|
@@ -39,7 +39,7 @@ class FindInFilesSilverSearcher : public TextEditor::SearchEngine
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FindInFilesSilverSearcher();
|
||||
explicit FindInFilesSilverSearcher(QObject *parent);
|
||||
~FindInFilesSilverSearcher() override;
|
||||
|
||||
// TextEditor::FileFindExtension
|
||||
|
@@ -35,7 +35,7 @@ bool SilverSearcherPlugin::initialize(const QStringList &arguments, QString *err
|
||||
Q_UNUSED(arguments)
|
||||
Q_UNUSED(errorString)
|
||||
|
||||
addAutoReleasedObject(new FindInFilesSilverSearcher);
|
||||
new FindInFilesSilverSearcher(this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -80,8 +80,8 @@ void SettingsPageWidget::setSettings(const VcsBaseClientSettings &s)
|
||||
m_ui.logCountSpinBox->setValue(s.intValue(SubversionSettings::logCountKey));
|
||||
}
|
||||
|
||||
SettingsPage::SettingsPage(Core::IVersionControl *control) :
|
||||
VcsClientOptionsPage(control, SubversionPlugin::instance()->client())
|
||||
SettingsPage::SettingsPage(Core::IVersionControl *control, QObject *parent) :
|
||||
VcsClientOptionsPage(control, SubversionPlugin::instance()->client(), parent)
|
||||
{
|
||||
setId(VcsBase::Constants::VCS_ID_SUBVERSION);
|
||||
setDisplayName(tr("Subversion"));
|
||||
|
@@ -56,7 +56,7 @@ class SettingsPage : public VcsBase::VcsClientOptionsPage
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SettingsPage(Core::IVersionControl *control);
|
||||
SettingsPage(Core::IVersionControl *control, QObject *parent);
|
||||
};
|
||||
|
||||
} // namespace Subversion
|
||||
|
@@ -216,10 +216,10 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
||||
|
||||
m_client = new SubversionClient;
|
||||
|
||||
addAutoReleasedObject(new SettingsPage(versionControl()));
|
||||
new SettingsPage(versionControl(), this);
|
||||
|
||||
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new SubversionSubmitEditor(&submitParameters); }));
|
||||
new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new SubversionSubmitEditor(&submitParameters); }, this);
|
||||
|
||||
const auto describeFunc = [this](const QString &source, const QString &id) {
|
||||
describe(source, id);
|
||||
@@ -227,11 +227,10 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
||||
const int editorCount = sizeof(editorParameters) / sizeof(editorParameters[0]);
|
||||
const auto widgetCreator = []() { return new SubversionEditorWidget; };
|
||||
for (int i = 0; i < editorCount; i++)
|
||||
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc));
|
||||
new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc, this);
|
||||
|
||||
const QString prefix = QLatin1String("svn");
|
||||
m_commandLocator = new CommandLocator("Subversion", prefix, prefix);
|
||||
addAutoReleasedObject(m_commandLocator);
|
||||
m_commandLocator = new CommandLocator("Subversion", prefix, prefix, this);
|
||||
|
||||
// Register actions
|
||||
ActionContainer *toolsContainer = ActionManager::actionContainer(M_TOOLS);
|
||||
|
@@ -157,8 +157,8 @@ static void updateComboEntries(QComboBox *combo, bool onTop)
|
||||
|
||||
using namespace Internal;
|
||||
|
||||
SearchEngine::SearchEngine()
|
||||
: d(new SearchEnginePrivate)
|
||||
SearchEngine::SearchEngine(QObject *parent)
|
||||
: QObject(parent), d(new SearchEnginePrivate)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -65,7 +65,7 @@ class TEXTEDITOR_EXPORT SearchEngine : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SearchEngine();
|
||||
SearchEngine(QObject *parent = nullptr);
|
||||
~SearchEngine();
|
||||
virtual QString title() const = 0;
|
||||
virtual QString toolTip() const = 0; // add %1 placeholder where the find flags should be put
|
||||
|
@@ -52,7 +52,8 @@ namespace VcsBase {
|
||||
VcsEditorFactory::VcsEditorFactory(const VcsBaseEditorParameters *parameters,
|
||||
// Force copy, see QTCREATORBUG-13218
|
||||
const EditorWidgetCreator editorWidgetCreator,
|
||||
std::function<void(const QString &, const QString &)> describeFunc)
|
||||
std::function<void(const QString &, const QString &)> describeFunc, QObject *parent)
|
||||
: TextEditorFactory(parent)
|
||||
{
|
||||
setProperty("VcsEditorFactoryName", QByteArray(parameters->id));
|
||||
setId(parameters->id);
|
||||
|
@@ -42,7 +42,8 @@ class VCSBASE_EXPORT VcsEditorFactory : public TextEditor::TextEditorFactory
|
||||
public:
|
||||
VcsEditorFactory(const VcsBaseEditorParameters *parameters,
|
||||
const EditorWidgetCreator editorWidgetCreator,
|
||||
std::function<void(const QString &, const QString &)> describeFunc);
|
||||
std::function<void(const QString &, const QString &)> describeFunc,
|
||||
QObject *parent = nullptr);
|
||||
|
||||
static VcsBaseEditor *createEditorById(const char *id);
|
||||
};
|
||||
|
@@ -29,8 +29,10 @@
|
||||
namespace VcsBase {
|
||||
|
||||
VcsSubmitEditorFactory::VcsSubmitEditorFactory
|
||||
(const VcsBaseSubmitEditorParameters *parameters, const EditorCreator &editorCreator)
|
||||
: m_editorCreator(editorCreator)
|
||||
(const VcsBaseSubmitEditorParameters *parameters,
|
||||
const EditorCreator &editorCreator,
|
||||
QObject *parent)
|
||||
: IEditorFactory(parent), m_editorCreator(editorCreator)
|
||||
{
|
||||
setId(parameters->id);
|
||||
setDisplayName(QLatin1String(parameters->displayName));
|
||||
|
@@ -44,7 +44,9 @@ class VCSBASE_EXPORT VcsSubmitEditorFactory : public Core::IEditorFactory
|
||||
public:
|
||||
typedef std::function<VcsBaseSubmitEditor *()> EditorCreator;
|
||||
|
||||
VcsSubmitEditorFactory(const VcsBaseSubmitEditorParameters *parameters, const EditorCreator &editorCreator);
|
||||
VcsSubmitEditorFactory(const VcsBaseSubmitEditorParameters *parameters,
|
||||
const EditorCreator &editorCreator,
|
||||
QObject *parent = nullptr);
|
||||
|
||||
Core::IEditor *createEditor() override;
|
||||
|
||||
|
@@ -85,7 +85,6 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
});
|
||||
|
||||
m_settingsPage = new CommonOptionsPage;
|
||||
addAutoReleasedObject(m_settingsPage);
|
||||
addAutoReleasedObject(VcsOutputWindow::instance());
|
||||
connect(m_settingsPage, &CommonOptionsPage::settingsChanged,
|
||||
this, &VcsPlugin::settingsChanged);
|
||||
|
Reference in New Issue
Block a user