btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / apps / softwareupdater / WorkingLooper.cpp
blob0c5ae4a6c08d49cd54e39c6d0a1b9e618a62ada5
1 /*
2 * Copyright 2017, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Brian Hill <supernova@tycho.email>
7 */
10 #include "WorkingLooper.h"
13 WorkingLooper::WorkingLooper(update_type action, bool verbose)
15 BLooper("WorkingLooper"),
16 fUpdateAction(NULL),
17 fCheckAction(NULL),
18 fActionRequested(action),
19 fVerbose(verbose)
21 Run();
22 PostMessage(kMsgStart);
26 WorkingLooper::~WorkingLooper()
28 delete fUpdateAction;
29 delete fCheckAction;
33 void
34 WorkingLooper::MessageReceived(BMessage* message)
36 switch (message->what) {
37 case kMsgStart:
39 if (fActionRequested == UPDATE_CHECK_ONLY) {
40 fCheckAction = new CheckAction(fVerbose);
41 fCheckAction->Perform();
42 } else {
43 fUpdateAction = new UpdateAction(fVerbose);
44 fUpdateAction->Perform(fActionRequested);
46 break;
49 default:
50 BLooper::MessageReceived(message);