summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/screen.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/screen.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/screen.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/noncore/apps/opie-console/screen.cpp b/noncore/apps/opie-console/screen.cpp
index 8ebc47d..a796ba1 100644
--- a/noncore/apps/opie-console/screen.cpp
+++ b/noncore/apps/opie-console/screen.cpp
@@ -69,5 +69,5 @@ Screen::Screen(int lines, int columns)
69 this->columns = columns; 69 this->columns = columns;
70 70
71 image = (Character*) malloc(lines*columns*sizeof(Character)); 71 image = QArray<Character>( lines*columns );
72 tabstops = NULL; initTabStops(); 72 tabstops = NULL; initTabStops();
73 73
@@ -83,5 +83,5 @@ Screen::Screen(int lines, int columns)
83Screen::~Screen() 83Screen::~Screen()
84{ 84{
85 free(image); 85 delete image;
86 if (tabstops) free(tabstops); 86 if (tabstops) free(tabstops);
87} 87}
@@ -395,5 +395,5 @@ void Screen::resizeImage(int new_lines, int new_columns)
395 395
396 // make new image 396 // make new image
397 Character* newimg = (Character*) malloc(new_lines*new_columns*sizeof(Character)); 397 QArray<Character> newimg = QArray<Character>( new_lines * new_columns );
398 398
399 clearSelection(); 399 clearSelection();
@@ -419,5 +419,5 @@ void Screen::resizeImage(int new_lines, int new_columns)
419 newimg[y*new_columns+x].r = image[loc(x,y)].r; 419 newimg[y*new_columns+x].r = image[loc(x,y)].r;
420 } 420 }
421 free(image); 421 delete image;
422 image = newimg; 422 image = newimg;
423 lines = new_lines; 423 lines = new_lines;
@@ -505,5 +505,5 @@ void Screen::effectiveRendition()
505*/ 505*/
506 506
507Character* Screen::getCookedImage() 507QArray<Character> Screen::getCookedImage()
508{ int x,y; 508{ int x,y;
509 Character* merged = (Character*) malloc(lines*columns*sizeof(Character)); 509 Character* merged = (Character*) malloc(lines*columns*sizeof(Character));
@@ -548,5 +548,7 @@ Character* Screen::getCookedImage()
548 if (getMode(MODE_Cursor) && (cuY+(hist.getLines()-histCursor) < lines)) // cursor visible 548 if (getMode(MODE_Cursor) && (cuY+(hist.getLines()-histCursor) < lines)) // cursor visible
549 reverseRendition(&merged[loc(cuX,cuY+(hist.getLines()-histCursor))]); 549 reverseRendition(&merged[loc(cuX,cuY+(hist.getLines()-histCursor))]);
550 return merged; 550 QArray<Character> res( sizeof( merged ) / sizeof( Character ) );
551 res.assign( merged, sizeof( merged ) / sizeof( Character ) );
552 return res;
551} 553}
552 554
@@ -1160,5 +1162,5 @@ void Screen::addHistLine()
1160 end -= 1; 1162 end -= 1;
1161 1163
1162 hist.addCells(image,end+1); 1164 hist.addCells(image.data(), end+1);
1163 hist.addLine(); 1165 hist.addLine();
1164 1166