[prev in list] [next in list] [prev in thread] [next in thread]
List: kmail-devel
Subject: Fix kontact recent addresse into kmail/knode.
From: Laurent Montel <montel () kde ! org>
Date: 2004-01-02 9:14:39
Message-ID: 200401021014.39874.montel () kde ! org
[Download RAW message or body]
Hi,
I found a bug when kmail or knode is launched into kontact.
kmail and knode doesn't load "recent address" because into KRecentAddress it
used "KGlobal::config()", but when it's into kontact it use config from
kontant and not from kmail/knode.
So now I fixed it and use KMKernel::config when I create RecentAdress class.
I can commit it ?
Regards.
["kontact-recent-adress-fix.patch" (text/x-diff)]
cvs diff: Diffing libkdenetwork
Index: libkdenetwork/recentaddresses.cpp
===================================================================
RCS file: /home/kde/kdepim/libkdenetwork/recentaddresses.cpp,v
retrieving revision 1.2
diff -u -u -p -r1.2 recentaddresses.cpp
--- libkdenetwork/recentaddresses.cpp 17 Jun 2003 23:40:42 -0000 1.2
+++ libkdenetwork/recentaddresses.cpp 2 Jan 2004 09:10:23 -0000
@@ -43,16 +43,19 @@ static KStaticDeleter<RecentAddresses> s
RecentAddresses * RecentAddresses::s_self = 0;
-RecentAddresses * RecentAddresses::self()
+RecentAddresses * RecentAddresses::self( KConfig *config)
{
if ( !s_self )
- sd.setObject( s_self, new RecentAddresses() );
+ sd.setObject( s_self, new RecentAddresses(config) );
return s_self;
}
-RecentAddresses::RecentAddresses()
+RecentAddresses::RecentAddresses(KConfig * config)
{
+ if ( !config )
load( KGlobal::config() );
+ else
+ load( config );
}
RecentAddresses::~RecentAddresses()
Index: libkdenetwork/recentaddresses.h
===================================================================
RCS file: /home/kde/kdepim/libkdenetwork/recentaddresses.h,v
retrieving revision 1.3
diff -u -u -p -r1.3 recentaddresses.h
--- libkdenetwork/recentaddresses.h 26 Jul 2003 14:51:53 -0000 1.3
+++ libkdenetwork/recentaddresses.h 2 Jan 2004 09:10:23 -0000
@@ -51,7 +51,7 @@ public:
/**
* @returns the only possible instance of this class.
*/
- static RecentAddresses * self();
+ static RecentAddresses * self(KConfig *config = 0L);
/**
* @returns the list of recent addresses.
@@ -92,7 +92,7 @@ public:
void save( KConfig * );
private:
- RecentAddresses();
+ RecentAddresses(KConfig *config = 0L);
KABC::Addressee::List m_addresseeList;
cvs diff: Diffing libkdenetwork/pics4kmail
cvs diff: Diffing libkdenetwork/pics4knode
cvs diff: Diffing libkdenetwork/tests
cvs diff: Diffing libkdenetwork/tests/data
cvs diff: Diffing libkdenetwork/tests/data/codec_b
cvs diff: Diffing libkdenetwork/tests/data/codec_base64
cvs diff: Diffing libkdenetwork/tests/data/codec_q
cvs diff: Diffing libkdenetwork/tests/data/codec_quoted-printable
cvs diff: Diffing libkdenetwork/tests/data/codec_x-kmime-rfc2231
cvs diff: Diffing libkdenetwork/tests/data/codec_x-uuencode
cvs diff: Diffing kmail
Index: kmail/kmcomposewin.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmcomposewin.cpp,v
retrieving revision 1.769
diff -u -u -p -r1.769 kmcomposewin.cpp
--- kmail/kmcomposewin.cpp 28 Dec 2003 14:10:34 -0000 1.769
+++ kmail/kmcomposewin.cpp 2 Jan 2004 09:10:24 -0000
@@ -3899,7 +3899,7 @@ void KMComposeWin::addrBookSelInto()
dlg.setSelectedBCC( lst );
}
- dlg.setRecentAddresses( RecentAddresses::self()->kabcAddresses() );
+ dlg.setRecentAddresses( RecentAddresses::self( KMKernel::config() )->kabcAddresses() );
if (dlg.exec()==QDialog::Rejected) return;
@@ -4972,9 +4972,9 @@ bool KMComposeWin::doSend(int aSendNow,
if (saveInDrafts || !aSendNow)
emit messageQueuedOrDrafted();
- RecentAddresses::self()->add( bcc() );
- RecentAddresses::self()->add( cc() );
- RecentAddresses::self()->add( to() );
+ RecentAddresses::self(KMKernel::config())->add( bcc() );
+ RecentAddresses::self(KMKernel::config())->add( cc() );
+ RecentAddresses::self(KMKernel::config())->add( to() );
mAutoDeleteMsg = FALSE;
mFolder = 0;
@@ -5686,7 +5686,7 @@ void KMLineEdit::loadAddresses()
{
AddressLineEdit::loadAddresses();
- QStringList recent = RecentAddresses::self()->addresses();
+ QStringList recent = RecentAddresses::self(KMKernel::config())->addresses();
QStringList::Iterator it = recent.begin();
for ( ; it != recent.end(); ++it )
addAddress( *it );
Index: kmail/kmkernel.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmkernel.cpp,v
retrieving revision 1.230
diff -u -u -p -r1.230 kmkernel.cpp
--- kmail/kmkernel.cpp 23 Dec 2003 21:50:57 -0000 1.230
+++ kmail/kmkernel.cpp 2 Jan 2004 09:10:25 -0000
@@ -1151,7 +1151,7 @@ void KMKernel::cleanupLoop()
mCryptPlugList = 0;
//qInstallMsgHandler(oldMsgHandler);
- RecentAddresses::self()->save( KMKernel::config() );
+ RecentAddresses::self(KMKernel::config())->save( KMKernel::config() );
KMKernel::config()->sync();
if (mCleanupPopup)
{
cvs diff: Diffing kmail/about
cvs diff: Diffing kmail/interfaces
cvs diff: Diffing kmail/pics
cvs diff: Diffing kmail/pics/icons
cvs diff: Diffing kmail/profiles
cvs diff: Diffing knode
Index: knode/kncomposer.cpp
===================================================================
RCS file: /home/kde/kdepim/knode/kncomposer.cpp,v
retrieving revision 1.185
diff -u -u -p -r1.185 kncomposer.cpp
--- knode/kncomposer.cpp 17 Dec 2003 13:32:50 -0000 1.185
+++ knode/kncomposer.cpp 2 Jan 2004 09:10:25 -0000
@@ -76,7 +76,7 @@ void KNLineEdit::loadAddresses()
{
KNLineEditInherited::loadAddresses();
- QStringList recent = RecentAddresses::self()->addresses();
+ QStringList recent = RecentAddresses::self(knGlobals.config())->addresses();
QStringList::Iterator it = recent.begin();
for ( ; it != recent.end(); ++it )
addAddress( *it );
@@ -990,7 +990,7 @@ void KNComposer::insertFile(bool clear,
void KNComposer::addRecentAddress()
{
if( !v_iew->t_o->isHidden() )
- RecentAddresses::self()->add( v_iew->t_o->text() );
+ RecentAddresses::self(knGlobals.config())->add( v_iew->t_o->text() );
}
void KNComposer::slotSendNow()
@@ -1427,7 +1427,7 @@ void KNComposer::slotToBtnClicked()
dlg.setSelectedTo( lst );
}
#endif
- dlg.setRecentAddresses( RecentAddresses::self()->kabcAddresses() );
+ dlg.setRecentAddresses( RecentAddresses::self(knGlobals.config())->kabcAddresses() );
if (dlg.exec()==QDialog::Rejected) return;
if(!to.isEmpty())
Index: knode/knmainwidget.cpp
===================================================================
RCS file: /home/kde/kdepim/knode/knmainwidget.cpp,v
retrieving revision 1.16
diff -u -u -p -r1.16 knmainwidget.cpp
--- knode/knmainwidget.cpp 24 Dec 2003 11:48:31 -0000 1.16
+++ knode/knmainwidget.cpp 2 Jan 2004 09:10:26 -0000
@@ -968,7 +968,7 @@ void KNMainWidget::prepareShutdown()
delete cup;
saveOptions();
- RecentAddresses::self()->save( knGlobals.config() );
+ RecentAddresses::self(knGlobals.config())->save( knGlobals.config() );
c_fgManager->syncConfig();
a_rtManager->deleteTempFiles();
g_rpManager->syncGroups();
cvs diff: Diffing knode/filters
cvs diff: Diffing knode/pics
_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic