17 |
17 |
18 #include "searchapplication.h" |
18 #include "searchapplication.h" |
19 #include <qstatemachine.h> |
19 #include <qstatemachine.h> |
20 #include <searchruntimeprovider.h> |
20 #include <searchruntimeprovider.h> |
21 #include <searchruntime.h> |
21 #include <searchruntime.h> |
|
22 #include <hbapplication.h> |
22 |
23 |
23 // --------------------------------------------------------------------------- |
24 // --------------------------------------------------------------------------- |
24 // SearchApplication::SearchApplication |
25 // SearchApplication::SearchApplication |
25 // --------------------------------------------------------------------------- |
26 // --------------------------------------------------------------------------- |
26 // |
27 // |
27 SearchApplication::SearchApplication(QObject* aParent) : |
28 SearchApplication::SearchApplication(int argc, char *argv[]) : |
28 QObject(aParent), mRuntime(NULL) |
29 HbApplication(argc, argv), mRuntime(NULL) |
29 { |
30 { |
30 SEARCH_FUNC_ENTRY("SEARCH::SearchApplication::SearchApplication"); |
31 SEARCH_FUNC_ENTRY("SEARCH::SearchApplication::SearchApplication"); SEARCH_FUNC_EXIT("SEARCH::SearchApplication::SearchApplication"); |
31 |
|
32 SearchRuntimeProvider *interface = new SearchRuntimeProvider(); |
|
33 mRuntime = interface->createPlugin(); |
|
34 if (mRuntime) |
|
35 { |
|
36 mRuntime->setParent(this); |
|
37 connect(mRuntime, SIGNAL(started()),this, SLOT(handleRuntimeStarted())); |
|
38 connect(mRuntime, SIGNAL(stopped()),this, SLOT(handleRuntimeStopped())); |
|
39 connect(mRuntime, SIGNAL(faulted()),this, SLOT(handleRuntimeFaulted())); |
|
40 } |
|
41 SEARCH_FUNC_EXIT("SEARCH::SearchApplication::SearchApplication"); |
|
42 } |
32 } |
43 |
33 |
44 // --------------------------------------------------------------------------- |
34 // --------------------------------------------------------------------------- |
45 // SearchApplication::~SearchApplication() |
35 // SearchApplication::~SearchApplication() |
46 // --------------------------------------------------------------------------- |
36 // --------------------------------------------------------------------------- |
47 // |
37 // |
48 SearchApplication::~SearchApplication() |
38 SearchApplication::~SearchApplication() |
49 { |
39 { |
|
40 if (mRuntime) |
|
41 { |
|
42 mRuntime->stop(); |
|
43 } |
50 if (mRuntime) |
44 if (mRuntime) |
51 { |
45 { |
52 disconnect(mRuntime, SIGNAL(started()), this, |
46 disconnect(mRuntime, SIGNAL(started()), this, |
53 SLOT(handleRuntimeStarted())); |
47 SLOT(handleRuntimeStarted())); |
54 disconnect(mRuntime, SIGNAL(stopped()), this, |
48 disconnect(mRuntime, SIGNAL(stopped()), this, |
57 SLOT(handleRuntimeFaulted())); |
51 SLOT(handleRuntimeFaulted())); |
58 |
52 |
59 delete mRuntime; |
53 delete mRuntime; |
60 } |
54 } |
61 } |
55 } |
62 |
|
63 // --------------------------------------------------------------------------- |
56 // --------------------------------------------------------------------------- |
64 // SearchApplication::start() |
57 // SearchApplication::start() |
65 // --------------------------------------------------------------------------- |
58 // --------------------------------------------------------------------------- |
66 // |
59 // |
67 void SearchApplication::start() |
60 void SearchApplication::start() |
68 { |
61 { |
69 SEARCH_FUNC_ENTRY("SEARCH::Search::start"); |
62 SEARCH_FUNC_ENTRY("SEARCH::Search::start"); |
70 |
63 SearchRuntimeProvider *interface = new SearchRuntimeProvider(); |
|
64 mRuntime = interface->createPlugin(); |
|
65 if (mRuntime) |
|
66 { |
|
67 mRuntime->setParent(this); |
|
68 connect(mRuntime, SIGNAL(started()), this, |
|
69 SLOT(handleRuntimeStarted())); |
|
70 connect(mRuntime, SIGNAL(stopped()), this, |
|
71 SLOT(handleRuntimeStopped())); |
|
72 connect(mRuntime, SIGNAL(faulted()), this, |
|
73 SLOT(handleRuntimeFaulted())); |
|
74 connect(mRuntime, SIGNAL(sentMattiEventSignal()), this, |
|
75 SLOT(sentMattiEventSlot())); |
|
76 } |
71 if (mRuntime) |
77 if (mRuntime) |
72 { |
78 { |
73 mRuntime->start(); |
79 mRuntime->start(); |
74 } |
80 } |
75 else |
81 else |
76 { |
82 { |
77 emit exit(); |
83 emit exit(); |
78 } |
84 } SEARCH_FUNC_EXIT("SEARCH::Search::start"); |
79 |
|
80 SEARCH_FUNC_EXIT("SEARCH::Search::start"); |
|
81 } |
85 } |
82 |
86 |
83 // --------------------------------------------------------------------------- |
87 // --------------------------------------------------------------------------- |
84 // SearchApplication::stop() |
88 // SearchApplication::stop() |
85 // --------------------------------------------------------------------------- |
89 // --------------------------------------------------------------------------- |