move the code to detect if we're a KPart to its own method
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1089609
This commit is contained in:
parent
d0a66f66e1
commit
f8b36e35b5
|
@ -67,9 +67,7 @@ void MainWindow::init()
|
||||||
listOperations().setActionCollection(actionCollection());
|
listOperations().setActionCollection(actionCollection());
|
||||||
pmWidget().init(actionCollection(), "partitionmanagerrc");
|
pmWidget().init(actionCollection(), "partitionmanagerrc");
|
||||||
|
|
||||||
// If we were called with an action collection we're supposed to be a KPart, so don't
|
if (isKPart())
|
||||||
// create the GUI in that case.
|
|
||||||
if (m_ActionCollection != NULL)
|
|
||||||
setupGUI(ToolBar | Keys | StatusBar | Save);
|
setupGUI(ToolBar | Keys | StatusBar | Save);
|
||||||
else
|
else
|
||||||
setupGUI(ToolBar | Keys | StatusBar | Save | Create);
|
setupGUI(ToolBar | Keys | StatusBar | Save | Create);
|
||||||
|
@ -218,3 +216,8 @@ void MainWindow::on_m_PartitionManagerWidget_selectedPartitionChanged(const Part
|
||||||
updateWindowTitle();
|
updateWindowTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MainWindow::isKPart() const
|
||||||
|
{
|
||||||
|
// If we were instantiated with an action collection we're supposed to be a KPart
|
||||||
|
return m_ActionCollection != NULL;
|
||||||
|
}
|
||||||
|
|
|
@ -86,6 +86,8 @@ class LIBPARTITIONMANAGERPRIVATE_EXPORT MainWindow : public KXmlGuiWindow, publi
|
||||||
QLabel& statusText() { Q_ASSERT(m_StatusText); return *m_StatusText; }
|
QLabel& statusText() { Q_ASSERT(m_StatusText); return *m_StatusText; }
|
||||||
const QLabel& statusText() const { Q_ASSERT(m_StatusText); return *m_StatusText; }
|
const QLabel& statusText() const { Q_ASSERT(m_StatusText); return *m_StatusText; }
|
||||||
|
|
||||||
|
bool isKPart() const;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void closeEvent(QCloseEvent*);
|
void closeEvent(QCloseEvent*);
|
||||||
void changeEvent(QEvent* event);
|
void changeEvent(QEvent* event);
|
||||||
|
|
Loading…
Reference in New Issue