summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/session.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/session.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/session.cpp7
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
9Session::Session() { 10Session::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}
14Session::Session( const QString& na, QWidgetStack* widget, IOLayer* lay) 15Session::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}
21Session::~Session() { 22Session::~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}
27QString Session::name()const { 28QString Session::name()const {
28 return m_name; 29 return m_name;
29} 30}
30QWidgetStack* Session::widgetStack() { 31QWidgetStack* Session::widgetStack() {
31 return m_widget; 32 return m_widget;
32} 33}
33IOLayer* Session::layer() { 34IOLayer* Session::layer() {
34 return m_layer; 35 return m_layer;
35} 36}
36EmulationHandler* Session::emulationHandler() { 37EmulationHandler* Session::emulationHandler() {
37 return m_emu; 38 return m_emu;
38} 39}
39QWidget* Session::widget() { 40QWidget* 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}
46Profile Session::profile()const {
47 return m_prof;
48}
45/* 49/*
46WidgetLayer* Session::emulationWidget() { 50WidgetLayer* Session::emulationWidget() {
47 return m_widLay; 51 return m_widLay;
48} 52}
49*/ 53*/
50void Session::connect() { 54void 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
62void Session::disconnect() { 66void 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
73void Session::setName( const QString& na){ 77void Session::setName( const QString& na){
74 m_name = na; 78 m_name = na;
75} 79}
76 80
77void Session::setWidgetStack( QWidgetStack* wid ) { 81void 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}
85void Session::setIOLayer( IOLayer* lay ) { 89void Session::setIOLayer( IOLayer* lay ) {
86 delete m_layer; 90 delete m_layer;
87 m_layer = lay; 91 m_layer = lay;
88} 92}
89 93
90void Session::setEmulationHandler( EmulationHandler* lay ) { 94void Session::setEmulationHandler( EmulationHandler* lay ) {
91 delete m_emu; 95 delete m_emu;
92 m_emu = lay; 96 m_emu = lay;
93} 97}
98void Session::setProfile( const Profile& prof ) {
99 m_prof = prof;
100}
94/* 101/*
95void Session::setEmulationWidget( WidgetLayer* lay ) { 102void 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