Removed the 'iterate over all toplevel windows and call readConfig()' hack

by a clean signal/slot solution to notify the single components of a change
in the config dialog.
That fixes also #67484.

CCMAIL:67484-done@bugs.kde.org

svn path=/trunk/kdepim/; revision=269130
wilder-work
Tobias Koenig 23 years ago
parent 1d153540b0
commit b35bfb1c9c
  1. 7
      configuredialog.cpp
  2. 3
      configuredialog.h
  3. 7
      kmcomposewin.cpp
  4. 1
      kmcomposewin.h
  5. 5
      kmkernel.cpp
  6. 3
      kmkernel.h
  7. 8
      kmmainwidget.cpp
  8. 2
      kmmainwidget.h
  9. 10
      kmmainwin.cpp
  10. 1
      kmmainwin.h
  11. 14
      kmreadermainwin.cpp
  12. 2
      kmreadermainwin.h

@ -339,11 +339,8 @@ void ConfigureDialog::apply( bool everything ) {
//
KMMessage::readConfig();
KCursorSaver busy(KBusyPtr::busy()); // this can take some time when a large folder is open
QPtrListIterator<KMainWindow> it( *KMainWindow::memberList );
for ( it.toFirst() ; it.current() ; ++it )
// ### FIXME: use dynamic_cast.
if ( (*it)->inherits( "KMTopLevelWidget" ) )
((KMTopLevelWidget*)(*it))->readConfig();
emit configChanged();
}

@ -63,6 +63,9 @@ protected slots:
private slots:
void slotCancelOrClose();
signals:
void configChanged();
private:
void setup();
void apply(bool);

@ -245,6 +245,8 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id )
SLOT(slotFolderRemoved(KMFolder*)));
connect(kmkernel->dimapFolderMgr(),SIGNAL(folderRemoved(KMFolder*)),
SLOT(slotFolderRemoved(KMFolder*)));
connect( kmkernel, SIGNAL( configChanged() ),
this, SLOT( slotConfigChanged() ) );
connect (mEditor, SIGNAL (spellcheck_done(int)),
this, SLOT (slotSpellcheckDone (int)));
@ -5305,6 +5307,11 @@ void KMComposeWin::slotCompletionModeChanged( KGlobalSettings::Completion mode)
mEdtBcc->setCompletionMode( mode );
}
void KMComposeWin::slotConfigChanged()
{
readConfig();
}
/*
* checks if the drafts-folder has been deleted
* that is not nice so we set the system-drafts-folder

@ -828,6 +828,7 @@ protected:
private slots:
void slotCompletionModeChanged( KGlobalSettings::Completion );
void slotConfigChanged();
private:
QColor mForeColor,mBackColor;

@ -1361,8 +1361,11 @@ void KMKernel::slotRequestConfigSync() {
void KMKernel::slotShowConfigurationDialog()
{
if( !mConfigureDialog )
if( !mConfigureDialog ) {
mConfigureDialog = new ConfigureDialog( 0, "configure", false );
connect( mConfigureDialog, SIGNAL( configChanged() ),
this, SIGNAL( configChanged() ) );
}
if( mConfigureDialog->isHidden() )
mConfigureDialog->show();

@ -235,6 +235,9 @@ protected slots:
void cleanupLoop();
void cleanupProgress();
signals:
void configChanged();
private:
KMFolder *the_inboxFolder;
KMFolder *the_outboxFolder;

@ -122,6 +122,9 @@ KMMainWidget::KMMainWidget(QWidget *parent, const char *name,
connect(kmkernel->acctMgr(), SIGNAL( checkedMail(bool, bool)),
SLOT( slotMailChecked(bool, bool)));
connect(kmkernel, SIGNAL( configChanged() ),
this, SLOT( slotConfigChanged() ));
// display the full path to the folder in the caption
connect(mFolderTree, SIGNAL(currentChanged(QListViewItem*)),
this, SLOT(slotChangeCaption(QListViewItem*)));
@ -1365,6 +1368,11 @@ void KMMainWidget::slotPrintMsg()
command->start();
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotConfigChanged()
{
readConfig();
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotSaveMsg()

@ -343,6 +343,8 @@ protected slots:
void slotToFilter();
void slotPrintMsg();
void slotConfigChanged();
private:
// Message actions
KAction *mTrashAction, *mDeleteAction, *mSaveAsAction, *mEditAction,

@ -49,10 +49,14 @@ KMMainWin::KMMainWin(QWidget *)
applyMainWindowSettings(KMKernel::config(), "Main Window");
connect(kmkernel->msgSender(), SIGNAL(statusMsg(const QString&)),
this, SLOT(statusMsg(const QString&)));
connect(kmkernel, SIGNAL(configChanged()),
this, SLOT(slotConfigChanged()));
connect(mKMMainWidget->messageView(), SIGNAL(statusMsg(const QString&)),
this, SLOT(htmlStatusMsg(const QString&)));
connect(mKMMainWidget, SIGNAL(captionChangeRequest(const QString&)),
SLOT(setCaption(const QString&)) );
mKMMainWidget->readConfig();
}
KMMainWin::~KMMainWin()
@ -147,7 +151,6 @@ void KMMainWin::setupStatusBar()
/** Read configuration options after widgets are created. */
void KMMainWin::readConfig(void)
{
mKMMainWidget->readConfig();
}
/** Write configuration options. */
@ -161,6 +164,11 @@ void KMMainWin::slotQuit()
close();
}
void KMMainWin::slotConfigChanged()
{
readConfig();
}
//-----------------------------------------------------------------------------
bool KMMainWin::queryClose() {
if (kmkernel->shuttingDown() || kapp->sessionSaving())

@ -50,6 +50,7 @@ protected:
protected slots:
void slotQuit();
void slotConfigChanged();
private:
#if !KDE_IS_VERSION( 3, 1, 90 )

@ -34,6 +34,9 @@ KMReaderMainWin::KMReaderMainWin( bool htmlOverride, char *name )
mReaderWin->setHtmlOverride( htmlOverride );
setCentralWidget( mReaderWin );
setupAccel();
connect( kmkernel, SIGNAL( configChanged() ),
this, SLOT( slotConfigChanged() ) );
}
@ -44,6 +47,9 @@ KMReaderMainWin::KMReaderMainWin( char *name )
mReaderWin->setAutoDelete( true );
setCentralWidget( mReaderWin );
setupAccel();
connect( kmkernel, SIGNAL( configChanged() ),
this, SLOT( slotConfigChanged() ) );
}
@ -58,6 +64,9 @@ KMReaderMainWin::KMReaderMainWin(KMMessagePart* aMsgPart,
mReaderWin->setMsgPart( aMsgPart, aHTML, aFileName, pname );
setCentralWidget( mReaderWin );
setupAccel();
connect( kmkernel, SIGNAL( configChanged() ),
this, SLOT( slotConfigChanged() ) );
}
@ -131,6 +140,11 @@ void KMReaderMainWin::slotBounceMsg()
command->start();
}
//-----------------------------------------------------------------------------
void KMReaderMainWin::slotConfigChanged()
{
readConfig();
}
void KMReaderMainWin::setupAccel()
{

@ -40,6 +40,8 @@ private slots:
void slotRedirectMsg();
void slotBounceMsg();
void slotConfigChanged();
private:
void setupAccel();

Loading…
Cancel
Save