Do not crash if the part could not be found

This commit is contained in:
Albert Astals Cid 2011-06-02 20:26:20 +01:00
parent 933ef384d7
commit 328efbc562

View file

@ -69,6 +69,7 @@ void Shell::init()
setXMLFile("shell.rc");
m_doc=0L;
m_fileformatsscanned = false;
m_showMenuBarAction = 0;
// this routine will find and load our Part. it finds the Part by
// name which is a bad idea usually.. but it's alright in this
// case since our Part is made for this Shell
@ -285,7 +286,8 @@ void Shell::setFullScreen( bool useFullScreen )
void Shell::showEvent(QShowEvent *e)
{
m_showMenuBarAction->setChecked( menuBar()->isVisible() );
if (m_showMenuBarAction)
m_showMenuBarAction->setChecked( menuBar()->isVisible() );
KParts::MainWindow::showEvent(e);
}