Skip to content

Commit ff3762b

Browse files
committed
Options settings changed
1 parent d96dd2a commit ff3762b

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

Launcher.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,25 @@ SERVICE_REGISTRATION(Launcher, 1, 0);
8080
config.FromString(_service->ConfigLine());
8181

8282
_closeTime = (config.CloseTime.Value());
83-
_options.Set(config.Command.Value().c_str());
83+
84+
static Core::Process::Options options(config.Command.Value().c_str());
8485
auto iter = config.Parameters.Elements();
8586

8687
while (iter.Next() == true) {
8788
const Config::Parameter& element(iter.Current());
8889

8990
if ((element.Option.IsSet() == true) && (element.Option.Value().empty() == false)) {
9091
if ((element.Value.IsSet() == true) && (element.Value.Value().empty() == false)) {
91-
_options.Set(element.Option.Value(), element.Value.Value());
92+
options.Set(element.Option.Value(), element.Value.Value());
9293
}
9394
else {
94-
_options.Set(element.Option.Value());
95+
options.Set(element.Option.Value());
9596
}
9697
}
9798
}
98-
printf("%s:%s:%d \n", __FILE__, __func__, __LINE__);
99+
100+
_options = &options;
101+
99102
if (config.ScheduleTime.IsSet() == true) {
100103

101104
string time(config.ScheduleTime.Time.Value());
@@ -169,7 +172,7 @@ bool Launcher::LaunchJob(Time time)
169172
{
170173
bool status = true;
171174
if (time.Hour() == 0 && time.Minute() == 0 && time.Second() == 0) {
172-
_process.Launch(_options, &_pid);
175+
_process.Launch(*_options, &_pid);
173176

174177
if (_pid == 0) {
175178
_observer.Unregister(&_notification);

Launcher.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ class Launcher : public PluginHost::IPlugin {
343343
Schedule ScheduleTime;
344344
};
345345

346-
public:
347346
class Time {
347+
public:
348348
Time()
349349
: _hour(0)
350350
, _minute(0)
@@ -399,7 +399,7 @@ class Launcher : public PluginHost::IPlugin {
399399
return status;
400400
}
401401

402-
private:
402+
private:
403403
inline bool IsDigit(const string& str) {
404404
return (str.find_first_not_of( "0123456789" ) == std::string::npos);
405405
}
@@ -434,7 +434,7 @@ class Launcher : public PluginHost::IPlugin {
434434
return word;
435435
}
436436

437-
private:
437+
private:
438438
uint8_t _hour;
439439
uint8_t _minute;
440440
uint8_t _second;
@@ -482,7 +482,7 @@ class Launcher : public PluginHost::IPlugin {
482482
, _memory(nullptr)
483483
, _time()
484484
, _interval()
485-
, _options("")
485+
, _options(nullptr)
486486
, _client(this)
487487
, _activity(Core::ProxyType<PeriodicSync>::Create(_client))
488488
{
@@ -541,7 +541,7 @@ class Launcher : public PluginHost::IPlugin {
541541
static ProcessObserver _observer;
542542

543543
Launcher* _client;
544-
Core::Process::Options _options;
544+
Core::Process::Options* _options;
545545
Core::ProxyType<Core::IDispatchType<void> > _activity;
546546
};
547547

0 commit comments

Comments
 (0)