author | zautrix <zautrix> | 2005-08-17 19:23:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-17 19:23:08 (UTC) |
commit | dfb9cdc7d39b988e23e5491e1c8f0e8c5713dae5 (patch) (unidiff) | |
tree | f2c58bbb72294d1a7d1d3fac8c11e15087a01460 | |
parent | fefa169958abb9c487205d92b54c79532b6f924a (diff) | |
download | kdepimpi-dfb9cdc7d39b988e23e5491e1c8f0e8c5713dae5.zip kdepimpi-dfb9cdc7d39b988e23e5491e1c8f0e8c5713dae5.tar.gz kdepimpi-dfb9cdc7d39b988e23e5491e1c8f0e8c5713dae5.tar.bz2 |
import fix
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 1 | ||||
-rw-r--r-- | kaddressbook/xxportmanager.cpp | 13 |
2 files changed, 11 insertions, 3 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 15caf9e..fd5e4f9 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -8,8 +8,9 @@ Fixed a problem with the default settings for new todos. | |||
8 | 8 | ||
9 | KA/Pi: | 9 | KA/Pi: |
10 | Added a config option to turn on asking before a contact is deleted. | 10 | Added a config option to turn on asking before a contact is deleted. |
11 | Fixed a problem with the default view and view selection at startup. | 11 | Fixed a problem with the default view and view selection at startup. |
12 | Formatted name is now set on import, if formatted name is empty. | ||
12 | 13 | ||
13 | ********** VERSION 2.2.0 ************ | 14 | ********** VERSION 2.2.0 ************ |
14 | 15 | ||
15 | New stable release! | 16 | New stable release! |
diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp index 7cb67ed..405f7ec 100644 --- a/kaddressbook/xxportmanager.cpp +++ b/kaddressbook/xxportmanager.cpp | |||
@@ -58,8 +58,9 @@ extern "C" | |||
58 | #include "undocmds.h" | 58 | #include "undocmds.h" |
59 | #include "xxportselectdialog.h" | 59 | #include "xxportselectdialog.h" |
60 | 60 | ||
61 | #include "xxportmanager.h" | 61 | #include "xxportmanager.h" |
62 | #include "nameeditdialog.h" | ||
62 | 63 | ||
63 | KURL XXPortManager::importURL = KURL(); | 64 | KURL XXPortManager::importURL = KURL(); |
64 | QString XXPortManager::importData = QString::null; | 65 | QString XXPortManager::importData = QString::null; |
65 | 66 | ||
@@ -131,8 +132,14 @@ void XXPortManager::slotImport( const QString &identifier, const QString &data ) | |||
131 | mShowPreview = true; | 132 | mShowPreview = true; |
132 | KABC::AddresseeList::Iterator it; | 133 | KABC::AddresseeList::Iterator it; |
133 | bool imported = false; | 134 | bool imported = false; |
134 | int count = 0; | 135 | int count = 0; |
136 | |||
137 | KConfig config( locateLocal("config", "kabcrc") ); | ||
138 | config.setGroup( "General" ); | ||
139 | int FormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); | ||
140 | |||
141 | |||
135 | for ( it = list.begin(); it != list.end(); ++it ) { | 142 | for ( it = list.begin(); it != list.end(); ++it ) { |
136 | if ( mShowPreview ) { | 143 | if ( mShowPreview ) { |
137 | PreviewDialog dlg( *it, mCore ); | 144 | PreviewDialog dlg( *it, mCore ); |
138 | connect( &dlg, SIGNAL( closeClicked() ), this, SLOT ( noPreview()) ); | 145 | connect( &dlg, SIGNAL( closeClicked() ), this, SLOT ( noPreview()) ); |
@@ -140,11 +147,13 @@ void XXPortManager::slotImport( const QString &identifier, const QString &data ) | |||
140 | if ( mShowPreview ) | 147 | if ( mShowPreview ) |
141 | continue; | 148 | continue; |
142 | } | 149 | } |
143 | } | 150 | } |
144 | |||
145 | (*it).setResource( resource ); | 151 | (*it).setResource( resource ); |
152 | if ( (*it).formattedName().isEmpty() ) | ||
153 | (*it).setFormattedName( NameEditDialog::formattedName( (*it), FormattedNameType ) ); | ||
146 | if ( useUndo ) { | 154 | if ( useUndo ) { |
155 | ++count; | ||
147 | // We use a PwNewCommand so the user can undo it. | 156 | // We use a PwNewCommand so the user can undo it. |
148 | PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it ); | 157 | PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it ); |
149 | UndoStack::instance()->push( command ); | 158 | UndoStack::instance()->push( command ); |
150 | RedoStack::instance()->clear(); | 159 | RedoStack::instance()->clear(); |
@@ -153,12 +162,10 @@ void XXPortManager::slotImport( const QString &identifier, const QString &data ) | |||
153 | mCore->addressBook()->insertAddressee( (*it), true, true ); | 162 | mCore->addressBook()->insertAddressee( (*it), true, true ); |
154 | } | 163 | } |
155 | imported = true; | 164 | imported = true; |
156 | } | 165 | } |
157 | |||
158 | if ( imported ) { | 166 | if ( imported ) { |
159 | KMessageBox::information( mCore, i18n( "%1 contacts\nsuccessfully\nimported.").arg( count) ); | 167 | KMessageBox::information( mCore, i18n( "%1 contacts\nsuccessfully\nimported.").arg( count) ); |
160 | |||
161 | emit modified(); | 168 | emit modified(); |
162 | } | 169 | } |
163 | } | 170 | } |
164 | void XXPortManager::noPreview() | 171 | void XXPortManager::noPreview() |