-rw-r--r-- | kaddressbook/kabcore.cpp | 22 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 4 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 15 | ||||
-rw-r--r-- | microkde/kdeui/ktoolbar.cpp | 4 |
4 files changed, 29 insertions, 16 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index af12f2b..4e2523e 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -611,9 +611,9 @@ void KABCore::saveSettings() KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); KABPrefs::instance()->writeConfig(); - qDebug("KA: KABCore::saveSettings() "); + //qDebug("KA: KABCore::saveSettings() "); } KABC::AddressBook *KABCore::addressBook() const { @@ -843,50 +843,60 @@ void KABCore::beamMySelf() } 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(); - QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); + 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 ); } - QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); + if ( shot ) + QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); } } } + desktop_width = QApplication::desktop()->width(); QWidget::resizeEvent( e ); } void KABCore::export2phone() 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 @@ -333,12 +333,14 @@ void KAddressBookTableView::refresh(QString uid) // 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; diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 8c72d89..70baf5c 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -288,20 +288,21 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : mCalendarModifiedFlag = false; - QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); - splash->setAlignment ( AlignCenter ); - setCentralWidget( splash ); + // QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); + //splash->setAlignment ( AlignCenter ); + //setCentralWidget( splash ); #ifndef DESKTOP_VERSION - showMaximized(); + //showMaximized(); #endif //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); setDefaultPreferences(); mCalendar = new CalendarLocal(); mView = new CalendarView( mCalendar, this,"mCalendar " ); - mView->hide(); + setCentralWidget( mView ); + //mView->hide(); //mView->resize(splash->size() ); initActions(); mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); mSyncManager->setBlockSave(false); @@ -360,10 +361,10 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : SLOT( disableBR(bool) ) ); connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); setCentralWidget( mView ); globalFlagBlockStartup = 0; - mView->show(); - delete splash; + //mView->show(); + //delete splash; if ( newFile ) mView->updateConfig(); // qApp->processEvents(); //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp index 36ede81..df2aad8 100644 --- a/microkde/kdeui/ktoolbar.cpp +++ b/microkde/kdeui/ktoolbar.cpp @@ -1414,15 +1414,15 @@ void KToolBar::insertWidgetInternal( QWidget *w, int &index, int id ) void KToolBar::repaintMe() { setUpdatesEnabled( true ); QToolBar::repaint( true ); - //qDebug(" KToolBar::repaintMe() "); + qDebug(" KToolBar::repaintMe() "); } void KToolBar::showEvent( QShowEvent *e ) { - QToolBar::showEvent( e ); rebuildLayout(); + QToolBar::showEvent( e ); } void KToolBar::setStretchableWidget( QWidget *w ) { |