ScreenSaverApp: Style fixes

Update copyright info
This commit is contained in:
John Scipione
2013-09-10 18:09:49 -04:00
parent 4843382d02
commit b3aa1c10f5
+21 -15
View File
@@ -1,15 +1,13 @@
/* /*
* Copyright 2003-2006, Haiku. * Copyright 2003-2013 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Michael Phipps
* Jérôme Duval, [email protected] * Jérôme Duval, [email protected]
* Michael Phipps
*/ */
#include "ScreenSaverWindow.h"
#include <Application.h> #include <Application.h>
#include <Entry.h> #include <Entry.h>
#include <Path.h> #include <Path.h>
@@ -18,19 +16,25 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "ScreenSaverWindow.h"
class ScreenSaverApp : public BApplication { class ScreenSaverApp : public BApplication {
public: public:
ScreenSaverApp(); ScreenSaverApp();
virtual void RefsReceived(BMessage *message); virtual void RefsReceived(BMessage* message);
private: private:
BWindow *fScreenSaverWindow; BWindow* fScreenSaverWindow;
}; };
// #pragma mark - ScreenSaverApp
ScreenSaverApp::ScreenSaverApp() ScreenSaverApp::ScreenSaverApp()
: BApplication("application/x-vnd.Haiku-ScreenSaver") :
BApplication("application/x-vnd.Haiku-ScreenSaver")
{ {
fScreenSaverWindow = new ScreenSaverWindow(); fScreenSaverWindow = new ScreenSaverWindow();
fScreenSaverWindow->Show(); fScreenSaverWindow->Show();
@@ -38,7 +42,7 @@ ScreenSaverApp::ScreenSaverApp()
void void
ScreenSaverApp::RefsReceived(BMessage *message) ScreenSaverApp::RefsReceived(BMessage* message)
{ {
entry_ref ref; entry_ref ref;
if (message->FindRef("refs", &ref) != B_OK) if (message->FindRef("refs", &ref) != B_OK)
@@ -46,7 +50,7 @@ ScreenSaverApp::RefsReceived(BMessage *message)
// Install the screen saver by copying it to the add-ons directory // Install the screen saver by copying it to the add-ons directory
// TODO: the translator have a similar mechanism - this could be cleaned // TODO: the translator have a similar mechanism - this could be cleaned
// up and have one nicely working solution // up and have one nicely working solution
// TODO: should test if the dropped ref is really a screen saver! // TODO: should test if the dropped ref is really a screen saver!
// TODO: you can receive more than one ref at a time... // TODO: you can receive more than one ref at a time...
@@ -59,14 +63,16 @@ ScreenSaverApp::RefsReceived(BMessage *message)
entry.GetPath(&path); entry.GetPath(&path);
// TODO: find_directory() anyone?? // TODO: find_directory() anyone??
char temp[2*B_PATH_NAME_LENGTH]; char temp[B_PATH_NAME_LENGTH * 2];
sprintf(temp,"cp %s '/boot/home/config/add-ons/Screen Savers/'\n", path.Path()); sprintf(temp, "cp %s '/boot/home/config/add-ons/Screen Savers/'\n",
path.Path());
system(temp); system(temp);
fScreenSaverWindow->PostMessage(kMsgUpdateList); fScreenSaverWindow->PostMessage(kMsgUpdateList);
} }
// #pragma mark - // #pragma mark - main()
int int