{
}
-/*
- * cleanup what ever is left from the MainWindows
- */
DolphinApplication::~DolphinApplication()
{
- while( m_mainWindows.count() != 0 )
+ // cleanup what ever is left from the MainWindows
+ while (m_mainWindows.count() != 0) {
delete m_mainWindows.takeFirst();
+ }
}
DolphinApplication* DolphinApplication::app()
DolphinMainWindow* DolphinApplication::createMainWindow()
{
- DolphinMainWindow* mainwindow = new DolphinMainWindow;
- mainwindow->init();
-
- m_mainWindows.append( mainwindow );
- return mainwindow;
+ DolphinMainWindow* mainWindow = new DolphinMainWindow();
+ mainWindow->init();
+
+ m_mainWindows.append(mainWindow);
+ return mainWindow;
}
-void DolphinApplication::removeMainWindow( DolphinMainWindow *mainwindow )
+void DolphinApplication::removeMainWindow(DolphinMainWindow* mainWindow)
{
- m_mainWindows.removeAll( mainwindow );
+ m_mainWindows.removeAll(mainWindow);
}
void DolphinApplication::refreshMainWindows()
{
- for( int i = 0; i < m_mainWindows.count(); ++i ) {
+ for (int i = 0; i < m_mainWindows.count(); ++i) {
m_mainWindows[i]->refreshViews();
}
}
#include "dolphinapplication.moc"
-
class DolphinMainWindow;
/**
- *
- * DolphinApplication will hold application wide data which
- * can be accessed.
+ * @brief Holds the application data which can be accessed.
* At first this will hold a list of DolphinMainWindows which
- * we will delete on application exit.
+ * we will delete on application exit.
*/
-class DolphinApplication : public KApplication {
+class DolphinApplication : public KApplication
+{
Q_OBJECT
friend class DolphinMainWindow;
+
public:
DolphinApplication();
- ~DolphinApplication();
+ virtual ~DolphinApplication();
static DolphinApplication* app();
void refreshMainWindows();
protected:
- /**
- * called by the MainWindow to deregister
- */
- void removeMainWindow( DolphinMainWindow* );
+ /** Called by the DolphinMainWindow to deregister. */
+ void removeMainWindow(DolphinMainWindow* mainWindow);
private:
QList<DolphinMainWindow*> m_mainWindows;
};
-
#endif