From 72a7ad1137ecd8f0f027b2bdf270f296504820d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sundstr=C3=B6m?= Date: Wed, 9 Sep 2009 01:35:20 +0000 Subject: [PATCH] Replace process_refs() with the same from TrackerAddOnAppLaunch.h, and adapt to it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33015 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/tracker/zipomatic/Jamfile | 2 ++ src/add-ons/tracker/zipomatic/ZipOMatic.cpp | 26 ++++++++------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/add-ons/tracker/zipomatic/Jamfile b/src/add-ons/tracker/zipomatic/Jamfile index a4381dd7fd..14e9457b0e 100644 --- a/src/add-ons/tracker/zipomatic/Jamfile +++ b/src/add-ons/tracker/zipomatic/Jamfile @@ -1,5 +1,7 @@ SubDir HAIKU_TOP src add-ons tracker zipomatic ; +UsePrivateHeaders shared ; + Application ZipOMatic-Z : GenericThread.cpp ZipOMatic.cpp diff --git a/src/add-ons/tracker/zipomatic/ZipOMatic.cpp b/src/add-ons/tracker/zipomatic/ZipOMatic.cpp index 95d5843833..b0856b912c 100644 --- a/src/add-ons/tracker/zipomatic/ZipOMatic.cpp +++ b/src/add-ons/tracker/zipomatic/ZipOMatic.cpp @@ -7,27 +7,12 @@ #include #include #include -#include +#include #include "ZipOMaticMisc.h" #include "ZipOMaticWindow.h" -extern "C" void -process_refs(entry_ref dirRef, BMessage* message, void*) -{ - status_t status = B_OK; - type_code refType = B_REF_TYPE; - int32 refCount = 0; - - status = message->GetInfo("refs", &refType, &refCount); - if (status != B_OK || refCount < 1) - be_roster->Launch(ZIPOMATIC_APP_SIG); - else - be_roster->Launch(ZIPOMATIC_APP_SIG, message); -} - - int main() { @@ -65,6 +50,15 @@ ZipOMatic::~ZipOMatic() void ZipOMatic::RefsReceived(BMessage* message) { + message->RemoveName("dir_ref"); + + entry_ref ref; + if (message->FindRef("refs", &ref) != B_OK) { + if (!IsLaunching()) + PostMessage(B_SILENT_RELAUNCH); + return; + } + if (IsLaunching()) fGotRefs = true;