summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp2
-rw-r--r--kaddressbook/views/cardview.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index d651224..c339244 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2722,49 +2722,49 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2722 2722
2723 syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count()); 2723 syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count());
2724 2724
2725 int modulo = (er.count()/10)+1; 2725 int modulo = (er.count()/10)+1;
2726 int incCounter = 0; 2726 int incCounter = 0;
2727 while ( incCounter < er.count()) { 2727 while ( incCounter < er.count()) {
2728 if (syncManager->isProgressBarCanceled()) 2728 if (syncManager->isProgressBarCanceled())
2729 return false; 2729 return false;
2730 if ( incCounter % modulo == 0 ) 2730 if ( incCounter % modulo == 0 )
2731 syncManager->showProgressBar(incCounter); 2731 syncManager->showProgressBar(incCounter);
2732 2732
2733 uid = er[ incCounter ]; 2733 uid = er[ incCounter ];
2734 bool skipIncidence = false; 2734 bool skipIncidence = false;
2735 if ( uid.left(19) == QString("last-syncAddressee-") ) 2735 if ( uid.left(19) == QString("last-syncAddressee-") )
2736 skipIncidence = true; 2736 skipIncidence = true;
2737 QString idS,OidS; 2737 QString idS,OidS;
2738 qApp->processEvents(); 2738 qApp->processEvents();
2739 if ( !skipIncidence ) { 2739 if ( !skipIncidence ) {
2740 inL = local->findByUid( uid ); 2740 inL = local->findByUid( uid );
2741 inR = remote->findByUid( uid ); 2741 inR = remote->findByUid( uid );
2742 //inL.setResource( 0 ); 2742 //inL.setResource( 0 );
2743 //inR.setResource( 0 ); 2743 //inR.setResource( 0 );
2744 if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars 2744 if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars
2745 if ( !inL.resource() || inL.resource()->includeInSync() ) { 2745 if ( !inL.resource() || inL.resource()->includeInSync() ) {
2746 if ( take = takeAddressee( &inL, &inR, mode, fullDateRange ) ) { 2746 if ( (take = takeAddressee( &inL, &inR, mode, fullDateRange )) ) {
2747 //qDebug("take %d %s ", take, inL.summary().latin1()); 2747 //qDebug("take %d %s ", take, inL.summary().latin1());
2748 if ( take == 3 ) 2748 if ( take == 3 )
2749 return false; 2749 return false;
2750 if ( take == 1 ) {// take local ********************** 2750 if ( take == 1 ) {// take local **********************
2751 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2751 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2752 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 2752 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
2753 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); 2753 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
2754 local->insertAddressee( inL, false ); 2754 local->insertAddressee( inL, false );
2755 idS = inR.externalUID(); 2755 idS = inR.externalUID();
2756 OidS = inR.originalExternalUID(); 2756 OidS = inR.originalExternalUID();
2757 } 2757 }
2758 else 2758 else
2759 idS = inR.IDStr(); 2759 idS = inR.IDStr();
2760 remote->removeAddressee( inR ); 2760 remote->removeAddressee( inR );
2761 inR = inL; 2761 inR = inL;
2762 inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 2762 inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
2763 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2763 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2764 inR.setOriginalExternalUID( OidS ); 2764 inR.setOriginalExternalUID( OidS );
2765 inR.setExternalUID( idS ); 2765 inR.setExternalUID( idS );
2766 if ( syncManager->syncWithDesktop() ) { 2766 if ( syncManager->syncWithDesktop() ) {
2767 inR.setIDStr("changed" ); 2767 inR.setIDStr("changed" );
2768 } 2768 }
2769 //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" ); 2769 //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" );
2770 } else { 2770 } else {
diff --git a/kaddressbook/views/cardview.cpp b/kaddressbook/views/cardview.cpp
index da552c3..03df444 100644
--- a/kaddressbook/views/cardview.cpp
+++ b/kaddressbook/views/cardview.cpp
@@ -133,98 +133,98 @@ class CardViewSeparator
133}; 133};
134 134
135//END Helpers 135//END Helpers
136 136
137//BEGIN Private Data 137//BEGIN Private Data
138 138
139class CardViewPrivate 139class CardViewPrivate
140{ 140{
141 public: 141 public:
142 CardViewPrivate() 142 CardViewPrivate()
143 : mSelectionMode( CardView::Multi ), 143 : mSelectionMode( CardView::Multi ),
144 mDrawCardBorder( true ), 144 mDrawCardBorder( true ),
145 mDrawFieldLabels( true ), 145 mDrawFieldLabels( true ),
146 mDrawSeparators( true), 146 mDrawSeparators( true),
147 mSepWidth( 2 ), 147 mSepWidth( 2 ),
148 mShowEmptyFields( false ), 148 mShowEmptyFields( false ),
149 mLayoutDirty( true ), 149 mLayoutDirty( true ),
150 mLastClickOnItem( false ), 150 mLastClickOnItem( false ),
151 mItemMargin( 0 ), 151 mItemMargin( 0 ),
152 mItemSpacing( 10 ), 152 mItemSpacing( 10 ),
153 mItemWidth( 200 ), 153 mItemWidth( 200 ),
154 mMaxFieldLines( INT_MAX ), 154 mMaxFieldLines( INT_MAX ),
155 mCurrentItem( 0L ), 155 mCurrentItem( 0L ),
156 mLastClickPos( QPoint(0, 0) ), 156 mLastClickPos( QPoint(0, 0) ),
157 mResizeAnchor(0),
157 mRubberBandAnchor( 0 ), 158 mRubberBandAnchor( 0 ),
158 mCompText( QString::null ), 159 mCompText( QString::null )
159 mResizeAnchor(0)
160 {}; 160 {};
161 161
162 CardViewItemList mItemList; 162 CardViewItemList mItemList;
163 QPtrList<CardViewSeparator> mSeparatorList; 163 QPtrList<CardViewSeparator> mSeparatorList;
164 QFontMetrics *mFm; 164 QFontMetrics *mFm;
165 QFontMetrics *mBFm; // bold font 165 QFontMetrics *mBFm; // bold font
166 QFont mHeaderFont; // custom header font 166 QFont mHeaderFont; // custom header font
167 CardView::SelectionMode mSelectionMode; 167 CardView::SelectionMode mSelectionMode;
168 bool mDrawCardBorder; 168 bool mDrawCardBorder;
169 bool mDrawFieldLabels; 169 bool mDrawFieldLabels;
170 bool mDrawSeparators; 170 bool mDrawSeparators;
171 int mSepWidth; 171 int mSepWidth;
172 bool mShowEmptyFields; 172 bool mShowEmptyFields;
173 bool mLayoutDirty; 173 bool mLayoutDirty;
174 bool mLastClickOnItem; 174 bool mLastClickOnItem;
175 uint mItemMargin; // internal margin in items 175 uint mItemMargin; // internal margin in items
176 uint mItemSpacing; // spacing between items, column seperators and border 176 uint mItemSpacing; // spacing between items, column seperators and border
177 int mItemWidth; // width of all items 177 int mItemWidth; // width of all items
178 uint mMaxFieldLines; // Max lines to dispaly pr field 178 uint mMaxFieldLines; // Max lines to dispaly pr field
179 CardViewItem *mCurrentItem; 179 CardViewItem *mCurrentItem;
180 QPoint mLastClickPos; 180 QPoint mLastClickPos;
181 QTimer *mTimer; // times out if mouse rests for more than 500 msecs 181 QTimer *mTimer; // times out if mouse rests for more than 500 msecs
182 CardViewTip *mTip; // passed to the item under a resting cursor to display full text 182 CardViewTip *mTip; // passed to the item under a resting cursor to display full text
183 bool mOnSeparator; // set/reset on mouse movement 183 bool mOnSeparator; // set/reset on mouse movement
184 // for resizing by dragging the separators 184 // for resizing by dragging the separators
185 int mResizeAnchor; // uint, ulong? the mouse down separator left 185 int mResizeAnchor; // uint, ulong? the mouse down separator left
186 int mRubberBandAnchor; // for erasing rubber bands 186 int mRubberBandAnchor; // for erasing rubber bands
187 // data used for resizing. 187 // data used for resizing.
188 // as they are beeded by each mouse move while resizing, we store them here, 188 // as they are beeded by each mouse move while resizing, we store them here,
189 // saving 8 calculations in each mouse move. 189 // saving 8 calculations in each mouse move.
190 int colspace; // amount of space between items pr column 190 int colspace; // amount of space between items pr column
191 uint first; // the first col to anchor at for painting rubber bands 191 uint first; // the first col to anchor at for painting rubber bands
192 int firstX; // X position of first in pixel 192 int firstX; // X position of first in pixel
193 int pressed; // the colummn that was pressed on at resizing start 193 int pressed; // the colummn that was pressed on at resizing start
194 int span; // pressed - first 194 int span; // pressed - first
195 // key completion 195 // key completion
196 QString mCompText; // current completion string 196 QString mCompText; // current completion string
197 QDateTime mCompUpdated; // ...was updated at this time 197 QDateTime mCompUpdated; // ...was updated at this time
198}; 198};
199 199
200class CardViewItemPrivate 200class CardViewItemPrivate
201{ 201{
202 public: 202 public:
203 CardViewItemPrivate() : 203 CardViewItemPrivate() :
204 x( 0 ), 204 mSelected( false ),
205 y( 0 ), 205 x( 0 ),
206 mSelected( false ){}; 206 y( 0 ){};
207 207
208 208
209 QString mCaption; 209 QString mCaption;
210 QPtrList< CardViewItem::Field > mFieldList; 210 QPtrList< CardViewItem::Field > mFieldList;
211 bool mSelected; 211 bool mSelected;
212 int x; // horizontal position, set by the view 212 int x; // horizontal position, set by the view
213 int y; // vertical position, set by the view 213 int y; // vertical position, set by the view
214 int maxLabelWidth; // the width of the widest label, according to the view font. 214 int maxLabelWidth; // the width of the widest label, according to the view font.
215 int hcache; // height cache 215 int hcache; // height cache
216}; 216};
217//END Private Data 217//END Private Data
218 218
219//BEGIN CardViewItem 219//BEGIN CardViewItem
220 220
221CardViewItem::CardViewItem(CardView *parent, QString caption) 221CardViewItem::CardViewItem(CardView *parent, QString caption)
222 : d(new CardViewItemPrivate()), mView(parent) 222 : d(new CardViewItemPrivate()), mView(parent)
223{ 223{
224 d->mCaption = caption; 224 d->mCaption = caption;
225 225
226 initialize(); 226 initialize();
227} 227}
228 228
229CardViewItem::~CardViewItem() 229CardViewItem::~CardViewItem()
230{ 230{