author | zautrix <zautrix> | 2005-08-23 21:48:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-23 21:48:53 (UTC) |
commit | 2acca9aff5bd651923b5d728712a0fd80b3d54e9 (patch) (side-by-side diff) | |
tree | c2113d441908520d86902a8a9fade08eb05ee0d0 /kaddressbook | |
parent | 6f5464760f5fb1e4c13027464cfe4943b85d29a0 (diff) | |
download | kdepimpi-2acca9aff5bd651923b5d728712a0fd80b3d54e9.zip kdepimpi-2acca9aff5bd651923b5d728712a0fd80b3d54e9.tar.gz kdepimpi-2acca9aff5bd651923b5d728712a0fd80b3d54e9.tar.bz2 |
fastload fixes
-rw-r--r-- | kaddressbook/kabcore.cpp | 18 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 4 |
2 files changed, 17 insertions, 5 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index af12f2b..4e2523e 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -599,33 +599,33 @@ void KABCore::saveSettings() KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); if ( mExtensionBarSplitter ) KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); #ifndef KAB_EMBEDDED KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); #endif //KAB_EMBEDDED mExtensionManager->saveSettings(); mViewManager->saveSettings(); KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); KABPrefs::instance()->writeConfig(); - qDebug("KA: KABCore::saveSettings() "); + //qDebug("KA: KABCore::saveSettings() "); } KABC::AddressBook *KABCore::addressBook() const { return mAddressBook; } KConfig *KABCore::config() { #ifndef KAB_EMBEDDED return KABPrefs::instance()->config(); #else //KAB_EMBEDDED return KABPrefs::instance()->getConfig(); #endif //KAB_EMBEDDED } @@ -831,74 +831,84 @@ void KABCore::beamMySelf() KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); if (!a.isEmpty()) { QStringList uids; uids << a.uid(); beamVCard(uids); } else { KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); } } void KABCore::updateMainWindow() { mMainWindow->showMaximized(); - mMainWindow->update(); + //mMainWindow->repaint(); } void KABCore::resizeEvent(QResizeEvent* e ) { if ( !mMiniSplitter ) return; - //qDebug("KABCore::resizeEvent(QResizeEvent* e ) "); - if ( e->oldSize().width() != e->size().width() ) + static int desktop_width = 0; + //qDebug("KABCore::resizeEvent %d %d ",desktop_width,QApplication::desktop()->width() ); + if ( desktop_width != QApplication::desktop()->width() ) if ( QApplication::desktop()->width() >= 480 ) { if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 + //qDebug("640 "); if ( mMiniSplitter->orientation() == Qt::Vertical ) { + //qDebug("switch V->H "); mMiniSplitter->setOrientation( Qt::Horizontal); mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); } if ( QApplication::desktop()->width() <= 640 ) { + bool shot = mMainWindow->isVisible(); mMainWindow->showMinimized(); //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); mViewManager->getFilterAction()->setComboWidth( 150 ); if ( mIncSearchWidget ) mIncSearchWidget->setSize(); + if ( shot ) QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); } } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 + //qDebug("480 "); if ( mMiniSplitter->orientation() == Qt::Horizontal ) { + //qDebug("switch H->V "); mMiniSplitter->setOrientation( Qt::Vertical ); mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); } if ( QApplication::desktop()->width() <= 640 ) { //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); + bool shot = mMainWindow->isVisible(); mMainWindow->showMinimized(); if ( KABPrefs::instance()->mHideSearchOnSwitch ) { if ( mIncSearchWidget ) { mIncSearchWidget->setSize(); } } else { mViewManager->getFilterAction()->setComboWidth( 0 ); } + if ( shot ) QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); } } } + desktop_width = QApplication::desktop()->width(); QWidget::resizeEvent( e ); } void KABCore::export2phone() { QStringList uids; XXPortSelectDialog dlg( this, false, this ); if ( dlg.exec() ) uids = dlg.uids(); else return; if ( uids.isEmpty() ) return; // qDebug("count %d ", uids.count()); diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 02fc40a..272f2eb 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp @@ -321,36 +321,38 @@ void KAddressBookTableView::refresh(QString uid) currentItem = 0; KABC::Addressee::List addresseeList = addressees(); KABC::Addressee::List::Iterator it; for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) continue; ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); if ( (*it).uid() == currentUID ) currentItem = item; else if ( (*it).uid() == nextUID && !currentItem ) currentItem = item; } // Sometimes the background pixmap gets messed up when we add lots // of items. mListView->repaint(); - + if ( !currentItem ) + currentItem = (ContactListViewItem *)mListView->firstChild(); if ( currentItem ) { mListView->setCurrentItem( currentItem ); mListView->ensureItemVisible( currentItem ); + mListView->setSelected( currentItem, true ); } } else { // Only need to update on entry. Iterate through and try to find it ContactListViewItem *ceItem; QListViewItemIterator it( mListView ); while ( it.current() ) { #ifndef KAB_EMBEDDED ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); #else //KAB_EMBEDDED ceItem = (ContactListViewItem*)( it.current() ); #endif //KAB_EMBEDDED if ( ceItem && ceItem->addressee().uid() == uid ) { ceItem->refresh(); return; } |