Diffstat (limited to 'noncore/apps/opie-console/session.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/session.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp index 03d0fcd..c166d95 100644 --- a/noncore/apps/opie-console/session.cpp +++ b/noncore/apps/opie-console/session.cpp | |||
@@ -1,68 +1,72 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | #include "profile.h" | ||
3 | #include "io_layer.h" | 4 | #include "io_layer.h" |
4 | #include "file_layer.h" | 5 | #include "file_layer.h" |
5 | #include "emulation_handler.h" | 6 | #include "emulation_handler.h" |
6 | #include "session.h" | 7 | #include "session.h" |
7 | 8 | ||
8 | 9 | ||
9 | Session::Session() { | 10 | Session::Session() { |
10 | m_widget = 0l; | 11 | m_widget = 0l; |
11 | m_layer = 0l; | 12 | m_layer = 0l; |
12 | m_emu = 0l; | 13 | m_emu = 0l; |
13 | } | 14 | } |
14 | Session::Session( const QString& na, QWidgetStack* widget, IOLayer* lay) | 15 | Session::Session( const QString& na, QWidgetStack* widget, IOLayer* lay) |
15 | : m_name( na ), m_widget( widget ), m_layer( lay ) | 16 | : m_name( na ), m_widget( widget ), m_layer( lay ) |
16 | { | 17 | { |
17 | // m_widLay = 0l; | 18 | // m_widLay = 0l; |
18 | // m_emLay = 0l; | 19 | // m_emLay = 0l; |
19 | m_emu = 0l; | 20 | m_emu = 0l; |
20 | } | 21 | } |
21 | Session::~Session() { | 22 | Session::~Session() { |
22 | delete m_layer; | 23 | delete m_layer; |
23 | delete m_emu; | 24 | delete m_emu; |
24 | delete m_widget; | 25 | delete m_widget; |
25 | /* the widget layer should be deleted by the m_widget */ | 26 | /* the widget layer should be deleted by the m_widget */ |
26 | } | 27 | } |
27 | QString Session::name()const { | 28 | QString Session::name()const { |
28 | return m_name; | 29 | return m_name; |
29 | } | 30 | } |
30 | QWidgetStack* Session::widgetStack() { | 31 | QWidgetStack* Session::widgetStack() { |
31 | return m_widget; | 32 | return m_widget; |
32 | } | 33 | } |
33 | IOLayer* Session::layer() { | 34 | IOLayer* Session::layer() { |
34 | return m_layer; | 35 | return m_layer; |
35 | } | 36 | } |
36 | EmulationHandler* Session::emulationHandler() { | 37 | EmulationHandler* Session::emulationHandler() { |
37 | return m_emu; | 38 | return m_emu; |
38 | } | 39 | } |
39 | QWidget* Session::widget() { | 40 | QWidget* Session::widget() { |
40 | if (!m_emu ) | 41 | if (!m_emu ) |
41 | return 0l; | 42 | return 0l; |
42 | 43 | ||
43 | return m_emu->widget(); | 44 | return m_emu->widget(); |
44 | } | 45 | } |
46 | Profile Session::profile()const { | ||
47 | return m_prof; | ||
48 | } | ||
45 | /* | 49 | /* |
46 | WidgetLayer* Session::emulationWidget() { | 50 | WidgetLayer* Session::emulationWidget() { |
47 | return m_widLay; | 51 | return m_widLay; |
48 | } | 52 | } |
49 | */ | 53 | */ |
50 | void Session::connect() { | 54 | void Session::connect() { |
51 | if ( !m_layer || !m_emu ) | 55 | if ( !m_layer || !m_emu ) |
52 | return; | 56 | return; |
53 | 57 | ||
54 | QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ), | 58 | QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ), |
55 | m_emu, SLOT(recv(const QByteArray&) ) ); | 59 | m_emu, SLOT(recv(const QByteArray&) ) ); |
56 | QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ), | 60 | QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ), |
57 | m_layer, SLOT(send(const QByteArray&) ) ); | 61 | m_layer, SLOT(send(const QByteArray&) ) ); |
58 | QObject::connect(m_emu, SIGNAL(changeSize(int, int) ), | 62 | QObject::connect(m_emu, SIGNAL(changeSize(int, int) ), |
59 | m_layer, SLOT(setSize(int, int) ) ); | 63 | m_layer, SLOT(setSize(int, int) ) ); |
60 | } | 64 | } |
61 | 65 | ||
62 | void Session::disconnect() { | 66 | void Session::disconnect() { |
63 | 67 | ||
64 | if ( !m_layer || !m_emu ) | 68 | if ( !m_layer || !m_emu ) |
65 | return; | 69 | return; |
66 | 70 | ||
67 | QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ), | 71 | QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ), |
68 | m_emu, SLOT(recv(const QByteArray&) ) ); | 72 | m_emu, SLOT(recv(const QByteArray&) ) ); |
@@ -70,31 +74,34 @@ void Session::disconnect() { | |||
70 | m_layer, SLOT(send(const QByteArray&) ) ); | 74 | m_layer, SLOT(send(const QByteArray&) ) ); |
71 | } | 75 | } |
72 | 76 | ||
73 | void Session::setName( const QString& na){ | 77 | void Session::setName( const QString& na){ |
74 | m_name = na; | 78 | m_name = na; |
75 | } | 79 | } |
76 | 80 | ||
77 | void Session::setWidgetStack( QWidgetStack* wid ) { | 81 | void Session::setWidgetStack( QWidgetStack* wid ) { |
78 | delete m_emu; | 82 | delete m_emu; |
79 | m_emu = 0l; | 83 | m_emu = 0l; |
80 | delete m_widget; | 84 | delete m_widget; |
81 | /* the EmulationLayer was destroyed... */ | 85 | /* the EmulationLayer was destroyed... */ |
82 | 86 | ||
83 | m_widget = wid; | 87 | m_widget = wid; |
84 | } | 88 | } |
85 | void Session::setIOLayer( IOLayer* lay ) { | 89 | void Session::setIOLayer( IOLayer* lay ) { |
86 | delete m_layer; | 90 | delete m_layer; |
87 | m_layer = lay; | 91 | m_layer = lay; |
88 | } | 92 | } |
89 | 93 | ||
90 | void Session::setEmulationHandler( EmulationHandler* lay ) { | 94 | void Session::setEmulationHandler( EmulationHandler* lay ) { |
91 | delete m_emu; | 95 | delete m_emu; |
92 | m_emu = lay; | 96 | m_emu = lay; |
93 | } | 97 | } |
98 | void Session::setProfile( const Profile& prof ) { | ||
99 | m_prof = prof; | ||
100 | } | ||
94 | /* | 101 | /* |
95 | void Session::setEmulationWidget( WidgetLayer* lay ) { | 102 | void Session::setEmulationWidget( WidgetLayer* lay ) { |
96 | delete m_widLay; | 103 | delete m_widLay; |
97 | m_widLay = lay; | 104 | m_widLay = lay; |
98 | } | 105 | } |
99 | */ | 106 | */ |
100 | 107 | ||