summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/main.cpp b/src/main.cpp
index e8e7d36..02da9e1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2,12 +2,9 @@
#include <tdecmdlineargs.h>
#include <tdeaboutdata.h>
#include <tdelocale.h>
-#include <tdeconfig.h>
-#include <tdeglobal.h>
-#include "model/pulsemodel.h"
-#include "ui/mixerwindow.h"
#include "ui/tmixapp.h"
+#include "ui/backendcontroller.h"
static TDECmdLineOptions options[] = { TDECmdLineLastOption };
@@ -31,19 +28,12 @@ int main( int argc, char **argv )
TmixApp app;
app.disableSessionManagement();
- PulseModel *model = new PulseModel;
- if ( !model->open() ) {
- delete model;
- return 1;
- }
+ // No parent — we delete ctrl explicitly before app exits so that
+ // TmixTray's X11 teardown happens while the display is still open.
+ BackendController *ctrl = new BackendController;
+ ctrl->start();
- MixerWindow *win = new MixerWindow( model );
- app.setMainWindow( win );
-
- TDEConfig *cfg = TDEGlobal::config();
- cfg->setGroup("General");
- if ( !cfg->readBoolEntry("DockInTray", true) )
- win->show();
-
- return app.exec();
+ int ret = app.exec();
+ delete ctrl;
+ return ret;
}