summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-write/qrichtext.cpp41
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTSDPAttribute.cpp3
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp6
3 files changed, 39 insertions, 11 deletions
diff --git a/noncore/apps/opie-write/qrichtext.cpp b/noncore/apps/opie-write/qrichtext.cpp
index f040f1e..768da44 100644
--- a/noncore/apps/opie-write/qrichtext.cpp
+++ b/noncore/apps/opie-write/qrichtext.cpp
@@ -168,92 +168,101 @@ QTextDeleteCommand::QTextDeleteCommand( QTextDocument *d, int i, int idx, const
168 } 168 }
169} 169}
170 170
171QTextDeleteCommand::QTextDeleteCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str ) 171QTextDeleteCommand::QTextDeleteCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str )
172 : QTextCommand( 0 ), id( -1 ), index( idx ), parag( p ), text( str ) 172 : QTextCommand( 0 ), id( -1 ), index( idx ), parag( p ), text( str )
173{ 173{
174 for ( int i = 0; i < (int)text.size(); ++i ) { 174 for ( int i = 0; i < (int)text.size(); ++i ) {
175 if ( text[ i ].format() ) 175 if ( text[ i ].format() )
176 text[ i ].format()->addRef(); 176 text[ i ].format()->addRef();
177 } 177 }
178} 178}
179 179
180QTextDeleteCommand::~QTextDeleteCommand() 180QTextDeleteCommand::~QTextDeleteCommand()
181{ 181{
182 for ( int i = 0; i < (int)text.size(); ++i ) { 182 for ( int i = 0; i < (int)text.size(); ++i ) {
183 if ( text[ i ].format() ) 183 if ( text[ i ].format() )
184 text[ i ].format()->removeRef(); 184 text[ i ].format()->removeRef();
185 } 185 }
186 text.resize( 0 ); 186 text.resize( 0 );
187} 187}
188 188
189QTextCursor *QTextDeleteCommand::execute( QTextCursor *c ) 189QTextCursor *QTextDeleteCommand::execute( QTextCursor *c )
190{ 190{
191 QTextParagraph *s = doc ? doc->paragAt( id ) : parag; 191 QTextParagraph *s = doc ? doc->paragAt( id ) : parag;
192 if ( !s ) { 192 if ( !s && doc ) {
193 owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; 193 owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl;
194 return 0; 194 return 0;
195 } else if ( !doc ) {
196 owarn << "No valid doc" << oendl;
197 return 0;
195 } 198 }
196 199
197 cursor.setParagraph( s ); 200 cursor.setParagraph( s );
198 cursor.setIndex( index ); 201 cursor.setIndex( index );
199 int len = text.size(); 202 int len = text.size();
200 if ( c ) 203 if ( c )
201 *c = cursor; 204 *c = cursor;
202 if ( doc ) { 205 if ( doc ) {
203 doc->setSelectionStart( QTextDocument::Temp, cursor ); 206 doc->setSelectionStart( QTextDocument::Temp, cursor );
204 for ( int i = 0; i < len; ++i ) 207 for ( int i = 0; i < len; ++i )
205 cursor.gotoNextLetter(); 208 cursor.gotoNextLetter();
206 doc->setSelectionEnd( QTextDocument::Temp, cursor ); 209 doc->setSelectionEnd( QTextDocument::Temp, cursor );
207 doc->removeSelectedText( QTextDocument::Temp, &cursor ); 210 doc->removeSelectedText( QTextDocument::Temp, &cursor );
208 if ( c ) 211 if ( c )
209 *c = cursor; 212 *c = cursor;
210 } else { 213 } else {
211 s->remove( index, len ); 214 s->remove( index, len );
212 } 215 }
213 216
214 return c; 217 return c;
215} 218}
216 219
217QTextCursor *QTextDeleteCommand::unexecute( QTextCursor *c ) 220QTextCursor *QTextDeleteCommand::unexecute( QTextCursor *c )
218{ 221{
219 QTextParagraph *s = doc ? doc->paragAt( id ) : parag; 222 QTextParagraph *s = doc ? doc->paragAt( id ) : parag;
220 if ( !s ) { 223 if ( !s && doc ) {
221 owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; 224 owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl;
222 return 0; 225 return 0;
226 } else if ( !doc ) {
227 owarn << "No valid doc" << oendl;
228 return 0;
223 } 229 }
224 230
225 cursor.setParagraph( s ); 231 cursor.setParagraph( s );
226 cursor.setIndex( index ); 232 cursor.setIndex( index );
227 QString str = QTextString::toString( text ); 233 QString str = QTextString::toString( text );
228 cursor.insert( str, TRUE, &text ); 234 cursor.insert( str, TRUE, &text );
229 cursor.setParagraph( s ); 235 cursor.setParagraph( s );
230 cursor.setIndex( index ); 236 cursor.setIndex( index );
231 if ( c ) { 237 if ( c ) {
232 c->setParagraph( s ); 238 c->setParagraph( s );
233 c->setIndex( index ); 239 c->setIndex( index );
234 for ( int i = 0; i < (int)text.size(); ++i ) 240 for ( int i = 0; i < (int)text.size(); ++i )
235 c->gotoNextLetter(); 241 c->gotoNextLetter();
242 } else {
243 owarn << "No valid cursor" << oendl;
244 return 0;
236 } 245 }
237 246
238 if ( !styleInformation.isEmpty() ) { 247 if ( !styleInformation.isEmpty() ) {
239 QDataStream styleStream( styleInformation, IO_ReadOnly ); 248 QDataStream styleStream( styleInformation, IO_ReadOnly );
240 int num; 249 int num;
241 styleStream >> num; 250 styleStream >> num;
242 QTextParagraph *p = s; 251 QTextParagraph *p = s;
243 while ( num-- && p ) { 252 while ( num-- && p ) {
244 p->readStyleInformation( styleStream ); 253 p->readStyleInformation( styleStream );
245 p = p->next(); 254 p = p->next();
246 } 255 }
247 } 256 }
248 s = cursor.paragraph(); 257 s = cursor.paragraph();
249 while ( s ) { 258 while ( s ) {
250 s->format(); 259 s->format();
251 s->setChanged( TRUE ); 260 s->setChanged( TRUE );
252 if ( s == c->paragraph() ) 261 if ( s == c->paragraph() )
253 break; 262 break;
254 s = s->next(); 263 s = s->next();
255 } 264 }
256 265
257 return &cursor; 266 return &cursor;
258} 267}
259 268
@@ -1371,67 +1380,78 @@ struct Q_EXPORT QTextDocumentTag {
1371 wsm = t.wsm; 1380 wsm = t.wsm;
1372 format = t.format; 1381 format = t.format;
1373 alignment = t.alignment; 1382 alignment = t.alignment;
1374 direction = t.direction; 1383 direction = t.direction;
1375 liststyle = t.liststyle; 1384 liststyle = t.liststyle;
1376 } 1385 }
1377 QTextDocumentTag& operator=(const QTextDocumentTag& t) { 1386 QTextDocumentTag& operator=(const QTextDocumentTag& t) {
1378 name = t.name; 1387 name = t.name;
1379 style = t.style; 1388 style = t.style;
1380 anchorHref = t.anchorHref; 1389 anchorHref = t.anchorHref;
1381 wsm = t.wsm; 1390 wsm = t.wsm;
1382 format = t.format; 1391 format = t.format;
1383 alignment = t.alignment; 1392 alignment = t.alignment;
1384 direction = t.direction; 1393 direction = t.direction;
1385 liststyle = t.liststyle; 1394 liststyle = t.liststyle;
1386 return *this; 1395 return *this;
1387 } 1396 }
1388 1397
1389#if defined(Q_FULL_TEMPLATE_INSTANTIATION) 1398#if defined(Q_FULL_TEMPLATE_INSTANTIATION)
1390 bool operator==( const QTextDocumentTag& ) const { return FALSE; } 1399 bool operator==( const QTextDocumentTag& ) const { return FALSE; }
1391#endif 1400#endif
1392}; 1401};
1393 1402
1394 1403
1395#define NEWPAR do{ if ( !hasNewPar) { \ 1404#define NEWPAR do { \
1405 if ( !hasNewPar) { \
1406 if ( !curpar ) { \
1407 owarn << "no current paragraph" << oendl; \
1408 return; \
1409 } \
1396 if ( !textEditMode && curpar && curpar->length()>1 && curpar->at( curpar->length()-2)->c == QChar_linesep ) \ 1410 if ( !textEditMode && curpar && curpar->length()>1 && curpar->at( curpar->length()-2)->c == QChar_linesep ) \
1397 curpar->remove( curpar->length()-2, 1 ); \ 1411 curpar->remove( curpar->length()-2, 1 ); \
1398 curpar = createParagraph( this, curpar, curpar->next() ); styles.append( vec ); vec = 0;} \ 1412 curpar = createParagraph( this, curpar, curpar->next() ); styles.append( vec ); \
1413 if ( !curpar ) { \
1414 owarn << "failed in creating a new paragraph" << oendl; \
1415 return; \
1416 } \
1417 vec = 0; \
1418 } \
1399 hasNewPar = TRUE; \ 1419 hasNewPar = TRUE; \
1400 curpar->rtext = TRUE; \ 1420 curpar->rtext = TRUE; \
1401 curpar->align = curtag.alignment; \ 1421 curpar->align = curtag.alignment; \
1402 curpar->lstyle = curtag.liststyle; \ 1422 curpar->lstyle = curtag.liststyle; \
1403 curpar->litem = ( curtag.style->displayMode() == QStyleSheetItem::DisplayListItem ); \ 1423 curpar->litem = ( curtag.style->displayMode() == QStyleSheetItem::DisplayListItem ); \
1404 curpar->str->setDirection( (QChar::Direction)curtag.direction ); \ 1424 curpar->str->setDirection( (QChar::Direction)curtag.direction ); \
1405 space = TRUE; \ 1425 space = TRUE; \
1406 delete vec; vec = new QPtrVector<QStyleSheetItem>( (uint)tags.count() + 1); \ 1426 delete vec; \
1427 vec = new QPtrVector<QStyleSheetItem>( (uint)tags.count() + 1); \
1407 int i = 0; \ 1428 int i = 0; \
1408 for ( QValueStack<QTextDocumentTag>::Iterator it = tags.begin(); it != tags.end(); ++it ) \ 1429 for ( QValueStack<QTextDocumentTag>::Iterator it = tags.begin(); it != tags.end(); ++it ) \
1409 vec->insert( i++, (*it).style ); \ 1430 vec->insert( i++, (*it).style ); \
1410 vec->insert( i, curtag.style ); \ 1431 vec->insert( i, curtag.style ); \
1411 }while(FALSE) 1432 }while(FALSE)
1412 1433
1413
1414void QTextDocument::setRichText( const QString &text, const QString &context ) 1434void QTextDocument::setRichText( const QString &text, const QString &context )
1415{ 1435{
1416 if ( !context.isEmpty() ) 1436 if ( !context.isEmpty() )
1417 setContext( context ); 1437 setContext( context );
1418 clear(); 1438 clear();
1419 fParag = lParag = createParagraph( this ); 1439 fParag = lParag = createParagraph( this );
1420 oTextValid = TRUE; 1440 oTextValid = TRUE;
1421 oText = text; 1441 oText = text;
1422 setRichTextInternal( text ); 1442 setRichTextInternal( text );
1423 fParag->rtext = TRUE; 1443 fParag->rtext = TRUE;
1424} 1444}
1425 1445
1426void QTextDocument::setRichTextInternal( const QString &text, QTextCursor* cursor ) 1446void QTextDocument::setRichTextInternal( const QString &text, QTextCursor* cursor )
1427{ 1447{
1428 QTextParagraph* curpar = lParag; 1448 QTextParagraph* curpar = lParag;
1429 int pos = 0; 1449 int pos = 0;
1430 QValueStack<QTextDocumentTag> tags; 1450 QValueStack<QTextDocumentTag> tags;
1431 QTextDocumentTag initag( "", sheet_->item(""), *formatCollection()->defaultFormat() ); 1451 QTextDocumentTag initag( "", sheet_->item(""), *formatCollection()->defaultFormat() );
1432 QTextDocumentTag curtag = initag; 1452 QTextDocumentTag curtag = initag;
1433 bool space = TRUE; 1453 bool space = TRUE;
1434 bool canMergeLi = FALSE; 1454 bool canMergeLi = FALSE;
1435 1455
1436 bool textEditMode = FALSE; 1456 bool textEditMode = FALSE;
1437 1457
@@ -1874,50 +1894,53 @@ void QTextDocument::setRichTextInternal( const QString &text, QTextCursor* curso
1874 1894
1875 if ( cursor ) { 1895 if ( cursor ) {
1876 cursor->gotoPreviousLetter(); 1896 cursor->gotoPreviousLetter();
1877 cursor->remove(); 1897 cursor->remove();
1878 } 1898 }
1879 1899
1880} 1900}
1881 1901
1882void QTextDocument::setRichTextMarginsInternal( QPtrList< QPtrVector<QStyleSheetItem> >& styles, QTextParagraph* stylesPar ) 1902void QTextDocument::setRichTextMarginsInternal( QPtrList< QPtrVector<QStyleSheetItem> >& styles, QTextParagraph* stylesPar )
1883{ 1903{
1884 // margin and line spacing calculation 1904 // margin and line spacing calculation
1885 QPtrVector<QStyleSheetItem>* prevStyle = 0; 1905 QPtrVector<QStyleSheetItem>* prevStyle = 0;
1886 QPtrVector<QStyleSheetItem>* curStyle = styles.first(); 1906 QPtrVector<QStyleSheetItem>* curStyle = styles.first();
1887 QPtrVector<QStyleSheetItem>* nextStyle = styles.next(); 1907 QPtrVector<QStyleSheetItem>* nextStyle = styles.next();
1888 while ( stylesPar ) { 1908 while ( stylesPar ) {
1889 if ( !curStyle ) { 1909 if ( !curStyle ) {
1890 stylesPar = stylesPar->next(); 1910 stylesPar = stylesPar->next();
1891 prevStyle = curStyle; 1911 prevStyle = curStyle;
1892 curStyle = nextStyle; 1912 curStyle = nextStyle;
1893 nextStyle = styles.next(); 1913 nextStyle = styles.next();
1894 continue; 1914 continue;
1895 } 1915 }
1896 1916
1897 int i, mar; 1917 int i, mar;
1898 QStyleSheetItem* mainStyle = curStyle->size() ? (*curStyle)[curStyle->size()-1] : 0; 1918 QStyleSheetItem* mainStyle = (*curStyle)[curStyle->size()-1];
1899 if ( mainStyle && mainStyle->displayMode() == QStyleSheetItem::DisplayListItem ) 1919 if ( !mainStyle )
1920 return;
1921
1922 if ( mainStyle->displayMode() == QStyleSheetItem::DisplayListItem )
1900 stylesPar->setListItem( TRUE ); 1923 stylesPar->setListItem( TRUE );
1901 int numLists = 0; 1924 int numLists = 0;
1902 for ( i = 0; i < (int)curStyle->size(); ++i ) { 1925 for ( i = 0; i < (int)curStyle->size(); ++i ) {
1903 if ( (*curStyle)[ i ]->displayMode() == QStyleSheetItem::DisplayBlock 1926 if ( (*curStyle)[ i ]->displayMode() == QStyleSheetItem::DisplayBlock
1904 && int((*curStyle)[ i ]->listStyle()) != QStyleSheetItem::Undefined ) 1927 && int((*curStyle)[ i ]->listStyle()) != QStyleSheetItem::Undefined )
1905 numLists++; 1928 numLists++;
1906 } 1929 }
1907 stylesPar->ldepth = numLists; 1930 stylesPar->ldepth = numLists;
1908 if ( stylesPar->next() && nextStyle ) { 1931 if ( stylesPar->next() && nextStyle ) {
1909 // also set the depth of the next paragraph, required for the margin calculation 1932 // also set the depth of the next paragraph, required for the margin calculation
1910 numLists = 0; 1933 numLists = 0;
1911 for ( i = 0; i < (int)nextStyle->size(); ++i ) { 1934 for ( i = 0; i < (int)nextStyle->size(); ++i ) {
1912 if ( (*nextStyle)[ i ]->displayMode() == QStyleSheetItem::DisplayBlock 1935 if ( (*nextStyle)[ i ]->displayMode() == QStyleSheetItem::DisplayBlock
1913 && int((*nextStyle)[ i ]->listStyle()) != QStyleSheetItem::Undefined ) 1936 && int((*nextStyle)[ i ]->listStyle()) != QStyleSheetItem::Undefined )
1914 numLists++; 1937 numLists++;
1915 } 1938 }
1916 stylesPar->next()->ldepth = numLists; 1939 stylesPar->next()->ldepth = numLists;
1917 } 1940 }
1918 1941
1919 // do the top margin 1942 // do the top margin
1920 QStyleSheetItem* item = mainStyle; 1943 QStyleSheetItem* item = mainStyle;
1921 int m; 1944 int m;
1922 if (stylesPar->utm > 0 ) { 1945 if (stylesPar->utm > 0 ) {
1923 m = stylesPar->utm-1; 1946 m = stylesPar->utm-1;
@@ -5320,49 +5343,49 @@ int QTextFormatterBreakWords::format( QTextDocument *doc, QTextParagraph *parag,
5320 if ( start == 0 ) 5343 if ( start == 0 )
5321 c = &parag->string()->at( 0 ); 5344 c = &parag->string()->at( 0 );
5322 5345
5323 int i = start; 5346 int i = start;
5324 QTextLineStart *lineStart = new QTextLineStart( y, y, 0 ); 5347 QTextLineStart *lineStart = new QTextLineStart( y, y, 0 );
5325 insertLineStart( parag, 0, lineStart ); 5348 insertLineStart( parag, 0, lineStart );
5326 int lastBreak = -1; 5349 int lastBreak = -1;
5327 int tmpBaseLine = 0, tmph = 0; 5350 int tmpBaseLine = 0, tmph = 0;
5328 bool lastWasNonInlineCustom = FALSE; 5351 bool lastWasNonInlineCustom = FALSE;
5329 5352
5330 int align = parag->alignment(); 5353 int align = parag->alignment();
5331 if ( align == Qt3::AlignAuto && doc && doc->alignment() != Qt3::AlignAuto ) 5354 if ( align == Qt3::AlignAuto && doc && doc->alignment() != Qt3::AlignAuto )
5332 align = doc->alignment(); 5355 align = doc->alignment();
5333 5356
5334 align &= Qt3::AlignHorizontal_Mask; 5357 align &= Qt3::AlignHorizontal_Mask;
5335 5358
5336 QPainter *painter = QTextFormat::painter(); 5359 QPainter *painter = QTextFormat::painter();
5337 int col = 0; 5360 int col = 0;
5338 int ww = 0; 5361 int ww = 0;
5339 QChar lastChr; 5362 QChar lastChr;
5340 for ( ; i < len; ++i, ++col ) { 5363 for ( ; i < len; ++i, ++col ) {
5341 if ( c ) 5364 if ( c )
5342 lastChr = c->c; 5365 lastChr = c->c;
5343 // ### next line should not be needed 5366 // ### next line should not be needed
5344 if ( painter ) 5367 if ( c && painter )
5345 c->format()->setPainter( painter ); 5368 c->format()->setPainter( painter );
5346 c = &string->at( i ); 5369 c = &string->at( i );
5347 c->rightToLeft = FALSE; 5370 c->rightToLeft = FALSE;
5348 if ( i > 0 && (x > curLeft || ww == 0) || lastWasNonInlineCustom ) { 5371 if ( i > 0 && (x > curLeft || ww == 0) || lastWasNonInlineCustom ) {
5349 c->lineStart = 0; 5372 c->lineStart = 0;
5350 } else { 5373 } else {
5351 c->lineStart = 1; 5374 c->lineStart = 1;
5352 firstChar = c; 5375 firstChar = c;
5353 } 5376 }
5354 5377
5355 if ( c->isCustom() && c->customItem()->placement() != QTextCustomItem::PlaceInline ) 5378 if ( c->isCustom() && c->customItem()->placement() != QTextCustomItem::PlaceInline )
5356 lastWasNonInlineCustom = TRUE; 5379 lastWasNonInlineCustom = TRUE;
5357 else 5380 else
5358 lastWasNonInlineCustom = FALSE; 5381 lastWasNonInlineCustom = FALSE;
5359 5382
5360 if ( c->c.unicode() >= 32 || c->isCustom() ) { 5383 if ( c->c.unicode() >= 32 || c->isCustom() ) {
5361 ww = string->width( i ); 5384 ww = string->width( i );
5362 } else if ( c->c == '\t' ) { 5385 } else if ( c->c == '\t' ) {
5363 int nx = parag->nextTab( i, x - left ) + left; 5386 int nx = parag->nextTab( i, x - left ) + left;
5364 if ( nx < x ) 5387 if ( nx < x )
5365 ww = w - x; 5388 ww = w - x;
5366 else 5389 else
5367 ww = nx - x; 5390 ww = nx - x;
5368 } else { 5391 } else {
diff --git a/noncore/settings/networksettings2/opietooth2/OTSDPAttribute.cpp b/noncore/settings/networksettings2/opietooth2/OTSDPAttribute.cpp
index 9069c09..3fd877f 100644
--- a/noncore/settings/networksettings2/opietooth2/OTSDPAttribute.cpp
+++ b/noncore/settings/networksettings2/opietooth2/OTSDPAttribute.cpp
@@ -274,48 +274,51 @@ AttributeVector * OTSDPAttribute::getSequence() {
274 return Value.sequenceVal; 274 return Value.sequenceVal;
275} 275}
276 276
277AttributeVector * OTSDPAttribute::getAlternative() { 277AttributeVector * OTSDPAttribute::getAlternative() {
278 assert(type == ALTERNATIVE); 278 assert(type == ALTERNATIVE);
279 return Value.sequenceVal; 279 return Value.sequenceVal;
280} 280}
281 281
282UUIDVector OTSDPAttribute::getAllUUIDs() { 282UUIDVector OTSDPAttribute::getAllUUIDs() {
283 283
284 UUIDVector uuids; 284 UUIDVector uuids;
285 285
286 if (getType() == UUID) { 286 if (getType() == UUID) {
287 uuids.resize( uuids.size()+1 ); 287 uuids.resize( uuids.size()+1 );
288 uuids[uuids.size()-1] = getUUID(); 288 uuids[uuids.size()-1] = getUUID();
289 } else { 289 } else {
290 AttributeVector * subAttributes = 0 ; 290 AttributeVector * subAttributes = 0 ;
291 291
292 if (getType() == SEQUENCE) { 292 if (getType() == SEQUENCE) {
293 subAttributes = getSequence(); 293 subAttributes = getSequence();
294 } else if (getType() == ALTERNATIVE) { 294 } else if (getType() == ALTERNATIVE) {
295 subAttributes = getAlternative(); 295 subAttributes = getAlternative();
296 } 296 }
297 297
298 if (!subAttributes)
299 return 0;
300
298 int os; 301 int os;
299 for( unsigned int i = 0; i < subAttributes->count(); i++ ) { 302 for( unsigned int i = 0; i < subAttributes->count(); i++ ) {
300 UUIDVector subUUIDs = (*subAttributes)[i]->getAllUUIDs(); 303 UUIDVector subUUIDs = (*subAttributes)[i]->getAllUUIDs();
301 304
302 os = uuids.size(); 305 os = uuids.size();
303 uuids.resize( uuids.size()+subUUIDs.count() ); 306 uuids.resize( uuids.size()+subUUIDs.count() );
304 307
305 for( unsigned int k = 0; k < subUUIDs.count(); k++ ) { 308 for( unsigned int k = 0; k < subUUIDs.count(); k++ ) {
306 uuids[os + k] = subUUIDs[k]; 309 uuids[os + k] = subUUIDs[k];
307 } 310 }
308 } 311 }
309 } 312 }
310 return uuids; 313 return uuids;
311} 314}
312 315
313static char * Attr2String[] = { 316static char * Attr2String[] = {
314 "Invalid", 317 "Invalid",
315 "Nil", 318 "Nil",
316 "UInt", 319 "UInt",
317 "int", 320 "int",
318 "UUID", 321 "UUID",
319 "Boolean", 322 "Boolean",
320 "String", 323 "String",
321 "Sequence", 324 "Sequence",
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index d014378..78a18f7 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -415,63 +415,65 @@ void OIpkgConfigDlg::initData()
415 m_proxyUsername->setText( config->value() ); 415 m_proxyUsername->setText( config->value() );
416 } 416 }
417 else if ( config->name() == "proxy_password" ) 417 else if ( config->name() == "proxy_password" )
418 { 418 {
419 m_proxyPassword->setText( config->value() ); 419 m_proxyPassword->setText( config->value() );
420 } 420 }
421 } 421 }
422 break; 422 break;
423 case OConfItem::Other : 423 case OConfItem::Other :
424 { 424 {
425 if ( config->name() == "lists_dir" ) 425 if ( config->name() == "lists_dir" )
426 m_optSourceLists->setText( config->value() ); 426 m_optSourceLists->setText( config->value() );
427 else // TODO - use proper libipkg define 427 else // TODO - use proper libipkg define
428 m_optSourceLists->setText( "/usr/lib/ipkg/lists" ); 428 m_optSourceLists->setText( "/usr/lib/ipkg/lists" );
429 } 429 }
430 break; 430 break;
431 default : break; 431 default : break;
432 }; 432 };
433 } 433 }
434 } 434 }
435 } 435 }
436 } 436 }
437 437
438 // Get Ipkg execution options 438 // Get Ipkg execution options
439 int options = m_ipkg->ipkgExecOptions(); 439 int options = 0;
440 if ( m_ipkg )
441 options = m_ipkg->ipkgExecOptions();
440 if ( options & FORCE_DEPENDS ) 442 if ( options & FORCE_DEPENDS )
441 m_optForceDepends->setChecked( true ); 443 m_optForceDepends->setChecked( true );
442 if ( options & FORCE_REINSTALL ) 444 if ( options & FORCE_REINSTALL )
443 m_optForceReinstall->setChecked( true ); 445 m_optForceReinstall->setChecked( true );
444 if ( options & FORCE_REMOVE ) 446 if ( options & FORCE_REMOVE )
445 m_optForceRemove->setChecked( true ); 447 m_optForceRemove->setChecked( true );
446 if ( options & FORCE_OVERWRITE ) 448 if ( options & FORCE_OVERWRITE )
447 m_optForceOverwrite->setChecked( true ); 449 m_optForceOverwrite->setChecked( true );
448 if ( options & FORCE_RECURSIVE ) 450 if ( options & FORCE_RECURSIVE )
449 m_optForceRecursive->setChecked( true ); 451 m_optForceRecursive->setChecked( true );
450 if ( options & FORCE_VERBOSE_WGET ) 452 if ( options & FORCE_VERBOSE_WGET )
451 m_optVerboseWget->setChecked( true ); 453 m_optVerboseWget->setChecked( true );
452 454
453 m_optVerboseIpkg->setCurrentItem( m_ipkg->ipkgExecVerbosity() ); 455 m_optVerboseIpkg->setCurrentItem( ( m_ipkg ? m_ipkg->ipkgExecVerbosity() : 0 ) );
454} 456}
455 457
456void OIpkgConfigDlg::slotServerSelected( int index ) 458void OIpkgConfigDlg::slotServerSelected( int index )
457{ 459{
458 m_serverCurrent = index; 460 m_serverCurrent = index;
459 461
460 // Enable Edit and Delete buttons 462 // Enable Edit and Delete buttons
461 m_serverEditBtn->setEnabled( true ); 463 m_serverEditBtn->setEnabled( true );
462 m_serverDeleteBtn->setEnabled( true ); 464 m_serverDeleteBtn->setEnabled( true );
463} 465}
464 466
465void OIpkgConfigDlg::slotServerNew() 467void OIpkgConfigDlg::slotServerNew()
466{ 468{
467 OConfItem *server = new OConfItem( OConfItem::Source ); 469 OConfItem *server = new OConfItem( OConfItem::Source );
468 470
469 OIpkgServerDlg dlg( server, this ); 471 OIpkgServerDlg dlg( server, this );
470 if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) 472 if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted )
471 { 473 {
472 // Add to configuration option list 474 // Add to configuration option list
473 m_configs->append( server ); 475 m_configs->append( server );
474 m_configs->sort(); 476 m_configs->sort();
475 477
476 // Add to server list 478 // Add to server list
477 m_serverList->insertItem( server->name() ); 479 m_serverList->insertItem( server->name() );