summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-07 22:37:40 (UTC)
committer zautrix <zautrix>2004-10-07 22:37:40 (UTC)
commit21ec296f7f2832920dac336bb9f9476c80d746f5 (patch) (unidiff)
tree69b2897665d70ad45da249b1cf374a01d3be6dc4
parent4a01915314201cbe2461ce68cdf9c556c687d727 (diff)
downloadkdepimpi-21ec296f7f2832920dac336bb9f9476c80d746f5.zip
kdepimpi-21ec296f7f2832920dac336bb9f9476c80d746f5.tar.gz
kdepimpi-21ec296f7f2832920dac336bb9f9476c80d746f5.tar.bz2
ab view fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressbook.cpp1
-rw-r--r--kaddressbook/views/kaddressbookcardview.cpp2
-rw-r--r--kaddressbook/views/kaddressbookiconview.cpp7
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp2
-rw-r--r--korganizer/mainwindow.cpp3
5 files changed, 12 insertions, 3 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index ed5e9c2..dc3cda1 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -386,32 +386,33 @@ void AddressBook::export2File( QString fileName )
386 } 386 }
387 QTextStream t( &outFile ); 387 QTextStream t( &outFile );
388 t.setEncoding( QTextStream::UnicodeUTF8 ); 388 t.setEncoding( QTextStream::UnicodeUTF8 );
389 Iterator it; 389 Iterator it;
390 KABC::VCardConverter::Version version; 390 KABC::VCardConverter::Version version;
391 version = KABC::VCardConverter::v3_0; 391 version = KABC::VCardConverter::v3_0;
392 for ( it = begin(); it != end(); ++it ) { 392 for ( it = begin(); it != end(); ++it ) {
393 if ( !(*it).IDStr().isEmpty() ) { 393 if ( !(*it).IDStr().isEmpty() ) {
394 (*it).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*it).IDStr() ); 394 (*it).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*it).IDStr() );
395 } 395 }
396 KABC::VCardConverter converter; 396 KABC::VCardConverter converter;
397 QString vcard; 397 QString vcard;
398 //Resource *resource() const; 398 //Resource *resource() const;
399 converter.addresseeToVCard( *it, vcard, version ); 399 converter.addresseeToVCard( *it, vcard, version );
400 t << vcard << "\r\n"; 400 t << vcard << "\r\n";
401 } 401 }
402 t << "\r\n\r\n";
402 outFile.close(); 403 outFile.close();
403} 404}
404void AddressBook::importFromFile( QString fileName ) 405void AddressBook::importFromFile( QString fileName )
405{ 406{
406 407
407 KABC::Addressee::List list; 408 KABC::Addressee::List list;
408 QFile file( fileName ); 409 QFile file( fileName );
409 410
410 file.open( IO_ReadOnly ); 411 file.open( IO_ReadOnly );
411 QByteArray rawData = file.readAll(); 412 QByteArray rawData = file.readAll();
412 file.close(); 413 file.close();
413 414
414 QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); 415 QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 );
415 KABC::VCardTool tool; 416 KABC::VCardTool tool;
416 list = tool.parseVCards( data ); 417 list = tool.parseVCards( data );
417 KABC::Addressee::List::Iterator it; 418 KABC::Addressee::List::Iterator it;
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp
index 8d0fca1..4babf67 100644
--- a/kaddressbook/views/kaddressbookcardview.cpp
+++ b/kaddressbook/views/kaddressbookcardview.cpp
@@ -318,32 +318,34 @@ QStringList KAddressBookCardView::selectedUids()
318 318
319void KAddressBookCardView::refresh(QString uid) 319void KAddressBookCardView::refresh(QString uid)
320{ 320{
321 CardViewItem *item; 321 CardViewItem *item;
322 AddresseeCardViewItem *aItem; 322 AddresseeCardViewItem *aItem;
323 323
324 if (uid.isNull()) 324 if (uid.isNull())
325 { 325 {
326 // Rebuild the view 326 // Rebuild the view
327 mCardView->viewport()->setUpdatesEnabled( false ); 327 mCardView->viewport()->setUpdatesEnabled( false );
328 mCardView->clear(); 328 mCardView->clear();
329 329
330 KABC::Addressee::List addresseeList = addressees(); 330 KABC::Addressee::List addresseeList = addressees();
331 KABC::Addressee::List::Iterator iter; 331 KABC::Addressee::List::Iterator iter;
332 for (iter = addresseeList.begin(); iter != addresseeList.end(); ++iter) 332 for (iter = addresseeList.begin(); iter != addresseeList.end(); ++iter)
333 { 333 {
334 if ( (*iter).uid().left(2) == "la" && (*iter).uid().left(19) == QString("last-syncAddressee-") )
335 continue;
334 aItem = new AddresseeCardViewItem(fields(), mShowEmptyFields, 336 aItem = new AddresseeCardViewItem(fields(), mShowEmptyFields,
335 addressBook(), *iter, mCardView); 337 addressBook(), *iter, mCardView);
336 } 338 }
337 mCardView->viewport()->setUpdatesEnabled( true ); 339 mCardView->viewport()->setUpdatesEnabled( true );
338 mCardView->viewport()->update(); 340 mCardView->viewport()->update();
339 341
340 // by default nothing is selected 342 // by default nothing is selected
341 emit selected(QString::null); 343 emit selected(QString::null);
342 } 344 }
343 else 345 else
344 { 346 {
345 // Try to find the one to refresh 347 // Try to find the one to refresh
346 bool found = false; 348 bool found = false;
347 for (item = mCardView->firstItem(); item && !found; 349 for (item = mCardView->firstItem(); item && !found;
348 item = item->nextItem()) 350 item = item->nextItem())
349 { 351 {
diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp
index 0ffc674..fdc0db9 100644
--- a/kaddressbook/views/kaddressbookiconview.cpp
+++ b/kaddressbook/views/kaddressbookiconview.cpp
@@ -303,34 +303,37 @@ QStringList KAddressBookIconView::selectedUids()
303 303
304 return uidList; 304 return uidList;
305} 305}
306 306
307void KAddressBookIconView::refresh(QString uid) 307void KAddressBookIconView::refresh(QString uid)
308{ 308{
309 QIconViewItem *item; 309 QIconViewItem *item;
310 AddresseeIconViewItem *aItem; 310 AddresseeIconViewItem *aItem;
311 311
312 if ( uid.isNull() ) { 312 if ( uid.isNull() ) {
313 // Rebuild the view 313 // Rebuild the view
314 mIconView->clear(); 314 mIconView->clear();
315 mIconList.clear(); 315 mIconList.clear();
316 316
317 KABC::Addressee::List addresseeList = addressees(); 317 KABC::Addressee::List addresseeList = addressees();
318 KABC::Addressee::List::Iterator iter; 318 KABC::Addressee::List::Iterator iter;
319 for ( iter = addresseeList.begin(); iter != addresseeList.end(); ++iter ) 319 for ( iter = addresseeList.begin(); iter != addresseeList.end(); ++iter ) {
320 aItem = new AddresseeIconViewItem( fields(), addressBook(), *iter, mIconView ); 320 if ( (*iter).uid().left(2) == "la" && (*iter).uid().left(19) == QString("last-syncAddressee-") )
321 continue;
322 aItem = new AddresseeIconViewItem( fields(), addressBook(), *iter, mIconView );
323 }
321 324
322 mIconView->arrangeItemsInGrid( true ); 325 mIconView->arrangeItemsInGrid( true );
323 326
324 for ( item = mIconView->firstItem(); item; item = item->nextItem() ) 327 for ( item = mIconView->firstItem(); item; item = item->nextItem() )
325 { 328 {
326#ifndef KAB_EMBEDDED 329#ifndef KAB_EMBEDDED
327 AddresseeIconViewItem* aivi = dynamic_cast<AddresseeIconViewItem*>( item ); 330 AddresseeIconViewItem* aivi = dynamic_cast<AddresseeIconViewItem*>( item );
328#else //KAB_EMBEDDED 331#else //KAB_EMBEDDED
329 AddresseeIconViewItem* aivi = (AddresseeIconViewItem*)( item ); 332 AddresseeIconViewItem* aivi = (AddresseeIconViewItem*)( item );
330#endif //KAB_EMBEDDED 333#endif //KAB_EMBEDDED
331 mIconList.append( aivi ); 334 mIconList.append( aivi );
332 } 335 }
333 336
334 } else { 337 } else {
335 // Try to find the one to refresh 338 // Try to find the one to refresh
336 for ( item = mIconView->firstItem(); item; item = item->nextItem() ) { 339 for ( item = mIconView->firstItem(); item; item = item->nextItem() ) {
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp
index 1dc9198..fbfddba 100644
--- a/kaddressbook/views/kaddressbooktableview.cpp
+++ b/kaddressbook/views/kaddressbooktableview.cpp
@@ -264,32 +264,34 @@ void KAddressBookTableView::refresh(QString uid)
264#ifndef KAB_EMBEDDED 264#ifndef KAB_EMBEDDED
265 ContactListViewItem *nextItem = dynamic_cast<ContactListViewItem*>( currentItem->itemBelow() ); 265 ContactListViewItem *nextItem = dynamic_cast<ContactListViewItem*>( currentItem->itemBelow() );
266#else //KAB_EMBEDDED 266#else //KAB_EMBEDDED
267 ContactListViewItem *nextItem = (ContactListViewItem*)( currentItem->itemBelow() ); 267 ContactListViewItem *nextItem = (ContactListViewItem*)( currentItem->itemBelow() );
268#endif //KAB_EMBEDDED 268#endif //KAB_EMBEDDED
269 if ( nextItem ) 269 if ( nextItem )
270 nextUID = nextItem->addressee().uid(); 270 nextUID = nextItem->addressee().uid();
271 currentUID = currentItem->addressee().uid(); 271 currentUID = currentItem->addressee().uid();
272 } 272 }
273 273
274 mListView->clear(); 274 mListView->clear();
275 275
276 currentItem = 0; 276 currentItem = 0;
277 KABC::Addressee::List addresseeList = addressees(); 277 KABC::Addressee::List addresseeList = addressees();
278 KABC::Addressee::List::Iterator it; 278 KABC::Addressee::List::Iterator it;
279 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { 279 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
280 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
281 continue;
280 ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); 282 ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields());
281 if ( (*it).uid() == currentUID ) 283 if ( (*it).uid() == currentUID )
282 currentItem = item; 284 currentItem = item;
283 else if ( (*it).uid() == nextUID && !currentItem ) 285 else if ( (*it).uid() == nextUID && !currentItem )
284 currentItem = item; 286 currentItem = item;
285 } 287 }
286 288
287 // Sometimes the background pixmap gets messed up when we add lots 289 // Sometimes the background pixmap gets messed up when we add lots
288 // of items. 290 // of items.
289 mListView->repaint(); 291 mListView->repaint();
290 292
291 if ( currentItem ) { 293 if ( currentItem ) {
292 mListView->setCurrentItem( currentItem ); 294 mListView->setCurrentItem( currentItem );
293 mListView->ensureItemVisible( currentItem ); 295 mListView->ensureItemVisible( currentItem );
294 } 296 }
295 } else { 297 } else {
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index f7766f8..c7ce8cb 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -243,33 +243,34 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
243 mBlockAtStartup = false; 243 mBlockAtStartup = false;
244 mView->setModified( false ); 244 mView->setModified( false );
245 setCentralWidget( mView ); 245 setCentralWidget( mView );
246 globalFlagBlockStartup = 0; 246 globalFlagBlockStartup = 0;
247 mView->show(); 247 mView->show();
248 delete splash; 248 delete splash;
249 if ( newFile ) 249 if ( newFile )
250 mView->updateConfig(); 250 mView->updateConfig();
251 // qApp->processEvents(); 251 // qApp->processEvents();
252 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 252 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
253 //fillSyncMenu(); 253 //fillSyncMenu();
254 254
255 255
256 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 256 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
257 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 257 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
258 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 258 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
259 mSyncManager->setDefaultFileName( defaultFileName()); 259 mSyncManager->setDefaultFileName( defaultFileName());
260 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
260 mSyncManager->fillSyncMenu(); 261 mSyncManager->fillSyncMenu();
261 262
262 263
263 264
264 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 265 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
265 if ( showWarning ) { 266 if ( showWarning ) {
266 KMessageBox::information( this, 267 KMessageBox::information( this,
267 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 268 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
268 qApp->processEvents(); 269 qApp->processEvents();
269 mView->dialogManager()->showSyncOptions(); 270 mView->dialogManager()->showSyncOptions();
270 } 271 }
271 272
272 //US listen for result adressed from Ka/Pi 273 //US listen for result adressed from Ka/Pi
273#ifndef DESKTOP_VERSION 274#ifndef DESKTOP_VERSION
274 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 275 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
275#endif 276#endif