author | wazlaf <wazlaf> | 2002-10-13 11:19:40 (UTC) |
---|---|---|
committer | wazlaf <wazlaf> | 2002-10-13 11:19:40 (UTC) |
commit | 901531f0afcd36e5260cc4b452dde359d82bce85 (patch) (unidiff) | |
tree | 9030a524f15b05f204a02eadfcd36ba170060b30 | |
parent | fb76065a9041fb9c0fef43127509dcdb2478c1ab (diff) | |
download | opie-901531f0afcd36e5260cc4b452dde359d82bce85.zip opie-901531f0afcd36e5260cc4b452dde359d82bce85.tar.gz opie-901531f0afcd36e5260cc4b452dde359d82bce85.tar.bz2 |
segfault fix
-rw-r--r-- | noncore/apps/opie-console/emulation_widget.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/emulation_widget.cpp b/noncore/apps/opie-console/emulation_widget.cpp index 318d7bb..e11c5e4 100644 --- a/noncore/apps/opie-console/emulation_widget.cpp +++ b/noncore/apps/opie-console/emulation_widget.cpp | |||
@@ -1,99 +1,99 @@ | |||
1 | // opie-console includes | 1 | // opie-console includes |
2 | #include "emulation_widget.h" | 2 | #include "emulation_widget.h" |
3 | #include "common.h" | 3 | #include "common.h" |
4 | #include "widget_layer.h" | 4 | #include "widget_layer.h" |
5 | #include "profile.h" | 5 | #include "profile.h" |
6 | 6 | ||
7 | // qt includes | 7 | // qt includes |
8 | #include <qwidget.h> | 8 | #include <qwidget.h> |
9 | #include <qarray.h> | 9 | #include <qarray.h> |
10 | #include <qstring.h> | 10 | #include <qstring.h> |
11 | #include <qpainter.h> | 11 | #include <qpainter.h> |
12 | #include <qrect.h> | 12 | #include <qrect.h> |
13 | #include <qscrollbar.h> | 13 | #include <qscrollbar.h> |
14 | 14 | ||
15 | #define rimX 0 // left/right rim width | 15 | #define rimX 0 // left/right rim width |
16 | #define rimY 0 // top/bottom rim high | 16 | #define rimY 0 // top/bottom rim high |
17 | 17 | ||
18 | #define SCRWIDTH 16 // width of scrollbar | 18 | #define SCRWIDTH 16 // width of scrollbar |
19 | 19 | ||
20 | EmulationWidget::EmulationWidget( const Profile& config, QWidget *parent, const char* name ) : WidgetLayer( config, parent, name ) | 20 | EmulationWidget::EmulationWidget( const Profile& config, QWidget *parent, const char* name ) : WidgetLayer( config, parent, name ) |
21 | { | 21 | { |
22 | 22 | ||
23 | // initialize font attributes | 23 | // initialize font attributes |
24 | QFontMetrics fm( font() ); | 24 | QFontMetrics fm( font() ); |
25 | f_height = fm.height(); | 25 | f_height = fm.height(); |
26 | f_width = fm.maxWidth(); | 26 | f_width = fm.maxWidth(); |
27 | f_ascent = fm.ascent(); | 27 | f_ascent = fm.ascent(); |
28 | 28 | ||
29 | // give reasonable defaults to m_columns, m_lines | ||
30 | calcGeometry(); | ||
31 | |||
32 | // initialize scrollbar related vars | 29 | // initialize scrollbar related vars |
33 | m_scrollbar = new QScrollBar( this ); | 30 | m_scrollbar = new QScrollBar( this ); |
34 | m_scrollbar->setCursor( arrowCursor ); | 31 | m_scrollbar->setCursor( arrowCursor ); |
35 | 32 | ||
33 | // give reasonable defaults to m_columns, m_lines | ||
34 | calcGeometry(); | ||
35 | |||
36 | // load config | 36 | // load config |
37 | reloadConfig( config ); | 37 | reloadConfig( config ); |
38 | 38 | ||
39 | m_resizing = false; | 39 | m_resizing = false; |
40 | } | 40 | } |
41 | 41 | ||
42 | void EmulationWidget::reloadConfig( const Profile& config ) | 42 | void EmulationWidget::reloadConfig( const Profile& config ) |
43 | { | 43 | { |
44 | 44 | ||
45 | // nothing yet | 45 | // nothing yet |
46 | } | 46 | } |
47 | 47 | ||
48 | EmulationWidget::~EmulationWidget() | 48 | EmulationWidget::~EmulationWidget() |
49 | { | 49 | { |
50 | //clean up | 50 | //clean up |
51 | } | 51 | } |
52 | 52 | ||
53 | static QChar vt100extended(QChar c) | 53 | static QChar vt100extended(QChar c) |
54 | { | 54 | { |
55 | switch (c.unicode()) | 55 | switch (c.unicode()) |
56 | { | 56 | { |
57 | case 0x25c6 : return 1; | 57 | case 0x25c6 : return 1; |
58 | case 0x2592 : return 2; | 58 | case 0x2592 : return 2; |
59 | case 0x2409 : return 3; | 59 | case 0x2409 : return 3; |
60 | case 0x240c : return 4; | 60 | case 0x240c : return 4; |
61 | case 0x240d : return 5; | 61 | case 0x240d : return 5; |
62 | case 0x240a : return 6; | 62 | case 0x240a : return 6; |
63 | case 0x00b0 : return 7; | 63 | case 0x00b0 : return 7; |
64 | case 0x00b1 : return 8; | 64 | case 0x00b1 : return 8; |
65 | case 0x2424 : return 9; | 65 | case 0x2424 : return 9; |
66 | case 0x240b : return 10; | 66 | case 0x240b : return 10; |
67 | case 0x2518 : return 11; | 67 | case 0x2518 : return 11; |
68 | case 0x2510 : return 12; | 68 | case 0x2510 : return 12; |
69 | case 0x250c : return 13; | 69 | case 0x250c : return 13; |
70 | case 0x2514 : return 14; | 70 | case 0x2514 : return 14; |
71 | case 0x253c : return 15; | 71 | case 0x253c : return 15; |
72 | case 0xf800 : return 16; | 72 | case 0xf800 : return 16; |
73 | case 0xf801 : return 17; | 73 | case 0xf801 : return 17; |
74 | case 0x2500 : return 18; | 74 | case 0x2500 : return 18; |
75 | case 0xf803 : return 19; | 75 | case 0xf803 : return 19; |
76 | case 0xf804 : return 20; | 76 | case 0xf804 : return 20; |
77 | case 0x251c : return 21; | 77 | case 0x251c : return 21; |
78 | case 0x2524 : return 22; | 78 | case 0x2524 : return 22; |
79 | case 0x2534 : return 23; | 79 | case 0x2534 : return 23; |
80 | case 0x252c : return 24; | 80 | case 0x252c : return 24; |
81 | case 0x2502 : return 25; | 81 | case 0x2502 : return 25; |
82 | case 0x2264 : return 26; | 82 | case 0x2264 : return 26; |
83 | case 0x2265 : return 27; | 83 | case 0x2265 : return 27; |
84 | case 0x03c0 : return 28; | 84 | case 0x03c0 : return 28; |
85 | case 0x2260 : return 29; | 85 | case 0x2260 : return 29; |
86 | case 0x00a3 : return 30; | 86 | case 0x00a3 : return 30; |
87 | case 0x00b7 : return 31; | 87 | case 0x00b7 : return 31; |
88 | } | 88 | } |
89 | return c; | 89 | return c; |
90 | } | 90 | } |
91 | 91 | ||
92 | 92 | ||
93 | 93 | ||
94 | void EmulationWidget::setImage( QArray<Character> const newimg, int lines, int columns ) | 94 | void EmulationWidget::setImage( QArray<Character> const newimg, int lines, int columns ) |
95 | { | 95 | { |
96 | const QPixmap* pm = backgroundPixmap(); | 96 | const QPixmap* pm = backgroundPixmap(); |
97 | QPainter paint; | 97 | QPainter paint; |
98 | 98 | ||
99 | // dont allow updates, while drawing | 99 | // dont allow updates, while drawing |