Kaydet (Commit) f9231f05 authored tarafından Aleksei Nikiforov's avatar Aleksei Nikiforov Kaydeden (comit) Thorsten Behrens

KDE5: minor Qt5Menu cleanup

Remove unnecessary destructor

Move MenuBar clearing out of DoFullMenuUpdate function

Change-Id: I0fb916c6935b2f8a675e75adf696d99203a2c016
Reviewed-on: https://gerrit.libreoffice.org/66386
Tested-by: Jenkins
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 5843e14a
...@@ -43,7 +43,6 @@ private: ...@@ -43,7 +43,6 @@ private:
public: public:
Qt5Menu(bool bMenuBar); Qt5Menu(bool bMenuBar);
virtual ~Qt5Menu() override;
virtual bool VisibleMenuBar() override; // must return TRUE to actually DISPLAY native menu bars virtual bool VisibleMenuBar() override; // must return TRUE to actually DISPLAY native menu bars
......
...@@ -32,8 +32,6 @@ Qt5Menu::Qt5Menu(bool bMenuBar) ...@@ -32,8 +32,6 @@ Qt5Menu::Qt5Menu(bool bMenuBar)
connect(this, &Qt5Menu::setFrameSignal, this, &Qt5Menu::SetFrame, Qt::BlockingQueuedConnection); connect(this, &Qt5Menu::setFrameSignal, this, &Qt5Menu::SetFrame, Qt::BlockingQueuedConnection);
} }
Qt5Menu::~Qt5Menu() { maItems.clear(); }
bool Qt5Menu::VisibleMenuBar() { return true; } bool Qt5Menu::VisibleMenuBar() { return true; }
QMenu* Qt5Menu::InsertMenuItem(Qt5MenuItem* pSalMenuItem, unsigned nPos) QMenu* Qt5Menu::InsertMenuItem(Qt5MenuItem* pSalMenuItem, unsigned nPos)
...@@ -227,6 +225,9 @@ void Qt5Menu::SetFrame(const SalFrame* pFrame) ...@@ -227,6 +225,9 @@ void Qt5Menu::SetFrame(const SalFrame* pFrame)
if (pMainWindow) if (pMainWindow)
{ {
mpQMenuBar = pMainWindow->menuBar(); mpQMenuBar = pMainWindow->menuBar();
if (mpQMenuBar)
mpQMenuBar->clear();
mpQMenu = nullptr; mpQMenu = nullptr;
mpQActionGroup = nullptr; mpQActionGroup = nullptr;
...@@ -236,9 +237,6 @@ void Qt5Menu::SetFrame(const SalFrame* pFrame) ...@@ -236,9 +237,6 @@ void Qt5Menu::SetFrame(const SalFrame* pFrame)
void Qt5Menu::DoFullMenuUpdate(Menu* pMenuBar) void Qt5Menu::DoFullMenuUpdate(Menu* pMenuBar)
{ {
if (mbMenuBar && mpQMenuBar)
mpQMenuBar->clear();
for (sal_Int32 nItem = 0; nItem < static_cast<sal_Int32>(GetItemCount()); nItem++) for (sal_Int32 nItem = 0; nItem < static_cast<sal_Int32>(GetItemCount()); nItem++)
{ {
Qt5MenuItem* pSalMenuItem = GetItemAtPos(nItem); Qt5MenuItem* pSalMenuItem = GetItemAtPos(nItem);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment