forked from qt-creator/qt-creator
Core: Avoid duplicating options page
Creating an IOptionPage registers it automatically. In case an
IOptionsProvider is used this duplicates the the option pages
and although duplicated still adds them to the respective
category again.
If one clicks on the respective tab this results in a crash.
Slipped in with cc88302309.
Change-Id: Ie881f532c3f0e397147d99ce368066cdce01a612
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -138,13 +138,14 @@ QIcon Core::IOptionsPage::categoryIcon() const
|
||||
static QList<Core::IOptionsPage *> g_optionsPages;
|
||||
|
||||
/*!
|
||||
Constructs an options page with the given \a parent.
|
||||
Constructs an options page with the given \a parent and registers it
|
||||
at the global options page pool if \a registerGlobally is true.
|
||||
*/
|
||||
Core::IOptionsPage::IOptionsPage(QObject *parent)
|
||||
: QObject(parent),
|
||||
m_keywordsInitialized(false)
|
||||
Core::IOptionsPage::IOptionsPage(QObject *parent, bool registerGlobally)
|
||||
: QObject(parent)
|
||||
{
|
||||
g_optionsPages.append(this);
|
||||
if (registerGlobally)
|
||||
g_optionsPages.append(this);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user