xref: /haiku/src/apps/softwareupdater/WorkingLooper.cpp (revision ad7783e44df140933511f09e6750f2de4b3ba608)
1*ad7783e4SBrian Hill /*
2*ad7783e4SBrian Hill  * Copyright 2017, Haiku, Inc. All Rights Reserved.
3*ad7783e4SBrian Hill  * Distributed under the terms of the MIT License.
4*ad7783e4SBrian Hill  *
5*ad7783e4SBrian Hill  * Authors:
6*ad7783e4SBrian Hill  *		Brian Hill <supernova@warpmail.net>
7*ad7783e4SBrian Hill  */
8*ad7783e4SBrian Hill 
9*ad7783e4SBrian Hill 
10*ad7783e4SBrian Hill #include "WorkingLooper.h"
11*ad7783e4SBrian Hill 
12*ad7783e4SBrian Hill 
13*ad7783e4SBrian Hill WorkingLooper::WorkingLooper()
14*ad7783e4SBrian Hill 	:
15*ad7783e4SBrian Hill 	BLooper("WorkingLooper")
16*ad7783e4SBrian Hill {
17*ad7783e4SBrian Hill 	Run();
18*ad7783e4SBrian Hill 	PostMessage(kMsgStart);
19*ad7783e4SBrian Hill }
20*ad7783e4SBrian Hill 
21*ad7783e4SBrian Hill 
22*ad7783e4SBrian Hill void
23*ad7783e4SBrian Hill WorkingLooper::MessageReceived(BMessage* message)
24*ad7783e4SBrian Hill {
25*ad7783e4SBrian Hill 	switch (message->what) {
26*ad7783e4SBrian Hill 		case kMsgStart:
27*ad7783e4SBrian Hill 		{
28*ad7783e4SBrian Hill 			fAction.Perform();
29*ad7783e4SBrian Hill 			break;
30*ad7783e4SBrian Hill 		}
31*ad7783e4SBrian Hill 
32*ad7783e4SBrian Hill 		default:
33*ad7783e4SBrian Hill 			BLooper::MessageReceived(message);
34*ad7783e4SBrian Hill 	}
35*ad7783e4SBrian Hill }
36