summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/checkbook/listedit.cpp2
-rw-r--r--noncore/apps/opie-console/TEScreen.cpp4
-rw-r--r--noncore/apps/opie-sheet/Excel.cpp2
-rw-r--r--noncore/apps/tinykate/libkate/document/katedocument.cpp4
-rw-r--r--noncore/comm/keypebble/krfbdecoder.cpp6
-rw-r--r--noncore/games/sfcave/sfcave.cpp2
-rw-r--r--noncore/settings/aqpkg/settingsimpl.cpp2
-rw-r--r--noncore/settings/aqpkg/version.cpp2
8 files changed, 12 insertions, 12 deletions
diff --git a/noncore/apps/checkbook/listedit.cpp b/noncore/apps/checkbook/listedit.cpp
index e40377b..b297d69 100644
--- a/noncore/apps/checkbook/listedit.cpp
+++ b/noncore/apps/checkbook/listedit.cpp
@@ -215,49 +215,49 @@ void ListEdit::fixTypes(int iColumn)
215 uint iChk=iNext+1; 215 uint iChk=iNext+1;
216 while( iChk<lst.count() ) { 216 while( iChk<lst.count() ) {
217 QString *chk=lst.at(iChk); 217 QString *chk=lst.at(iChk);
218 if( !chk->startsWith(*current) ) break; 218 if( !chk->startsWith(*current) ) break;
219 if( *chk==repl ) { 219 if( *chk==repl ) {
220 bDup=true; 220 bDup=true;
221 break; 221 break;
222 } 222 }
223 iChk++; 223 iChk++;
224 } 224 }
225 if( !bDup ) { 225 if( !bDup ) {
226 *lst.at(iNext)=repl; 226 *lst.at(iNext)=repl;
227 break; 227 break;
228 } 228 }
229 } 229 }
230 } 230 }
231 } 231 }
232 lst.sort(); 232 lst.sort();
233 233
234 // copy back clean up col map 234 // copy back clean up col map
235 for(int i=0; i<_typeTable->childCount(); i++) { 235 for(int i=0; i<_typeTable->childCount(); i++) {
236 colMap[i]->getItem()->setText(iColumn, colMap[i]->getValue()); 236 colMap[i]->getItem()->setText(iColumn, colMap[i]->getValue());
237 delete colMap[i]; 237 delete colMap[i];
238 } 238 }
239 delete colMap; 239 delete [] colMap;
240} 240}
241 241
242void ListEdit::fixTypes() 242void ListEdit::fixTypes()
243{ 243{
244 int i; 244 int i;
245 ColumnDef *pDef; 245 ColumnDef *pDef;
246 for(pDef=this->first(), i=0; pDef; pDef=this->next(), i++) { 246 for(pDef=this->first(), i=0; pDef; pDef=this->next(), i++) {
247 if( pDef->hasFlag(ColumnDef::typeUnique) ) 247 if( pDef->hasFlag(ColumnDef::typeUnique) )
248 fixTypes(i); 248 fixTypes(i);
249 } 249 }
250 _typeTable->sort(); 250 _typeTable->sort();
251} 251}
252 252
253 253
254// --- storeInList ------------------------------------------------------------ 254// --- storeInList ------------------------------------------------------------
255void ListEdit::storeInList(QStringList &lst) 255void ListEdit::storeInList(QStringList &lst)
256{ 256{
257 // delete old content 257 // delete old content
258 lst.clear(); 258 lst.clear();
259 259
260 // add new one 260 // add new one
261 fixTypes(); 261 fixTypes();
262 QListViewItem *itm=_typeTable->firstChild(); 262 QListViewItem *itm=_typeTable->firstChild();
263 while( itm ) { 263 while( itm ) {
diff --git a/noncore/apps/opie-console/TEScreen.cpp b/noncore/apps/opie-console/TEScreen.cpp
index 2675d31..8e91532 100644
--- a/noncore/apps/opie-console/TEScreen.cpp
+++ b/noncore/apps/opie-console/TEScreen.cpp
@@ -1094,50 +1094,50 @@ QString TEScreen::getSelText(const BOOL preserve_line_breaks)
1094 m[d++] = ' '; 1094 m[d++] = ' ';
1095 } 1095 }
1096 } 1096 }
1097 else 1097 else
1098 { 1098 {
1099 m[d++] = ((preserve_line_breaks || 1099 m[d++] = ((preserve_line_breaks ||
1100 ((eol % columns) == 0)) ? 1100 ((eol % columns) == 0)) ?
1101 '\n' : ' '); 1101 '\n' : ' ');
1102 } 1102 }
1103 } 1103 }
1104 1104
1105 s = (eol / columns + 1) * columns; 1105 s = (eol / columns + 1) * columns;
1106 } 1106 }
1107 } 1107 }
1108 1108
1109 QChar* qc = new QChar[d]; 1109 QChar* qc = new QChar[d];
1110 1110
1111 for (int i = 0; i < d; i++) 1111 for (int i = 0; i < d; i++)
1112 { 1112 {
1113 qc[i] = m[i]; 1113 qc[i] = m[i];
1114 } 1114 }
1115 1115
1116 QString res(qc, d); 1116 QString res(qc, d);
1117 1117
1118 delete m; 1118 delete [] m;
1119 delete qc; 1119 delete [] qc;
1120 1120
1121 return res; 1121 return res;
1122} 1122}
1123QString TEScreen::getHistory() { 1123QString TEScreen::getHistory() {
1124 sel_begin = 0; 1124 sel_begin = 0;
1125 sel_BR = sel_begin; 1125 sel_BR = sel_begin;
1126 sel_TL = sel_begin; 1126 sel_TL = sel_begin;
1127 setSelExtentXY(columns-1,lines-1); 1127 setSelExtentXY(columns-1,lines-1);
1128 QString tmp=getSelText(true); 1128 QString tmp=getSelText(true);
1129 while (tmp.at(tmp.length()-2).unicode()==10 && tmp.at(tmp.length()-1).unicode()==10) 1129 while (tmp.at(tmp.length()-2).unicode()==10 && tmp.at(tmp.length()-1).unicode()==10)
1130 tmp.truncate(tmp.length()-1); 1130 tmp.truncate(tmp.length()-1);
1131 1131
1132 return tmp; 1132 return tmp;
1133} 1133}
1134/* above ... end of line processing for selection -- psilva 1134/* above ... end of line processing for selection -- psilva
1135cases: 1135cases:
1136 1136
11371) (eol+1)%columns == 0 --> the whole line is filled. 11371) (eol+1)%columns == 0 --> the whole line is filled.
1138 If the last char is a space, insert (preserve) space. otherwise 1138 If the last char is a space, insert (preserve) space. otherwise
1139 leave the text alone, so that words that are broken by linewrap 1139 leave the text alone, so that words that are broken by linewrap
1140 are preserved. 1140 are preserved.
1141 1141
1142FIXME: 1142FIXME:
1143 * this suppresses \n for command output that is 1143 * this suppresses \n for command output that is
diff --git a/noncore/apps/opie-sheet/Excel.cpp b/noncore/apps/opie-sheet/Excel.cpp
index 338bc30..51fe707 100644
--- a/noncore/apps/opie-sheet/Excel.cpp
+++ b/noncore/apps/opie-sheet/Excel.cpp
@@ -317,49 +317,49 @@ QString ExcelBook::ReadUnicodeChar(int pos, int length)
317 317
318QString* ExcelBook::GetString(int num) 318QString* ExcelBook::GetString(int num)
319{ 319{
320 if(num>=0 && num<(int)SharedStrings.count()) 320 if(num>=0 && num<(int)SharedStrings.count())
321 { 321 {
322 return SharedStrings[num]; 322 return SharedStrings[num];
323 }; 323 };
324 return new QString(""); 324 return new QString("");
325}; 325};
326 326
327int ExcelBook::SeekBOF(void) 327int ExcelBook::SeekBOF(void)
328{ 328{
329 int opcode,version,streamtype,length,ret=0; 329 int opcode,version,streamtype,length,ret=0;
330 char *data; 330 char *data;
331 while(!feof(File)) 331 while(!feof(File))
332 { 332 {
333 opcode=Get2Bytes(); 333 opcode=Get2Bytes();
334 if(opcode==XL_BOF) 334 if(opcode==XL_BOF)
335 { 335 {
336 length=Get2Bytes(); 336 length=Get2Bytes();
337 data=Read(Position,length); 337 data=Read(Position,length);
338 version=Integer2Byte(data[0], data[1]); 338 version=Integer2Byte(data[0], data[1]);
339 streamtype=Integer2Byte(data[2], data[3]); 339 streamtype=Integer2Byte(data[2], data[3]);
340 printf("SEEKBOF:opcode=XLBOF, %d ,version %d\r\n",Position,version); 340 printf("SEEKBOF:opcode=XLBOF, %d ,version %d\r\n",Position,version);
341 delete data; data=NULL; 341 delete [] data; data=NULL;
342 if (version==BIFF8) ret=8; 342 if (version==BIFF8) ret=8;
343 else if(version==BIFF7) ret=7; 343 else if(version==BIFF7) ret=7;
344 printf("SEEKBOF:versionBIFF%d\r\n",ret); 344 printf("SEEKBOF:versionBIFF%d\r\n",ret);
345 if(streamtype==WBKGLOBAL) return ret *2; 345 if(streamtype==WBKGLOBAL) return ret *2;
346 else if(streamtype==WRKSHEET) return ret *1; 346 else if(streamtype==WRKSHEET) return ret *1;
347 return 1; 347 return 1;
348 }; 348 };
349 }; 349 };
350 return 0; 350 return 0;
351}; 351};
352 352
353ExcelBREC* ExcelBook::GetBREC(void) 353ExcelBREC* ExcelBook::GetBREC(void)
354{ 354{
355 ExcelBREC* rec; 355 ExcelBREC* rec;
356 rec= new ExcelBREC; 356 rec= new ExcelBREC;
357 if(FileEOF()) return NULL; 357 if(FileEOF()) return NULL;
358 rec->data=NULL; 358 rec->data=NULL;
359 rec->code=Get2Bytes(); 359 rec->code=Get2Bytes();
360 rec->length=Get2Bytes(); 360 rec->length=Get2Bytes();
361 rec->position=Position; 361 rec->position=Position;
362 SeekSkip(rec->length); 362 SeekSkip(rec->length);
363 return rec; 363 return rec;
364}; 364};
365 365
diff --git a/noncore/apps/tinykate/libkate/document/katedocument.cpp b/noncore/apps/tinykate/libkate/document/katedocument.cpp
index 6dc4fd2..a70f3aa 100644
--- a/noncore/apps/tinykate/libkate/document/katedocument.cpp
+++ b/noncore/apps/tinykate/libkate/document/katedocument.cpp
@@ -2198,49 +2198,49 @@ bool KateDocument::doSearch(SConfig &sc, const QString &searchFor) {
2198 TextLine::Ptr textLine; 2198 TextLine::Ptr textLine;
2199 int pos, newPos; 2199 int pos, newPos;
2200 2200
2201 if (searchFor.isEmpty()) return false; 2201 if (searchFor.isEmpty()) return false;
2202 2202
2203 bufLen = 0; 2203 bufLen = 0;
2204 t = 0L; 2204 t = 0L;
2205 2205
2206 line = sc.cursor.y; 2206 line = sc.cursor.y;
2207 col = sc.cursor.x; 2207 col = sc.cursor.x;
2208 if (!(sc.flags & KateView::sfBackward)) { 2208 if (!(sc.flags & KateView::sfBackward)) {
2209 //forward search 2209 //forward search
2210 if (sc.flags & KateView::sfSelected) { 2210 if (sc.flags & KateView::sfSelected) {
2211 if (line < selectStart) { 2211 if (line < selectStart) {
2212 line = selectStart; 2212 line = selectStart;
2213 col = 0; 2213 col = 0;
2214 } 2214 }
2215 searchEnd = selectEnd; 2215 searchEnd = selectEnd;
2216 } else searchEnd = lastLine(); 2216 } else searchEnd = lastLine();
2217 2217
2218 while (line <= searchEnd) { 2218 while (line <= searchEnd) {
2219 textLine = getTextLine(line); 2219 textLine = getTextLine(line);
2220 tlen = textLine->length(); 2220 tlen = textLine->length();
2221 if (tlen > bufLen) { 2221 if (tlen > bufLen) {
2222 delete t; 2222 delete [] t;
2223 bufLen = (tlen + 255) & (~255); 2223 bufLen = (tlen + 255) & (~255);
2224 t = new QChar[bufLen]; 2224 t = new QChar[bufLen];
2225 } 2225 }
2226 memcpy(t, textLine->getText(), tlen*sizeof(QChar)); 2226 memcpy(t, textLine->getText(), tlen*sizeof(QChar));
2227 if (sc.flags & KateView::sfSelected) { 2227 if (sc.flags & KateView::sfSelected) {
2228 pos = 0; 2228 pos = 0;
2229 do { 2229 do {
2230 pos = textLine->findSelected(pos); 2230 pos = textLine->findSelected(pos);
2231 newPos = textLine->findUnselected(pos); 2231 newPos = textLine->findUnselected(pos);
2232 memset(&t[pos], 0, (newPos - pos)*sizeof(QChar)); 2232 memset(&t[pos], 0, (newPos - pos)*sizeof(QChar));
2233 pos = newPos; 2233 pos = newPos;
2234 } while (pos < tlen); 2234 } while (pos < tlen);
2235 } 2235 }
2236 2236
2237 QString text(t, tlen); 2237 QString text(t, tlen);
2238 if (sc.flags & KateView::sfWholeWords) { 2238 if (sc.flags & KateView::sfWholeWords) {
2239 // Until the end of the line... 2239 // Until the end of the line...
2240 while (col < tlen) { 2240 while (col < tlen) {
2241 // ...find the next match. 2241 // ...find the next match.
2242 col = sc.search(text, col); 2242 col = sc.search(text, col);
2243 if (col != -1) { 2243 if (col != -1) {
2244 // Is the match delimited correctly? 2244 // Is the match delimited correctly?
2245 if (((col == 0) || (!m_highlight->isInWord(t[col]))) && 2245 if (((col == 0) || (!m_highlight->isInWord(t[col]))) &&
2246 ((col + sc.matchedLength == tlen) || (!m_highlight->isInWord(t[col + sc.matchedLength])))) { 2246 ((col + sc.matchedLength == tlen) || (!m_highlight->isInWord(t[col + sc.matchedLength])))) {
@@ -2259,49 +2259,49 @@ bool KateDocument::doSearch(SConfig &sc, const QString &searchFor) {
2259 } 2259 }
2260 else { 2260 else {
2261 // Non-whole-word search. 2261 // Non-whole-word search.
2262 col = sc.search(text, col); 2262 col = sc.search(text, col);
2263 if (col != -1) 2263 if (col != -1)
2264 goto found; 2264 goto found;
2265 } 2265 }
2266 col = 0; 2266 col = 0;
2267 line++; 2267 line++;
2268 } 2268 }
2269 } else { 2269 } else {
2270 // backward search 2270 // backward search
2271 if (sc.flags & KateView::sfSelected) { 2271 if (sc.flags & KateView::sfSelected) {
2272 if (line > selectEnd) { 2272 if (line > selectEnd) {
2273 line = selectEnd; 2273 line = selectEnd;
2274 col = -1; 2274 col = -1;
2275 } 2275 }
2276 searchEnd = selectStart; 2276 searchEnd = selectStart;
2277 } else searchEnd = 0; 2277 } else searchEnd = 0;
2278 2278
2279 while (line >= searchEnd) { 2279 while (line >= searchEnd) {
2280 textLine = getTextLine(line); 2280 textLine = getTextLine(line);
2281 tlen = textLine->length(); 2281 tlen = textLine->length();
2282 if (tlen > bufLen) { 2282 if (tlen > bufLen) {
2283 delete t; 2283 delete [] t;
2284 bufLen = (tlen + 255) & (~255); 2284 bufLen = (tlen + 255) & (~255);
2285 t = new QChar[bufLen]; 2285 t = new QChar[bufLen];
2286 } 2286 }
2287 memcpy(t, textLine->getText(), tlen*sizeof(QChar)); 2287 memcpy(t, textLine->getText(), tlen*sizeof(QChar));
2288 if (sc.flags & KateView::sfSelected) { 2288 if (sc.flags & KateView::sfSelected) {
2289 pos = 0; 2289 pos = 0;
2290 do { 2290 do {
2291 pos = textLine->findSelected(pos); 2291 pos = textLine->findSelected(pos);
2292 newPos = textLine->findUnselected(pos); 2292 newPos = textLine->findUnselected(pos);
2293 memset(&t[pos], 0, (newPos - pos)*sizeof(QChar)); 2293 memset(&t[pos], 0, (newPos - pos)*sizeof(QChar));
2294 pos = newPos; 2294 pos = newPos;
2295 } while (pos < tlen); 2295 } while (pos < tlen);
2296 } 2296 }
2297 2297
2298 if (col < 0 || col > tlen) col = tlen; 2298 if (col < 0 || col > tlen) col = tlen;
2299 2299
2300 QString text(t, tlen); 2300 QString text(t, tlen);
2301 if (sc.flags & KateView::sfWholeWords) { 2301 if (sc.flags & KateView::sfWholeWords) {
2302 // Until the beginning of the line... 2302 // Until the beginning of the line...
2303 while (col >= 0) { 2303 while (col >= 0) {
2304 // ...find the next match. 2304 // ...find the next match.
2305 col = sc.search(text, col); 2305 col = sc.search(text, col);
2306 if (col != -1) { 2306 if (col != -1) {
2307 // Is the match delimited correctly? 2307 // Is the match delimited correctly?
diff --git a/noncore/comm/keypebble/krfbdecoder.cpp b/noncore/comm/keypebble/krfbdecoder.cpp
index 837fcc5..27ae101 100644
--- a/noncore/comm/keypebble/krfbdecoder.cpp
+++ b/noncore/comm/keypebble/krfbdecoder.cpp
@@ -204,49 +204,49 @@ void KRFBDecoder::gotServerInit()
204 currentState = AwaitingDesktopName; 204 currentState = AwaitingDesktopName;
205 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotDesktopName() ) ); 205 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotDesktopName() ) );
206 con->waitForData( info->nameLength ); 206 con->waitForData( info->nameLength );
207} 207}
208 208
209void KRFBDecoder::gotDesktopName() 209void KRFBDecoder::gotDesktopName()
210{ 210{
211 assert( info ); 211 assert( info );
212 assert( currentState == AwaitingDesktopName ); 212 assert( currentState == AwaitingDesktopName );
213 213
214 owarn << "Got desktop name" << oendl; 214 owarn << "Got desktop name" << oendl;
215 215
216 disconnect( con, SIGNAL( gotEnoughData() ), 216 disconnect( con, SIGNAL( gotEnoughData() ),
217 this, SLOT( gotDesktopName() ) ); 217 this, SLOT( gotDesktopName() ) );
218 218
219 char *buf = new char[ info->nameLength + 1 ]; 219 char *buf = new char[ info->nameLength + 1 ];
220 CHECK_PTR( buf ); 220 CHECK_PTR( buf );
221 221
222 con->read( buf, info->nameLength ); 222 con->read( buf, info->nameLength );
223 buf[ info->nameLength ] = '\0'; 223 buf[ info->nameLength ] = '\0';
224 info->name = buf; 224 info->name = buf;
225 225
226 owarn << "Desktop: " << info->name.latin1() << "" << oendl; 226 owarn << "Desktop: " << info->name.latin1() << "" << oendl;
227 227
228 delete buf; 228 delete [] buf;
229 229
230 // Get the format we'll really use and tell the server 230 // Get the format we'll really use and tell the server
231 decidePixelFormat(); 231 decidePixelFormat();
232 sendPixelFormat(); 232 sendPixelFormat();
233 sendAllowedEncodings(); 233 sendAllowedEncodings();
234 currentState = Idle; 234 currentState = Idle;
235 235
236 QString msg; 236 QString msg;
237 msg = tr( "Connected to %1" ); 237 msg = tr( "Connected to %1" );
238 msg = msg.arg( info->name ); 238 msg = msg.arg( info->name );
239 emit status( msg ); 239 emit status( msg );
240 240
241 sendUpdateRequest( false ); 241 sendUpdateRequest( false );
242} 242}
243 243
244void KRFBDecoder::decidePixelFormat() 244void KRFBDecoder::decidePixelFormat()
245{ 245{
246 assert( info ); 246 assert( info );
247 247
248 if ( format ) 248 if ( format )
249 delete format; 249 delete format;
250 format = new KRFBPixelFormat; 250 format = new KRFBPixelFormat;
251 CHECK_PTR( format ); 251 CHECK_PTR( format );
252 252
@@ -514,49 +514,49 @@ void KRFBDecoder::getRawRectChunk( int lines )
514 514
515 currentState = AwaitingRawRectChunk; 515 currentState = AwaitingRawRectChunk;
516 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRawRectChunk() ) ); 516 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRawRectChunk() ) );
517 con->waitForData( count ); 517 con->waitForData( count );
518} 518}
519 519
520void KRFBDecoder::gotRawRectChunk() 520void KRFBDecoder::gotRawRectChunk()
521{ 521{
522 assert( currentState == AwaitingRawRectChunk ); 522 assert( currentState == AwaitingRawRectChunk );
523 523
524 disconnect( con, SIGNAL( gotEnoughData() ), 524 disconnect( con, SIGNAL( gotEnoughData() ),
525 this, SLOT( gotRawRectChunk() ) ); 525 this, SLOT( gotRawRectChunk() ) );
526 526
527 // owarn << "Got raw rect chunk" << oendl; 527 // owarn << "Got raw rect chunk" << oendl;
528 528
529 // 529 //
530 // Read the rect data and copy it to the buffer. 530 // Read the rect data and copy it to the buffer.
531 // 531 //
532 532
533 // TODO: Replace this! 533 // TODO: Replace this!
534 int count = lines * w * format->bpp / 8; 534 int count = lines * w * format->bpp / 8;
535 char *hack = new char[ count ]; 535 char *hack = new char[ count ];
536 con->read( hack, count ); 536 con->read( hack, count );
537 buf->drawRawRectChunk( hack, x, y, w, lines ); 537 buf->drawRawRectChunk( hack, x, y, w, lines );
538 delete hack; 538 delete [] hack;
539 // /TODO: 539 // /TODO:
540 540
541 h = h - lines; 541 h = h - lines;
542 y = y + lines; 542 y = y + lines;
543 543
544 if ( h > 0 ) { 544 if ( h > 0 ) {
545 handleRawRect(); 545 handleRawRect();
546 } 546 }
547 else { 547 else {
548 noRects--; 548 noRects--;
549 549
550 // owarn << "There are " << noRects << " rects left" << oendl; 550 // owarn << "There are " << noRects << " rects left" << oendl;
551 551
552 if ( noRects ) { 552 if ( noRects ) {
553 currentState = AwaitingRectHeader; 553 currentState = AwaitingRectHeader;
554 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRectHeader() ) ); 554 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRectHeader() ) );
555 con->waitForData( RectHeaderLength ); 555 con->waitForData( RectHeaderLength );
556 } 556 }
557 else { 557 else {
558 // we are now ready for the next update - no need to wait for the timer 558 // we are now ready for the next update - no need to wait for the timer
559 currentState = Idle; 559 currentState = Idle;
560 sendUpdateRequest (1); 560 sendUpdateRequest (1);
561 } 561 }
562 } 562 }
@@ -707,49 +707,49 @@ void KRFBDecoder::gotServerCutText()
707 707
708 708
709 // 709 //
710 // Warning: There is a bug in the RFB protocol because there is no way to find 710 // Warning: There is a bug in the RFB protocol because there is no way to find
711 // out the codepage in use on the remote machine. This could be fixed by requiring 711 // out the codepage in use on the remote machine. This could be fixed by requiring
712 // the remote server to use utf8 etc. but for now we have to assume they're the 712 // the remote server to use utf8 etc. but for now we have to assume they're the
713 // same. I've reported this problem to the ORL guys, but they apparantly have no 713 // same. I've reported this problem to the ORL guys, but they apparantly have no
714 // immediate plans to fix the issue. :-( (rich) 714 // immediate plans to fix the issue. :-( (rich)
715 // 715 //
716 716
717 char *cutbuf = new char[ serverCutTextLen + 1 ]; 717 char *cutbuf = new char[ serverCutTextLen + 1 ];
718 CHECK_PTR( cutbuf ); 718 CHECK_PTR( cutbuf );
719 719
720 con->read( cutbuf, serverCutTextLen ); 720 con->read( cutbuf, serverCutTextLen );
721 cutbuf[ serverCutTextLen ] = '\0'; 721 cutbuf[ serverCutTextLen ] = '\0';
722 722
723 /* For some reason QApplication::clipboard()->setText() segfaults when called 723 /* For some reason QApplication::clipboard()->setText() segfaults when called
724 * from within keypebble's mass of signals and slots 724 * from within keypebble's mass of signals and slots
725 owarn << "Server cut: " << cutbuf << "" << oendl; 725 owarn << "Server cut: " << cutbuf << "" << oendl;
726 726
727 QString cutText( cutbuf ); // DANGER!! 727 QString cutText( cutbuf ); // DANGER!!
728 qApp->clipboard()->setText( cutText ); 728 qApp->clipboard()->setText( cutText );
729 */ 729 */
730 730
731 delete cutbuf; 731 delete [] cutbuf;
732 // Now wait for the update (again) 732 // Now wait for the update (again)
733 if ( oldState == AwaitingUpdate ) { 733 if ( oldState == AwaitingUpdate ) {
734 currentState = AwaitingUpdate; 734 currentState = AwaitingUpdate;
735 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotUpdateHeader() ) ); 735 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotUpdateHeader() ) );
736 con->waitForData( UpdateHeaderLength ); 736 con->waitForData( UpdateHeaderLength );
737 } 737 }
738 else if ( oldState == Idle ) { 738 else if ( oldState == Idle ) {
739 currentState = Idle; 739 currentState = Idle;
740 } 740 }
741 else { 741 else {
742 owarn << "Async handled in weird state" << oendl; 742 owarn << "Async handled in weird state" << oendl;
743 currentState = oldState; 743 currentState = oldState;
744 }; 744 };
745} 745}
746 746
747void KRFBDecoder::gotBell() 747void KRFBDecoder::gotBell()
748{ 748{
749 owarn << "Got server bell" << oendl; 749 owarn << "Got server bell" << oendl;
750 buf->soundBell(); 750 buf->soundBell();
751 751
752 // Now wait for the update (again) 752 // Now wait for the update (again)
753 if ( oldState == AwaitingUpdate ) { 753 if ( oldState == AwaitingUpdate ) {
754 currentState = AwaitingUpdate; 754 currentState = AwaitingUpdate;
755 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotUpdateHeader() ) ); 755 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotUpdateHeader() ) );
diff --git a/noncore/games/sfcave/sfcave.cpp b/noncore/games/sfcave/sfcave.cpp
index a6c92a0..516dc93 100644
--- a/noncore/games/sfcave/sfcave.cpp
+++ b/noncore/games/sfcave/sfcave.cpp
@@ -977,49 +977,49 @@ void SFCave :: loadReplay()
977 char *data = new char[length+1]; 977 char *data = new char[length+1];
978 978
979 fread( data, 1, length, in ); 979 fread( data, 1, length, in );
980// printf( "data - %s", data ); 980// printf( "data - %s", data );
981 981
982 QString sep = " "; 982 QString sep = " ";
983 QStringList list = QStringList::split( sep, QString( data ) ); 983 QStringList list = QStringList::split( sep, QString( data ) );
984 984
985 // print it out 985 // print it out
986 QStringList::Iterator it = list.begin(); 986 QStringList::Iterator it = list.begin();
987 currentSeed = (*it).toInt(); 987 currentSeed = (*it).toInt();
988 ++it; 988 ++it;
989 currentGameType = (*it).toInt(); 989 currentGameType = (*it).toInt();
990 ++it; 990 ++it;
991 currentGameDifficulty = (*it).toInt(); 991 currentGameDifficulty = (*it).toInt();
992 ++it; 992 ++it;
993 993
994 replayList.clear(); 994 replayList.clear();
995 for ( ; it != list.end(); ++it ) 995 for ( ; it != list.end(); ++it )
996 { 996 {
997 int v = (*it).toInt(); 997 int v = (*it).toInt();
998 replayList.append( new int( v ) ); 998 replayList.append( new int( v ) );
999 } 999 }
1000 1000
1001 delete data; 1001 delete [] data;
1002 1002
1003 fclose( in ); 1003 fclose( in );
1004 1004
1005 printf( "Replay loaded from %s\n", QFile::encodeName(replayFile).data() ); 1005 printf( "Replay loaded from %s\n", QFile::encodeName(replayFile).data() );
1006} 1006}
1007 1007
1008 1008
1009//--------------- MENU CODE --------------------- 1009//--------------- MENU CODE ---------------------
1010void SFCave :: handleMenuKeys( QKeyEvent *e ) 1010void SFCave :: handleMenuKeys( QKeyEvent *e )
1011{ 1011{
1012 switch( e->key() ) 1012 switch( e->key() )
1013 { 1013 {
1014 case Qt::Key_Down: 1014 case Qt::Key_Down:
1015 currentMenuOption[currentMenuNr] ++; 1015 currentMenuOption[currentMenuNr] ++;
1016 if ( menuOptions[currentMenuNr][currentMenuOption[currentMenuNr]] == "" ) 1016 if ( menuOptions[currentMenuNr][currentMenuOption[currentMenuNr]] == "" )
1017 currentMenuOption[currentMenuNr] = 0; 1017 currentMenuOption[currentMenuNr] = 0;
1018 break; 1018 break;
1019 case Qt::Key_Up: 1019 case Qt::Key_Up:
1020 currentMenuOption[currentMenuNr] --; 1020 currentMenuOption[currentMenuNr] --;
1021 if ( currentMenuOption[currentMenuNr] < 0 ) 1021 if ( currentMenuOption[currentMenuNr] < 0 )
1022 currentMenuOption[currentMenuNr] = nrMenuOptions[currentMenuNr]-1; 1022 currentMenuOption[currentMenuNr] = nrMenuOptions[currentMenuNr]-1;
1023 break; 1023 break;
1024 1024
1025 case Qt::Key_Left: 1025 case Qt::Key_Left:
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp
index 7ffa1d6..0886e69 100644
--- a/noncore/settings/aqpkg/settingsimpl.cpp
+++ b/noncore/settings/aqpkg/settingsimpl.cpp
@@ -326,49 +326,49 @@ void SettingsImpl :: removeServer()
326 { 326 {
327 dataMgr->getServerList().removeRef( s ); 327 dataMgr->getServerList().removeRef( s );
328 servers->removeItem( currentSelectedServer ); 328 servers->removeItem( currentSelectedServer );
329 } 329 }
330} 330}
331 331
332void SettingsImpl :: changeServerDetails() 332void SettingsImpl :: changeServerDetails()
333{ 333{
334 changed = true; 334 changed = true;
335 335
336 QString newName = servername->text(); 336 QString newName = servername->text();
337 337
338 // Convert any spaces to underscores 338 // Convert any spaces to underscores
339 char *tmpStr = new char[newName.length() + 1]; 339 char *tmpStr = new char[newName.length() + 1];
340 for ( unsigned int i = 0 ; i < newName.length() ; ++i ) 340 for ( unsigned int i = 0 ; i < newName.length() ; ++i )
341 { 341 {
342 if ( newName[i] == ' ' ) 342 if ( newName[i] == ' ' )
343 tmpStr[i] = '_'; 343 tmpStr[i] = '_';
344 else 344 else
345 tmpStr[i] = newName[i].latin1(); 345 tmpStr[i] = newName[i].latin1();
346 } 346 }
347 tmpStr[newName.length()] = '\0'; 347 tmpStr[newName.length()] = '\0';
348 348
349 newName = tmpStr; 349 newName = tmpStr;
350 delete tmpStr; 350 delete [] tmpStr;
351 351
352 if ( !newserver ) 352 if ( !newserver )
353 { 353 {
354 Server *s = dataMgr->getServer( servers->currentText() ); 354 Server *s = dataMgr->getServer( servers->currentText() );
355 if ( s ) 355 if ( s )
356 { 356 {
357 // Update url 357 // Update url
358 s->setServerUrl( serverurl->text() ); 358 s->setServerUrl( serverurl->text() );
359 s->setActive( active->isChecked() ); 359 s->setActive( active->isChecked() );
360 360
361 // Check if server name has changed, if it has then we need to replace the key in the map 361 // Check if server name has changed, if it has then we need to replace the key in the map
362 if ( serverName != newName ) 362 if ( serverName != newName )
363 { 363 {
364 // Update server name 364 // Update server name
365 s->setServerName( newName ); 365 s->setServerName( newName );
366 } 366 }
367 367
368 // Update list box 368 // Update list box
369 servers->changeItem( newName, currentSelectedServer ); 369 servers->changeItem( newName, currentSelectedServer );
370 } 370 }
371 } 371 }
372 else 372 else
373 { 373 {
374 Server s( newName, serverurl->text() ); 374 Server s( newName, serverurl->text() );
diff --git a/noncore/settings/aqpkg/version.cpp b/noncore/settings/aqpkg/version.cpp
index 59e6f3f..ce2de7b 100644
--- a/noncore/settings/aqpkg/version.cpp
+++ b/noncore/settings/aqpkg/version.cpp
@@ -17,49 +17,49 @@
17 * You should have received a copy of the GNU General Public 17 * You should have received a copy of the GNU General Public
18 * License along with dpkg; if not, write to the Free Software 18 * License along with dpkg; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 20 */
21#include <stdio.h> 21#include <stdio.h>
22#include <stdlib.h> 22#include <stdlib.h>
23#include <ctype.h> 23#include <ctype.h>
24#include <string.h> 24#include <string.h>
25 25
26#include <qobject.h> 26#include <qobject.h>
27 27
28//# define _(Text) Text 28//# define _(Text) Text
29 29
30class versionrevision 30class versionrevision
31{ 31{
32public: 32public:
33 versionrevision() 33 versionrevision()
34 { 34 {
35 version = 0; 35 version = 0;
36 } 36 }
37 37
38 ~versionrevision() 38 ~versionrevision()
39 { 39 {
40 if ( version ) 40 if ( version )
41 delete version; 41 delete [] version;
42 } 42 }
43 43
44 void setVersion( const char *str ) 44 void setVersion( const char *str )
45 { 45 {
46 version = new char[(strlen(str)+1)]; 46 version = new char[(strlen(str)+1)];
47 strcpy( version, str ); 47 strcpy( version, str );
48 } 48 }
49 49
50 unsigned long epoch; 50 unsigned long epoch;
51 char *version; 51 char *version;
52 const char *revision; 52 const char *revision;
53 const char *familiar_revision; 53 const char *familiar_revision;
54}; 54};
55 55
56static int verrevcmp(const char *val, const char *ref) 56static int verrevcmp(const char *val, const char *ref)
57{ 57{
58 int vc, rc; 58 int vc, rc;
59 long vl, rl; 59 long vl, rl;
60 const char *vp, *rp; 60 const char *vp, *rp;
61 61
62 if (!val) val= ""; 62 if (!val) val= "";
63 if (!ref) ref= ""; 63 if (!ref) ref= "";
64 for (;;) { 64 for (;;) {
65 vp= val; while (*vp && !isdigit(*vp)) vp++; 65 vp= val; while (*vp && !isdigit(*vp)) vp++;