From 0f5e6b41e7506b1f659b535e163630d1394f67fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 24 Jun 2007 11:45:50 +0000 Subject: [PATCH] * remove QuitRequested() implementation again, because the bug that MediaPlayer didn't quit was really in BApplication (the fix there also fixes other apps not quitting, like Icon-O-Matic and probably others) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21502 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/mediaplayer/MainApp.cpp | 12 +++--------- src/apps/mediaplayer/MainApp.h | 27 ++++++++++++--------------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/apps/mediaplayer/MainApp.cpp b/src/apps/mediaplayer/MainApp.cpp index fb5c5ff3db..7ee83fb059 100644 --- a/src/apps/mediaplayer/MainApp.cpp +++ b/src/apps/mediaplayer/MainApp.cpp @@ -30,8 +30,8 @@ MainApp *gMainApp; MainApp::MainApp() : BApplication("application/x-vnd.Haiku-MediaPlayer"), - fFirstWindow(NewWindow()), - fPlayerCount(1) + fPlayerCount(0), + fFirstWindow(NewWindow()) { } @@ -129,17 +129,11 @@ MainApp::AboutRequested() } -bool -MainApp::QuitRequested() -{ - return true; -} - - int main() { gMainApp = new MainApp; gMainApp->Run(); + delete gMainApp; return 0; } diff --git a/src/apps/mediaplayer/MainApp.h b/src/apps/mediaplayer/MainApp.h index 23ca380e0f..0bc36c63cd 100644 --- a/src/apps/mediaplayer/MainApp.h +++ b/src/apps/mediaplayer/MainApp.h @@ -23,31 +23,28 @@ #include #include "MainWin.h" -enum -{ +enum { M_PLAYER_QUIT = 'plqt', }; -class MainApp : public BApplication -{ +class MainApp : public BApplication { public: - MainApp(); - ~MainApp(); + MainApp(); + virtual ~MainApp(); - BWindow * NewWindow(); + BWindow* NewWindow(); private: - void RefsReceived(BMessage *msg); - void ArgvReceived(int32 argc, char **argv); - void MessageReceived(BMessage *msg); - void AboutRequested(); - bool QuitRequested(); + virtual void RefsReceived(BMessage* message); + virtual void ArgvReceived(int32 argc, char** argv); + virtual void MessageReceived(BMessage* message); + virtual void AboutRequested(); private: - BWindow * fFirstWindow; - int32 fPlayerCount; + int32 fPlayerCount; + BWindow* fFirstWindow; }; -extern MainApp *gMainApp; +extern MainApp* gMainApp; #endif