author | zautrix <zautrix> | 2005-01-24 09:57:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-24 09:57:42 (UTC) |
commit | 485a6b28e3be6437742852970fdd122ba071b726 (patch) (unidiff) | |
tree | 2ff605dbd72c91fa5d693056cf7dd0c746c0e2e3 | |
parent | ec69f34e62250f95a1f8757c5d58da0bf330678a (diff) | |
download | kdepimpi-485a6b28e3be6437742852970fdd122ba071b726.zip kdepimpi-485a6b28e3be6437742852970fdd122ba071b726.tar.gz kdepimpi-485a6b28e3be6437742852970fdd122ba071b726.tar.bz2 |
chaned qt version comparison
-rw-r--r-- | kaddressbook/views/kaddressbookcardview.cpp | 4 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbookiconview.cpp | 4 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 4 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 2 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.h | 2 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 2 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 22 | ||||
-rw-r--r-- | korganizer/timespanview.cpp | 2 | ||||
-rw-r--r-- | libkcal/icalformatimpl.cpp | 6 | ||||
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 10 | ||||
-rw-r--r-- | microkde/kcalendarsystemgregorian.cpp | 8 |
11 files changed, 31 insertions, 35 deletions
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp index 6fcd73f..9d8c5ce 100644 --- a/kaddressbook/views/kaddressbookcardview.cpp +++ b/kaddressbook/views/kaddressbookcardview.cpp | |||
@@ -285,81 +285,81 @@ void KAddressBookCardView::readConfig(KConfig *config) | |||
285 | #endif | 285 | #endif |
286 | 286 | ||
287 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), | 287 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), |
288 | this, SLOT(addresseeExecuted(CardViewItem *))); | 288 | this, SLOT(addresseeExecuted(CardViewItem *))); |
289 | } | 289 | } |
290 | 290 | ||
291 | void KAddressBookCardView::writeConfig( KConfig *config ) | 291 | void KAddressBookCardView::writeConfig( KConfig *config ) |
292 | { | 292 | { |
293 | config->writeEntry( "ItemWidth", mCardView->itemWidth() ); | 293 | config->writeEntry( "ItemWidth", mCardView->itemWidth() ); |
294 | KAddressBookView::writeConfig( config ); | 294 | KAddressBookView::writeConfig( config ); |
295 | } | 295 | } |
296 | void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) | 296 | void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) |
297 | { | 297 | { |
298 | mCardView->clear(); | 298 | mCardView->clear(); |
299 | if ( s.isEmpty() || s == "*" ) { | 299 | if ( s.isEmpty() || s == "*" ) { |
300 | refresh(); | 300 | refresh(); |
301 | return; | 301 | return; |
302 | } | 302 | } |
303 | QString pattern = s.lower()+"*"; | 303 | QString pattern = s.lower()+"*"; |
304 | QRegExp re; | 304 | QRegExp re; |
305 | re.setWildcard(true); // most people understand these better. | 305 | re.setWildcard(true); // most people understand these better. |
306 | re.setCaseSensitive(false); | 306 | re.setCaseSensitive(false); |
307 | re.setPattern( pattern ); | 307 | re.setPattern( pattern ); |
308 | if (!re.isValid()) | 308 | if (!re.isValid()) |
309 | return; | 309 | return; |
310 | mCardView->viewport()->setUpdatesEnabled( false ); | 310 | mCardView->viewport()->setUpdatesEnabled( false ); |
311 | KABC::Addressee::List addresseeList = addressees(); | 311 | KABC::Addressee::List addresseeList = addressees(); |
312 | KABC::Addressee::List::Iterator it; | 312 | KABC::Addressee::List::Iterator it; |
313 | if ( field ) { | 313 | if ( field ) { |
314 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 314 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
315 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 315 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
316 | continue; | 316 | continue; |
317 | #if QT_VERSION >= 300 | 317 | #if QT_VERSION >= 0x030000 |
318 | if (re.search(field->value( *it ).lower()) != -1) | 318 | if (re.search(field->value( *it ).lower()) != -1) |
319 | #else | 319 | #else |
320 | if (re.match(field->value( *it ).lower()) != -1) | 320 | if (re.match(field->value( *it ).lower()) != -1) |
321 | #endif | 321 | #endif |
322 | new AddresseeCardViewItem(fields(), mShowEmptyFields, | 322 | new AddresseeCardViewItem(fields(), mShowEmptyFields, |
323 | addressBook(), *it, mCardView); | 323 | addressBook(), *it, mCardView); |
324 | 324 | ||
325 | } | 325 | } |
326 | } else { | 326 | } else { |
327 | KABC::Field::List fieldList = allFields(); | 327 | KABC::Field::List fieldList = allFields(); |
328 | KABC::Field::List::ConstIterator fieldIt; | 328 | KABC::Field::List::ConstIterator fieldIt; |
329 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 329 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
330 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 330 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
331 | continue; | 331 | continue; |
332 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 332 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
333 | #if QT_VERSION >= 300 | 333 | #if QT_VERSION >= 0x030000 |
334 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) | 334 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) |
335 | #else | 335 | #else |
336 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) | 336 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) |
337 | #endif | 337 | #endif |
338 | { | 338 | { |
339 | new AddresseeCardViewItem(fields(), mShowEmptyFields, | 339 | new AddresseeCardViewItem(fields(), mShowEmptyFields, |
340 | addressBook(), *it, mCardView); | 340 | addressBook(), *it, mCardView); |
341 | break; | 341 | break; |
342 | } | 342 | } |
343 | } | 343 | } |
344 | } | 344 | } |
345 | } | 345 | } |
346 | mCardView->viewport()->setUpdatesEnabled( true ); | 346 | mCardView->viewport()->setUpdatesEnabled( true ); |
347 | mCardView->viewport()->update(); | 347 | mCardView->viewport()->update(); |
348 | if ( mCardView->firstItem() ) { | 348 | if ( mCardView->firstItem() ) { |
349 | mCardView->setCurrentItem ( mCardView->firstItem() ); | 349 | mCardView->setCurrentItem ( mCardView->firstItem() ); |
350 | mCardView->setSelected ( mCardView->firstItem() , true ); | 350 | mCardView->setSelected ( mCardView->firstItem() , true ); |
351 | } | 351 | } |
352 | else | 352 | else |
353 | emit selected(QString::null); | 353 | emit selected(QString::null); |
354 | } | 354 | } |
355 | QStringList KAddressBookCardView::selectedUids() | 355 | QStringList KAddressBookCardView::selectedUids() |
356 | { | 356 | { |
357 | QStringList uidList; | 357 | QStringList uidList; |
358 | CardViewItem *item; | 358 | CardViewItem *item; |
359 | AddresseeCardViewItem *aItem; | 359 | AddresseeCardViewItem *aItem; |
360 | 360 | ||
361 | for (item = mCardView->firstItem(); item; item = item->nextItem()) | 361 | for (item = mCardView->firstItem(); item; item = item->nextItem()) |
362 | { | 362 | { |
363 | if (item->isSelected()) | 363 | if (item->isSelected()) |
364 | { | 364 | { |
365 | #ifndef KAB_EMBEDDED | 365 | #ifndef KAB_EMBEDDED |
diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp index ef0a23a..fb53215 100644 --- a/kaddressbook/views/kaddressbookiconview.cpp +++ b/kaddressbook/views/kaddressbookiconview.cpp | |||
@@ -243,81 +243,81 @@ void KAddressBookIconView::readConfig(KConfig *config) | |||
243 | if (KABPrefs::instance()->mHonorSingleClick) | 243 | if (KABPrefs::instance()->mHonorSingleClick) |
244 | connect(mIconView, SIGNAL(executed(QIconViewItem *)), | 244 | connect(mIconView, SIGNAL(executed(QIconViewItem *)), |
245 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 245 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
246 | else | 246 | else |
247 | connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)), | 247 | connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)), |
248 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 248 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
249 | */ | 249 | */ |
250 | connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), | 250 | connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), |
251 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 251 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
252 | 252 | ||
253 | } | 253 | } |
254 | void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) | 254 | void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) |
255 | { | 255 | { |
256 | mIconView->clear(); | 256 | mIconView->clear(); |
257 | mIconList.clear(); | 257 | mIconList.clear(); |
258 | if ( s.isEmpty() || s == "*" ) { | 258 | if ( s.isEmpty() || s == "*" ) { |
259 | refresh(); | 259 | refresh(); |
260 | return; | 260 | return; |
261 | } | 261 | } |
262 | QString pattern = s.lower()+"*"; | 262 | QString pattern = s.lower()+"*"; |
263 | QRegExp re; | 263 | QRegExp re; |
264 | re.setWildcard(true); // most people understand these better. | 264 | re.setWildcard(true); // most people understand these better. |
265 | re.setCaseSensitive(false); | 265 | re.setCaseSensitive(false); |
266 | re.setPattern( pattern ); | 266 | re.setPattern( pattern ); |
267 | if (!re.isValid()) | 267 | if (!re.isValid()) |
268 | return; | 268 | return; |
269 | KABC::Addressee::List addresseeList = addressees(); | 269 | KABC::Addressee::List addresseeList = addressees(); |
270 | KABC::Addressee::List::Iterator it; | 270 | KABC::Addressee::List::Iterator it; |
271 | if ( field ) { | 271 | if ( field ) { |
272 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 272 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
273 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 273 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
274 | continue; | 274 | continue; |
275 | #if QT_VERSION >= 300 | 275 | #if QT_VERSION >= 0x030000 |
276 | if (re.search(field->value( *it ).lower()) != -1) | 276 | if (re.search(field->value( *it ).lower()) != -1) |
277 | #else | 277 | #else |
278 | if (re.match(field->value( *it ).lower()) != -1) | 278 | if (re.match(field->value( *it ).lower()) != -1) |
279 | #endif | 279 | #endif |
280 | mIconList.append(new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); | 280 | mIconList.append(new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); |
281 | 281 | ||
282 | 282 | ||
283 | } | 283 | } |
284 | } else { | 284 | } else { |
285 | KABC::Field::List fieldList = allFields(); | 285 | KABC::Field::List fieldList = allFields(); |
286 | KABC::Field::List::ConstIterator fieldIt; | 286 | KABC::Field::List::ConstIterator fieldIt; |
287 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 287 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
288 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 288 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
289 | continue; | 289 | continue; |
290 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 290 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
291 | #if QT_VERSION >= 300 | 291 | #if QT_VERSION >= 0x030000 |
292 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) | 292 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) |
293 | #else | 293 | #else |
294 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) | 294 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) |
295 | #endif | 295 | #endif |
296 | { | 296 | { |
297 | mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); | 297 | mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); |
298 | break; | 298 | break; |
299 | } | 299 | } |
300 | } | 300 | } |
301 | } | 301 | } |
302 | } | 302 | } |
303 | mIconView->arrangeItemsInGrid( true ); | 303 | mIconView->arrangeItemsInGrid( true ); |
304 | if ( mIconView->firstItem() ) { | 304 | if ( mIconView->firstItem() ) { |
305 | mIconView->setCurrentItem ( mIconView->firstItem() ); | 305 | mIconView->setCurrentItem ( mIconView->firstItem() ); |
306 | mIconView->setSelected ( mIconView->firstItem() , true ); | 306 | mIconView->setSelected ( mIconView->firstItem() , true ); |
307 | } | 307 | } |
308 | else | 308 | else |
309 | emit selected(QString::null); | 309 | emit selected(QString::null); |
310 | } | 310 | } |
311 | QStringList KAddressBookIconView::selectedUids() | 311 | QStringList KAddressBookIconView::selectedUids() |
312 | { | 312 | { |
313 | QStringList uidList; | 313 | QStringList uidList; |
314 | QIconViewItem *item; | 314 | QIconViewItem *item; |
315 | AddresseeIconViewItem *aItem; | 315 | AddresseeIconViewItem *aItem; |
316 | 316 | ||
317 | for (item = mIconView->firstItem(); item; item = item->nextItem()) | 317 | for (item = mIconView->firstItem(); item; item = item->nextItem()) |
318 | { | 318 | { |
319 | if (item->isSelected()) | 319 | if (item->isSelected()) |
320 | { | 320 | { |
321 | #ifndef KAB_EMBEDDED | 321 | #ifndef KAB_EMBEDDED |
322 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); | 322 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); |
323 | #else //KAB_EMBEDDED | 323 | #else //KAB_EMBEDDED |
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 7022dcb..69802a4 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp | |||
@@ -127,80 +127,80 @@ void KAddressBookTableView::reconstructListView() | |||
127 | connect(mListView, SIGNAL(signalDelete()), | 127 | connect(mListView, SIGNAL(signalDelete()), |
128 | this, SLOT(addresseeDeleted())); | 128 | this, SLOT(addresseeDeleted())); |
129 | 129 | ||
130 | //US performceimprovement. Refresh is done from the outside | 130 | //US performceimprovement. Refresh is done from the outside |
131 | //US refresh(); | 131 | //US refresh(); |
132 | 132 | ||
133 | mListView->setSorting( 0, true ); | 133 | mListView->setSorting( 0, true ); |
134 | mainLayout->addWidget( mListView ); | 134 | mainLayout->addWidget( mListView ); |
135 | mainLayout->activate(); | 135 | mainLayout->activate(); |
136 | mListView->show(); | 136 | mListView->show(); |
137 | } | 137 | } |
138 | 138 | ||
139 | void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) | 139 | void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) |
140 | { | 140 | { |
141 | mListView->clear(); | 141 | mListView->clear(); |
142 | if ( s.isEmpty() || s == "*" ) { | 142 | if ( s.isEmpty() || s == "*" ) { |
143 | refresh(); | 143 | refresh(); |
144 | return; | 144 | return; |
145 | } | 145 | } |
146 | QString pattern = s.lower()+"*"; | 146 | QString pattern = s.lower()+"*"; |
147 | QRegExp re; | 147 | QRegExp re; |
148 | re.setWildcard(true); // most people understand these better. | 148 | re.setWildcard(true); // most people understand these better. |
149 | re.setCaseSensitive(false); | 149 | re.setCaseSensitive(false); |
150 | re.setPattern( pattern ); | 150 | re.setPattern( pattern ); |
151 | if (!re.isValid()) | 151 | if (!re.isValid()) |
152 | return; | 152 | return; |
153 | KABC::Addressee::List addresseeList = addressees(); | 153 | KABC::Addressee::List addresseeList = addressees(); |
154 | KABC::Addressee::List::Iterator it; | 154 | KABC::Addressee::List::Iterator it; |
155 | if ( field ) { | 155 | if ( field ) { |
156 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 156 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
157 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 157 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
158 | continue; | 158 | continue; |
159 | #if QT_VERSION >= 300 | 159 | #if QT_VERSION >= 0x030000 |
160 | if (re.search(field->value( *it ).lower()) == 0) | 160 | if (re.search(field->value( *it ).lower()) == 0) |
161 | #else | 161 | #else |
162 | if (re.match(field->value( *it ).lower()) != -1) | 162 | if (re.match(field->value( *it ).lower()) != -1) |
163 | #endif | 163 | #endif |
164 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | 164 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); |
165 | 165 | ||
166 | } | 166 | } |
167 | } else { | 167 | } else { |
168 | KABC::Field::List fieldList = allFields(); | 168 | KABC::Field::List fieldList = allFields(); |
169 | KABC::Field::List::ConstIterator fieldIt; | 169 | KABC::Field::List::ConstIterator fieldIt; |
170 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 170 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
171 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 171 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
172 | continue; | 172 | continue; |
173 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 173 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
174 | #if QT_VERSION >= 300 | 174 | #if QT_VERSION >= 0x030000 |
175 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) | 175 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) |
176 | #else | 176 | #else |
177 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) | 177 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) |
178 | #endif | 178 | #endif |
179 | { | 179 | { |
180 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | 180 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); |
181 | break; | 181 | break; |
182 | } | 182 | } |
183 | } | 183 | } |
184 | } | 184 | } |
185 | } | 185 | } |
186 | // Sometimes the background pixmap gets messed up when we add lots | 186 | // Sometimes the background pixmap gets messed up when we add lots |
187 | // of items. | 187 | // of items. |
188 | mListView->repaint(); | 188 | mListView->repaint(); |
189 | if ( mListView->firstChild() ) { | 189 | if ( mListView->firstChild() ) { |
190 | mListView->setCurrentItem ( mListView->firstChild() ); | 190 | mListView->setCurrentItem ( mListView->firstChild() ); |
191 | mListView->setSelected ( mListView->firstChild(), true ); | 191 | mListView->setSelected ( mListView->firstChild(), true ); |
192 | } | 192 | } |
193 | else | 193 | else |
194 | emit selected(QString::null); | 194 | emit selected(QString::null); |
195 | 195 | ||
196 | } | 196 | } |
197 | void KAddressBookTableView::writeConfig(KConfig *config) | 197 | void KAddressBookTableView::writeConfig(KConfig *config) |
198 | { | 198 | { |
199 | KAddressBookView::writeConfig(config); | 199 | KAddressBookView::writeConfig(config); |
200 | 200 | ||
201 | mListView->saveLayout(config, config->group()); | 201 | mListView->saveLayout(config, config->group()); |
202 | } | 202 | } |
203 | 203 | ||
204 | void KAddressBookTableView::readConfig(KConfig *config) | 204 | void KAddressBookTableView::readConfig(KConfig *config) |
205 | { | 205 | { |
206 | KAddressBookView::readConfig( config ); | 206 | KAddressBookView::readConfig( config ); |
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index ead8628..21ecb73 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp | |||
@@ -35,65 +35,65 @@ KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotod | |||
35 | KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) | 35 | KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) |
36 | : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) | 36 | : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) |
37 | { | 37 | { |
38 | construct(); | 38 | construct(); |
39 | } | 39 | } |
40 | 40 | ||
41 | QString KOTodoViewItem::key(int column,bool) const | 41 | QString KOTodoViewItem::key(int column,bool) const |
42 | { | 42 | { |
43 | QMap<int,QString>::ConstIterator it = mKeyMap.find(column); | 43 | QMap<int,QString>::ConstIterator it = mKeyMap.find(column); |
44 | if (it == mKeyMap.end()) { | 44 | if (it == mKeyMap.end()) { |
45 | return text(column).lower(); | 45 | return text(column).lower(); |
46 | } else { | 46 | } else { |
47 | return *it; | 47 | return *it; |
48 | } | 48 | } |
49 | } | 49 | } |
50 | 50 | ||
51 | void KOTodoViewItem:: setup() | 51 | void KOTodoViewItem:: setup() |
52 | { | 52 | { |
53 | 53 | ||
54 | int h = 20; | 54 | int h = 20; |
55 | if ( listView () ) { | 55 | if ( listView () ) { |
56 | QFontMetrics fm ( listView ()->font () ); | 56 | QFontMetrics fm ( listView ()->font () ); |
57 | h = fm.height(); | 57 | h = fm.height(); |
58 | } | 58 | } |
59 | setHeight( h ); | 59 | setHeight( h ); |
60 | 60 | ||
61 | } | 61 | } |
62 | void KOTodoViewItem::setSortKey(int column,const QString &key) | 62 | void KOTodoViewItem::setSortKey(int column,const QString &key) |
63 | { | 63 | { |
64 | mKeyMap.insert(column,key); | 64 | mKeyMap.insert(column,key); |
65 | } | 65 | } |
66 | 66 | ||
67 | #if QT_VERSION >= 300 | 67 | #if QT_VERSION >= 0x030000 |
68 | void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, | 68 | void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, |
69 | int y,int h) | 69 | int y,int h) |
70 | { | 70 | { |
71 | QListViewItem::paintBranches(p,cg,w,y,h); | 71 | QListViewItem::paintBranches(p,cg,w,y,h); |
72 | } | 72 | } |
73 | #else | 73 | #else |
74 | #endif | 74 | #endif |
75 | 75 | ||
76 | void KOTodoViewItem::construct() | 76 | void KOTodoViewItem::construct() |
77 | { | 77 | { |
78 | // qDebug("KOTodoViewItem::construct() "); | 78 | // qDebug("KOTodoViewItem::construct() "); |
79 | m_init = true; | 79 | m_init = true; |
80 | QString keyd = "=="; | 80 | QString keyd = "=="; |
81 | QString keyt = "=="; | 81 | QString keyt = "=="; |
82 | QString skeyd = "=="; | 82 | QString skeyd = "=="; |
83 | QString skeyt = "=="; | 83 | QString skeyt = "=="; |
84 | 84 | ||
85 | setOn(mTodo->isCompleted()); | 85 | setOn(mTodo->isCompleted()); |
86 | setText(0,mTodo->summary()); | 86 | setText(0,mTodo->summary()); |
87 | setText(1,QString::number(mTodo->priority())); | 87 | setText(1,QString::number(mTodo->priority())); |
88 | setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); | 88 | setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); |
89 | if (mTodo->percentComplete()<100) { | 89 | if (mTodo->percentComplete()<100) { |
90 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); | 90 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); |
91 | else setSortKey(2,QString::number(mTodo->percentComplete())); | 91 | else setSortKey(2,QString::number(mTodo->percentComplete())); |
92 | } | 92 | } |
93 | else { | 93 | else { |
94 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); | 94 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); |
95 | else setSortKey(2,QString::number(99)); | 95 | else setSortKey(2,QString::number(99)); |
96 | } | 96 | } |
97 | if (mTodo->hasDueDate()) { | 97 | if (mTodo->hasDueDate()) { |
98 | setText(3, mTodo->dtDueDateStr()); | 98 | setText(3, mTodo->dtDueDateStr()); |
99 | QDate d = mTodo->dtDue().date(); | 99 | QDate d = mTodo->dtDue().date(); |
diff --git a/korganizer/kotodoviewitem.h b/korganizer/kotodoviewitem.h index 74dbe98..bd024c8 100644 --- a/korganizer/kotodoviewitem.h +++ b/korganizer/kotodoviewitem.h | |||
@@ -43,51 +43,51 @@ class KOTodoView; | |||
43 | KTodoView. | 43 | KTodoView. |
44 | 44 | ||
45 | @author Cornelius Schumacher <schumacher@kde.org> | 45 | @author Cornelius Schumacher <schumacher@kde.org> |
46 | @see KOTodoView | 46 | @see KOTodoView |
47 | */ | 47 | */ |
48 | class KOTodoViewItem : public QCheckListItem | 48 | class KOTodoViewItem : public QCheckListItem |
49 | { | 49 | { |
50 | public: | 50 | public: |
51 | /** | 51 | /** |
52 | Constructor. | 52 | Constructor. |
53 | 53 | ||
54 | @param parent is the list view to which this item belongs. | 54 | @param parent is the list view to which this item belongs. |
55 | @param ev is the event to have the item display information for. | 55 | @param ev is the event to have the item display information for. |
56 | */ | 56 | */ |
57 | KOTodoViewItem(QListView *parent, Todo *todo, KOTodoView *kotodo); | 57 | KOTodoViewItem(QListView *parent, Todo *todo, KOTodoView *kotodo); |
58 | KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo); | 58 | KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo); |
59 | //~KOTodoViewItem() { qDebug("~KOTodoViewItem() %s ", text(0).latin1() );} | 59 | //~KOTodoViewItem() { qDebug("~KOTodoViewItem() %s ", text(0).latin1() );} |
60 | 60 | ||
61 | void construct(); | 61 | void construct(); |
62 | 62 | ||
63 | Todo *todo() { return mTodo; } | 63 | Todo *todo() { return mTodo; } |
64 | 64 | ||
65 | QString key(int, bool) const; | 65 | QString key(int, bool) const; |
66 | 66 | ||
67 | void setSortKey(int column,const QString &key); | 67 | void setSortKey(int column,const QString &key); |
68 | 68 | ||
69 | bool isAlternate(); | 69 | bool isAlternate(); |
70 | 70 | ||
71 | virtual void paintCell(QPainter *p, const QColorGroup &cg, | 71 | virtual void paintCell(QPainter *p, const QColorGroup &cg, |
72 | int column, int width, int alignment); | 72 | int column, int width, int alignment); |
73 | virtual void setup(); | 73 | virtual void setup(); |
74 | protected: | 74 | protected: |
75 | #if QT_VERSION >= 300 | 75 | #if QT_VERSION >= 0x030000 |
76 | void paintBranches(QPainter *p,const QColorGroup & cg,int w,int y,int h); | 76 | void paintBranches(QPainter *p,const QColorGroup & cg,int w,int y,int h); |
77 | #else | 77 | #else |
78 | #endif | 78 | #endif |
79 | virtual void stateChange(bool); | 79 | virtual void stateChange(bool); |
80 | void setMyPixmap(); | 80 | void setMyPixmap(); |
81 | 81 | ||
82 | private: | 82 | private: |
83 | Todo *mTodo; | 83 | Todo *mTodo; |
84 | KOTodoView *mTodoView; | 84 | KOTodoView *mTodoView; |
85 | 85 | ||
86 | QMap<int,QString> mKeyMap; | 86 | QMap<int,QString> mKeyMap; |
87 | uint m_odd : 1; | 87 | uint m_odd : 1; |
88 | uint m_known : 1; | 88 | uint m_known : 1; |
89 | uint m_unused : 30; | 89 | uint m_unused : 30; |
90 | bool m_init; | 90 | bool m_init; |
91 | }; | 91 | }; |
92 | 92 | ||
93 | #endif | 93 | #endif |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index f6b7718..e255b83 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -546,43 +546,43 @@ void KOViewManager::showTimeSpanView() | |||
546 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), | 546 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), |
547 | "KOViewManager::TimeSpanView"); | 547 | "KOViewManager::TimeSpanView"); |
548 | addView(mTimeSpanView); | 548 | addView(mTimeSpanView); |
549 | 549 | ||
550 | mTimeSpanView->readSettings(); | 550 | mTimeSpanView->readSettings(); |
551 | } | 551 | } |
552 | 552 | ||
553 | showView(mTimeSpanView); | 553 | showView(mTimeSpanView); |
554 | } | 554 | } |
555 | 555 | ||
556 | Incidence *KOViewManager::currentSelection() | 556 | Incidence *KOViewManager::currentSelection() |
557 | { | 557 | { |
558 | if (!mCurrentView) return 0; | 558 | if (!mCurrentView) return 0; |
559 | if ( mCurrentView == mListView ) { | 559 | if ( mCurrentView == mListView ) { |
560 | if ( mListView->currentItem() ) | 560 | if ( mListView->currentItem() ) |
561 | return mListView->currentItem(); | 561 | return mListView->currentItem(); |
562 | } | 562 | } |
563 | return mCurrentView->selectedIncidences().first(); | 563 | return mCurrentView->selectedIncidences().first(); |
564 | } | 564 | } |
565 | 565 | ||
566 | QDate KOViewManager::currentSelectionDate() | 566 | QDate KOViewManager::currentSelectionDate() |
567 | { | 567 | { |
568 | QDate qd; | 568 | QDate qd; |
569 | if (mCurrentView) { | 569 | if (mCurrentView) { |
570 | DateList qvl = mCurrentView->selectedDates(); | 570 | DateList qvl = mCurrentView->selectedDates(); |
571 | if (!qvl.isEmpty()) qd = qvl.first(); | 571 | if (!qvl.isEmpty()) qd = qvl.first(); |
572 | } | 572 | } |
573 | return qd; | 573 | return qd; |
574 | } | 574 | } |
575 | 575 | ||
576 | void KOViewManager::addView(KOrg::BaseView *view) | 576 | void KOViewManager::addView(KOrg::BaseView *view) |
577 | { | 577 | { |
578 | #if QT_VERSION >= 300 | 578 | #if QT_VERSION >= 0x030000 |
579 | mMainView->viewStack()->addWidget( view ); | 579 | mMainView->viewStack()->addWidget( view ); |
580 | #else | 580 | #else |
581 | mMainView->viewStack()->addWidget( view, 1 ); | 581 | mMainView->viewStack()->addWidget( view, 1 ); |
582 | #endif | 582 | #endif |
583 | } | 583 | } |
584 | 584 | ||
585 | void KOViewManager::setDocumentId( const QString &id ) | 585 | void KOViewManager::setDocumentId( const QString &id ) |
586 | { | 586 | { |
587 | if (mTodoView) mTodoView->setDocumentId( id ); | 587 | if (mTodoView) mTodoView->setDocumentId( id ); |
588 | } | 588 | } |
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 72ee1d2..39966b5 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -205,193 +205,193 @@ void SearchDialog::updateConfig() | |||
205 | } | 205 | } |
206 | void SearchDialog::updateView() | 206 | void SearchDialog::updateView() |
207 | { | 207 | { |
208 | 208 | ||
209 | QRegExp re; | 209 | QRegExp re; |
210 | re.setWildcard(true); // most people understand these better. | 210 | re.setWildcard(true); // most people understand these better. |
211 | re.setCaseSensitive(false); | 211 | re.setCaseSensitive(false); |
212 | re.setPattern(searchEdit->text()); | 212 | re.setPattern(searchEdit->text()); |
213 | if (re.isValid()) { | 213 | if (re.isValid()) { |
214 | search(re); | 214 | search(re); |
215 | } else { | 215 | } else { |
216 | mMatchedEvents.clear(); | 216 | mMatchedEvents.clear(); |
217 | mMatchedTodos.clear(); | 217 | mMatchedTodos.clear(); |
218 | mMatchedJournals.clear(); | 218 | mMatchedJournals.clear(); |
219 | } | 219 | } |
220 | listView->setStartDate( mStartDate->date() ); | 220 | listView->setStartDate( mStartDate->date() ); |
221 | listView->showEvents(mMatchedEvents); | 221 | listView->showEvents(mMatchedEvents); |
222 | listView->addTodos(mMatchedTodos); | 222 | listView->addTodos(mMatchedTodos); |
223 | listView->addJournals(mMatchedJournals); | 223 | listView->addJournals(mMatchedJournals); |
224 | } | 224 | } |
225 | 225 | ||
226 | void SearchDialog::search(const QRegExp &re) | 226 | void SearchDialog::search(const QRegExp &re) |
227 | { | 227 | { |
228 | QPtrList<Event> events = mCalendar->events( mStartDate->date(), | 228 | QPtrList<Event> events = mCalendar->events( mStartDate->date(), |
229 | mEndDate->date(), | 229 | mEndDate->date(), |
230 | false /*mInclusiveCheck->isChecked()*/ ); | 230 | false /*mInclusiveCheck->isChecked()*/ ); |
231 | 231 | ||
232 | mMatchedEvents.clear(); | 232 | mMatchedEvents.clear(); |
233 | if ( mSearchEvent->isChecked() ) { | 233 | if ( mSearchEvent->isChecked() ) { |
234 | Event *ev; | 234 | Event *ev; |
235 | for(ev=events.first();ev;ev=events.next()) { | 235 | for(ev=events.first();ev;ev=events.next()) { |
236 | if (mSummaryCheck->isChecked()) { | 236 | if (mSummaryCheck->isChecked()) { |
237 | #if QT_VERSION >= 300 | 237 | #if QT_VERSION >= 0x030000 |
238 | if (re.search(ev->summary()) != -1) | 238 | if (re.search(ev->summary()) != -1) |
239 | #else | 239 | #else |
240 | if (re.match(ev->summary()) != -1) | 240 | if (re.match(ev->summary()) != -1) |
241 | #endif | 241 | #endif |
242 | { | 242 | { |
243 | mMatchedEvents.append(ev); | 243 | mMatchedEvents.append(ev); |
244 | continue; | 244 | continue; |
245 | } | 245 | } |
246 | } | 246 | } |
247 | if (mDescriptionCheck->isChecked()) { | 247 | if (mDescriptionCheck->isChecked()) { |
248 | #if QT_VERSION >= 300 | 248 | #if QT_VERSION >= 0x030000 |
249 | if (re.search(ev->description()) != -1) | 249 | if (re.search(ev->description()) != -1) |
250 | #else | 250 | #else |
251 | if (re.match(ev->description()) != -1) | 251 | if (re.match(ev->description()) != -1) |
252 | #endif | 252 | #endif |
253 | { | 253 | { |
254 | mMatchedEvents.append(ev); | 254 | mMatchedEvents.append(ev); |
255 | continue; | 255 | continue; |
256 | } | 256 | } |
257 | } | 257 | } |
258 | if (mCategoryCheck->isChecked()) { | 258 | if (mCategoryCheck->isChecked()) { |
259 | #if QT_VERSION >= 300 | 259 | #if QT_VERSION >= 0x030000 |
260 | if (re.search(ev->categoriesStr()) != -1) | 260 | if (re.search(ev->categoriesStr()) != -1) |
261 | #else | 261 | #else |
262 | if (re.match(ev->categoriesStr()) != -1) | 262 | if (re.match(ev->categoriesStr()) != -1) |
263 | #endif | 263 | #endif |
264 | { | 264 | { |
265 | mMatchedEvents.append(ev); | 265 | mMatchedEvents.append(ev); |
266 | continue; | 266 | continue; |
267 | } | 267 | } |
268 | } | 268 | } |
269 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { | 269 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { |
270 | QPtrList<Attendee> tmpAList = ev->attendees(); | 270 | QPtrList<Attendee> tmpAList = ev->attendees(); |
271 | Attendee *a; | 271 | Attendee *a; |
272 | for (a = tmpAList.first(); a; a = tmpAList.next()) { | 272 | for (a = tmpAList.first(); a; a = tmpAList.next()) { |
273 | if (mSearchAName->isChecked()) { | 273 | if (mSearchAName->isChecked()) { |
274 | #if QT_VERSION >= 300 | 274 | #if QT_VERSION >= 0x030000 |
275 | if (re.search(a->name()) != -1) | 275 | if (re.search(a->name()) != -1) |
276 | #else | 276 | #else |
277 | if (re.match(a->name()) != -1) | 277 | if (re.match(a->name()) != -1) |
278 | #endif | 278 | #endif |
279 | { | 279 | { |
280 | mMatchedEvents.append(ev); | 280 | mMatchedEvents.append(ev); |
281 | break; | 281 | break; |
282 | } | 282 | } |
283 | } | 283 | } |
284 | if (mSearchAEmail->isChecked()) { | 284 | if (mSearchAEmail->isChecked()) { |
285 | #if QT_VERSION >= 300 | 285 | #if QT_VERSION >= 0x030000 |
286 | if (re.search(a->email()) != -1) | 286 | if (re.search(a->email()) != -1) |
287 | #else | 287 | #else |
288 | if (re.match(a->email()) != -1) | 288 | if (re.match(a->email()) != -1) |
289 | #endif | 289 | #endif |
290 | { | 290 | { |
291 | mMatchedEvents.append(ev); | 291 | mMatchedEvents.append(ev); |
292 | break; | 292 | break; |
293 | } | 293 | } |
294 | } | 294 | } |
295 | } | 295 | } |
296 | } | 296 | } |
297 | } | 297 | } |
298 | } | 298 | } |
299 | QPtrList<Todo> todos = mCalendar->todos( ); | 299 | QPtrList<Todo> todos = mCalendar->todos( ); |
300 | mMatchedTodos.clear(); | 300 | mMatchedTodos.clear(); |
301 | if ( mSearchTodo->isChecked() ) { | 301 | if ( mSearchTodo->isChecked() ) { |
302 | Todo *tod; | 302 | Todo *tod; |
303 | for(tod=todos.first();tod;tod=todos.next()) { | 303 | for(tod=todos.first();tod;tod=todos.next()) { |
304 | if (mSummaryCheck->isChecked()) { | 304 | if (mSummaryCheck->isChecked()) { |
305 | #if QT_VERSION >= 300 | 305 | #if QT_VERSION >= 0x030000 |
306 | if (re.search(tod->summary()) != -1) | 306 | if (re.search(tod->summary()) != -1) |
307 | #else | 307 | #else |
308 | if (re.match(tod->summary()) != -1) | 308 | if (re.match(tod->summary()) != -1) |
309 | #endif | 309 | #endif |
310 | { | 310 | { |
311 | mMatchedTodos.append(tod); | 311 | mMatchedTodos.append(tod); |
312 | continue; | 312 | continue; |
313 | } | 313 | } |
314 | } | 314 | } |
315 | if (mDescriptionCheck->isChecked()) { | 315 | if (mDescriptionCheck->isChecked()) { |
316 | #if QT_VERSION >= 300 | 316 | #if QT_VERSION >= 0x030000 |
317 | if (re.search(tod->description()) != -1) | 317 | if (re.search(tod->description()) != -1) |
318 | #else | 318 | #else |
319 | if (re.match(tod->description()) != -1) | 319 | if (re.match(tod->description()) != -1) |
320 | #endif | 320 | #endif |
321 | { | 321 | { |
322 | mMatchedTodos.append(tod); | 322 | mMatchedTodos.append(tod); |
323 | continue; | 323 | continue; |
324 | } | 324 | } |
325 | } | 325 | } |
326 | if (mCategoryCheck->isChecked()) { | 326 | if (mCategoryCheck->isChecked()) { |
327 | #if QT_VERSION >= 300 | 327 | #if QT_VERSION >= 0x030000 |
328 | if (re.search(tod->categoriesStr()) != -1) | 328 | if (re.search(tod->categoriesStr()) != -1) |
329 | #else | 329 | #else |
330 | if (re.match(tod->categoriesStr()) != -1) | 330 | if (re.match(tod->categoriesStr()) != -1) |
331 | #endif | 331 | #endif |
332 | { | 332 | { |
333 | mMatchedTodos.append(tod); | 333 | mMatchedTodos.append(tod); |
334 | continue; | 334 | continue; |
335 | } | 335 | } |
336 | } | 336 | } |
337 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { | 337 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { |
338 | QPtrList<Attendee> tmpAList = tod->attendees(); | 338 | QPtrList<Attendee> tmpAList = tod->attendees(); |
339 | Attendee *a; | 339 | Attendee *a; |
340 | for (a = tmpAList.first(); a; a = tmpAList.next()) { | 340 | for (a = tmpAList.first(); a; a = tmpAList.next()) { |
341 | if (mSearchAName->isChecked()) { | 341 | if (mSearchAName->isChecked()) { |
342 | #if QT_VERSION >= 300 | 342 | #if QT_VERSION >= 0x030000 |
343 | if (re.search(a->name()) != -1) | 343 | if (re.search(a->name()) != -1) |
344 | #else | 344 | #else |
345 | if (re.match(a->name()) != -1) | 345 | if (re.match(a->name()) != -1) |
346 | #endif | 346 | #endif |
347 | { | 347 | { |
348 | mMatchedTodos.append(tod); | 348 | mMatchedTodos.append(tod); |
349 | break; | 349 | break; |
350 | } | 350 | } |
351 | } | 351 | } |
352 | if (mSearchAEmail->isChecked()) { | 352 | if (mSearchAEmail->isChecked()) { |
353 | #if QT_VERSION >= 300 | 353 | #if QT_VERSION >= 0x030000 |
354 | if (re.search(a->email()) != -1) | 354 | if (re.search(a->email()) != -1) |
355 | #else | 355 | #else |
356 | if (re.match(a->email()) != -1) | 356 | if (re.match(a->email()) != -1) |
357 | #endif | 357 | #endif |
358 | { | 358 | { |
359 | mMatchedTodos.append(tod); | 359 | mMatchedTodos.append(tod); |
360 | break; | 360 | break; |
361 | } | 361 | } |
362 | } | 362 | } |
363 | } | 363 | } |
364 | } | 364 | } |
365 | } | 365 | } |
366 | } | 366 | } |
367 | mMatchedJournals.clear(); | 367 | mMatchedJournals.clear(); |
368 | if (mSearchJournal->isChecked() ) { | 368 | if (mSearchJournal->isChecked() ) { |
369 | QPtrList<Journal> journals = mCalendar->journals( ); | 369 | QPtrList<Journal> journals = mCalendar->journals( ); |
370 | Journal* journ; | 370 | Journal* journ; |
371 | 371 | ||
372 | for(journ=journals.first();journ;journ=journals.next()) { | 372 | for(journ=journals.first();journ;journ=journals.next()) { |
373 | if ( journ->dtStart().date() <= mEndDate->date() | 373 | if ( journ->dtStart().date() <= mEndDate->date() |
374 | &&journ->dtStart().date() >= mStartDate->date()) { | 374 | &&journ->dtStart().date() >= mStartDate->date()) { |
375 | #if QT_VERSION >= 300 | 375 | #if QT_VERSION >= 0x030000 |
376 | if (re.search(journ->description()) != -1) | 376 | if (re.search(journ->description()) != -1) |
377 | #else | 377 | #else |
378 | if (re.match(journ->description()) != -1) | 378 | if (re.match(journ->description()) != -1) |
379 | #endif | 379 | #endif |
380 | { | 380 | { |
381 | mMatchedJournals.append(journ); | 381 | mMatchedJournals.append(journ); |
382 | continue; | 382 | continue; |
383 | } | 383 | } |
384 | } | 384 | } |
385 | } | 385 | } |
386 | } | 386 | } |
387 | 387 | ||
388 | } | 388 | } |
389 | /* | 389 | /* |
390 | void SearchDialog::keyPressEvent ( QKeyEvent *e) | 390 | void SearchDialog::keyPressEvent ( QKeyEvent *e) |
391 | { | 391 | { |
392 | 392 | ||
393 | e->ignore(); | 393 | e->ignore(); |
394 | 394 | ||
395 | } | 395 | } |
396 | */ | 396 | */ |
397 | //mMatchedJournals; | 397 | //mMatchedJournals; |
diff --git a/korganizer/timespanview.cpp b/korganizer/timespanview.cpp index 67a3811..df8ff88 100644 --- a/korganizer/timespanview.cpp +++ b/korganizer/timespanview.cpp | |||
@@ -76,65 +76,65 @@ void TimeSpanView::setSplitterSizes( QValueList<int> sizes ) | |||
76 | 76 | ||
77 | void TimeSpanView::addItem( KCal::Event *event ) | 77 | void TimeSpanView::addItem( KCal::Event *event ) |
78 | { | 78 | { |
79 | new QListViewItem( mList, event->summary() ); | 79 | new QListViewItem( mList, event->summary() ); |
80 | 80 | ||
81 | QDateTime startDt = event->dtStart(); | 81 | QDateTime startDt = event->dtStart(); |
82 | QDateTime endDt = event->dtEnd(); | 82 | QDateTime endDt = event->dtEnd(); |
83 | 83 | ||
84 | // kdDebug() << "TimeSpanView::addItem(): start: " << startDt.toString() | 84 | // kdDebug() << "TimeSpanView::addItem(): start: " << startDt.toString() |
85 | // << " end: " << endDt.toString() << endl; | 85 | // << " end: " << endDt.toString() << endl; |
86 | 86 | ||
87 | int startSecs = mStartDate.secsTo( startDt ); | 87 | int startSecs = mStartDate.secsTo( startDt ); |
88 | int durationSecs = startDt.secsTo( endDt ); | 88 | int durationSecs = startDt.secsTo( endDt ); |
89 | 89 | ||
90 | // kdDebug() << "--- startSecs: " << startSecs << " dur: " << durationSecs << endl; | 90 | // kdDebug() << "--- startSecs: " << startSecs << " dur: " << durationSecs << endl; |
91 | 91 | ||
92 | int startX = mStartDate.secsTo( startDt ) / mSecsPerPixel; | 92 | int startX = mStartDate.secsTo( startDt ) / mSecsPerPixel; |
93 | int endX = startX + startDt.secsTo( endDt ) / mSecsPerPixel; | 93 | int endX = startX + startDt.secsTo( endDt ) / mSecsPerPixel; |
94 | 94 | ||
95 | // kdDebug() << "TimeSpanView::addItem(): s: " << startX << " e: " << endX << endl; | 95 | // kdDebug() << "TimeSpanView::addItem(): s: " << startX << " e: " << endX << endl; |
96 | 96 | ||
97 | mLineView->addLine( startX, endX ); | 97 | mLineView->addLine( startX, endX ); |
98 | } | 98 | } |
99 | 99 | ||
100 | void TimeSpanView::clear() | 100 | void TimeSpanView::clear() |
101 | { | 101 | { |
102 | mList->clear(); | 102 | mList->clear(); |
103 | mLineView->clear(); | 103 | mLineView->clear(); |
104 | } | 104 | } |
105 | 105 | ||
106 | void TimeSpanView::updateView() | 106 | void TimeSpanView::updateView() |
107 | { | 107 | { |
108 | #if QT_VERSION >= 300 | 108 | #if QT_VERSION >= 0x030000 |
109 | mLineView->updateContents(); | 109 | mLineView->updateContents(); |
110 | mTimeLine->updateContents(); | 110 | mTimeLine->updateContents(); |
111 | #else | 111 | #else |
112 | #endif | 112 | #endif |
113 | } | 113 | } |
114 | 114 | ||
115 | void TimeSpanView::setDateRange( const QDateTime &start, const QDateTime &end ) | 115 | void TimeSpanView::setDateRange( const QDateTime &start, const QDateTime &end ) |
116 | { | 116 | { |
117 | mStartDate = start; | 117 | mStartDate = start; |
118 | mEndDate = end; | 118 | mEndDate = end; |
119 | 119 | ||
120 | mTimeLine->setDateRange( start, end ); | 120 | mTimeLine->setDateRange( start, end ); |
121 | 121 | ||
122 | mSecsPerPixel = mStartDate.secsTo( mEndDate ) / mLineView->pixelWidth(); | 122 | mSecsPerPixel = mStartDate.secsTo( mEndDate ) / mLineView->pixelWidth(); |
123 | } | 123 | } |
124 | 124 | ||
125 | QDateTime TimeSpanView::startDateTime() | 125 | QDateTime TimeSpanView::startDateTime() |
126 | { | 126 | { |
127 | return mStartDate; | 127 | return mStartDate; |
128 | } | 128 | } |
129 | 129 | ||
130 | QDateTime TimeSpanView::endDateTime() | 130 | QDateTime TimeSpanView::endDateTime() |
131 | { | 131 | { |
132 | return mEndDate; | 132 | return mEndDate; |
133 | } | 133 | } |
134 | 134 | ||
135 | void TimeSpanView::zoomIn() | 135 | void TimeSpanView::zoomIn() |
136 | { | 136 | { |
137 | int span = mStartDate.daysTo( mEndDate ); | 137 | int span = mStartDate.daysTo( mEndDate ); |
138 | setDateRange( mStartDate.addDays( span / 4 ), mEndDate.addDays( span / -4 ) ); | 138 | setDateRange( mStartDate.addDays( span / 4 ), mEndDate.addDays( span / -4 ) ); |
139 | 139 | ||
140 | emit dateRangeChanged(); | 140 | emit dateRangeChanged(); |
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index c23978d..bd13132 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp | |||
@@ -174,69 +174,65 @@ icalcomponent *ICalFormatImpl::writeEvent(Event *event) | |||
174 | #if 0 | 174 | #if 0 |
175 | // attachments | 175 | // attachments |
176 | tmpStrList = anEvent->attachments(); | 176 | tmpStrList = anEvent->attachments(); |
177 | for ( QStringList::Iterator it = tmpStrList.begin(); | 177 | for ( QStringList::Iterator it = tmpStrList.begin(); |
178 | it != tmpStrList.end(); | 178 | it != tmpStrList.end(); |
179 | ++it ) | 179 | ++it ) |
180 | addPropValue(vevent, VCAttachProp, (*it).utf8()); | 180 | addPropValue(vevent, VCAttachProp, (*it).utf8()); |
181 | 181 | ||
182 | // resources | 182 | // resources |
183 | tmpStrList = anEvent->resources(); | 183 | tmpStrList = anEvent->resources(); |
184 | tmpStr = tmpStrList.join(";"); | 184 | tmpStr = tmpStrList.join(";"); |
185 | if (!tmpStr.isEmpty()) | 185 | if (!tmpStr.isEmpty()) |
186 | addPropValue(vevent, VCResourcesProp, tmpStr.utf8()); | 186 | addPropValue(vevent, VCResourcesProp, tmpStr.utf8()); |
187 | 187 | ||
188 | #endif | 188 | #endif |
189 | 189 | ||
190 | // Transparency | 190 | // Transparency |
191 | switch( event->transparency() ) { | 191 | switch( event->transparency() ) { |
192 | case Event::Transparent: | 192 | case Event::Transparent: |
193 | icalcomponent_add_property(vevent, icalproperty_new_transp(ICAL_TRANSP_TRANSPARENT)); | 193 | icalcomponent_add_property(vevent, icalproperty_new_transp(ICAL_TRANSP_TRANSPARENT)); |
194 | break; | 194 | break; |
195 | case Event::Opaque: | 195 | case Event::Opaque: |
196 | icalcomponent_add_property(vevent, icalproperty_new_transp(ICAL_TRANSP_OPAQUE)); | 196 | icalcomponent_add_property(vevent, icalproperty_new_transp(ICAL_TRANSP_OPAQUE)); |
197 | break; | 197 | break; |
198 | } | 198 | } |
199 | 199 | ||
200 | return vevent; | 200 | return vevent; |
201 | } | 201 | } |
202 | 202 | ||
203 | icalcomponent *ICalFormatImpl::writeFreeBusy(FreeBusy *freebusy, | 203 | icalcomponent *ICalFormatImpl::writeFreeBusy(FreeBusy *freebusy, |
204 | Scheduler::Method method) | 204 | Scheduler::Method method) |
205 | { | 205 | { |
206 | #if QT_VERSION >= 300 | 206 | |
207 | kdDebug(5800) << "icalformatimpl: writeFreeBusy: startDate: " | ||
208 | << freebusy->dtStart().toString("ddd MMMM d yyyy: h:m:s ap") << " End Date: " | ||
209 | << freebusy->dtEnd().toString("ddd MMMM d yyyy: h:m:s ap") << endl; | ||
210 | #endif | ||
211 | 207 | ||
212 | icalcomponent *vfreebusy = icalcomponent_new(ICAL_VFREEBUSY_COMPONENT); | 208 | icalcomponent *vfreebusy = icalcomponent_new(ICAL_VFREEBUSY_COMPONENT); |
213 | 209 | ||
214 | writeIncidenceBase(vfreebusy,freebusy); | 210 | writeIncidenceBase(vfreebusy,freebusy); |
215 | 211 | ||
216 | icalcomponent_add_property(vfreebusy, icalproperty_new_dtstart( | 212 | icalcomponent_add_property(vfreebusy, icalproperty_new_dtstart( |
217 | writeICalDateTime(freebusy->dtStart()))); | 213 | writeICalDateTime(freebusy->dtStart()))); |
218 | 214 | ||
219 | icalcomponent_add_property(vfreebusy, icalproperty_new_dtend( | 215 | icalcomponent_add_property(vfreebusy, icalproperty_new_dtend( |
220 | writeICalDateTime(freebusy->dtEnd()))); | 216 | writeICalDateTime(freebusy->dtEnd()))); |
221 | 217 | ||
222 | if (method == Scheduler::Request) { | 218 | if (method == Scheduler::Request) { |
223 | icalcomponent_add_property(vfreebusy,icalproperty_new_uid( | 219 | icalcomponent_add_property(vfreebusy,icalproperty_new_uid( |
224 | freebusy->uid().utf8())); | 220 | freebusy->uid().utf8())); |
225 | } | 221 | } |
226 | 222 | ||
227 | //Loops through all the periods in the freebusy object | 223 | //Loops through all the periods in the freebusy object |
228 | QValueList<Period> list = freebusy->busyPeriods(); | 224 | QValueList<Period> list = freebusy->busyPeriods(); |
229 | QValueList<Period>::Iterator it; | 225 | QValueList<Period>::Iterator it; |
230 | icalperiodtype period; | 226 | icalperiodtype period; |
231 | for (it = list.begin(); it!= list.end(); ++it) { | 227 | for (it = list.begin(); it!= list.end(); ++it) { |
232 | period.start = writeICalDateTime((*it).start()); | 228 | period.start = writeICalDateTime((*it).start()); |
233 | period.end = writeICalDateTime((*it).end()); | 229 | period.end = writeICalDateTime((*it).end()); |
234 | icalcomponent_add_property(vfreebusy, icalproperty_new_freebusy(period) ); | 230 | icalcomponent_add_property(vfreebusy, icalproperty_new_freebusy(period) ); |
235 | } | 231 | } |
236 | 232 | ||
237 | return vfreebusy; | 233 | return vfreebusy; |
238 | } | 234 | } |
239 | 235 | ||
240 | icalcomponent *ICalFormatImpl::writeJournal(Journal *journal) | 236 | icalcomponent *ICalFormatImpl::writeJournal(Journal *journal) |
241 | { | 237 | { |
242 | icalcomponent *vjournal = icalcomponent_new(ICAL_VJOURNAL_COMPONENT); | 238 | icalcomponent *vjournal = icalcomponent_new(ICAL_VJOURNAL_COMPONENT); |
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index 60b8bc7..567ae54 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp | |||
@@ -7,66 +7,66 @@ | |||
7 | ** | 7 | ** |
8 | ** This file is part of the KDGantt library. | 8 | ** This file is part of the KDGantt library. |
9 | ** | 9 | ** |
10 | ** This file may be distributed and/or modified under the terms of the | 10 | ** This file may be distributed and/or modified under the terms of the |
11 | ** GNU General Public License version 2 as published by the Free Software | 11 | ** GNU General Public License version 2 as published by the Free Software |
12 | ** Foundation and appearing in the file LICENSE.GPL included in the | 12 | ** Foundation and appearing in the file LICENSE.GPL included in the |
13 | ** packaging of this file. | 13 | ** packaging of this file. |
14 | ** | 14 | ** |
15 | ** Licensees holding valid commercial KDGantt licenses may use this file in | 15 | ** Licensees holding valid commercial KDGantt licenses may use this file in |
16 | ** accordance with the KDGantt Commercial License Agreement provided with | 16 | ** accordance with the KDGantt Commercial License Agreement provided with |
17 | ** the Software. | 17 | ** the Software. |
18 | ** | 18 | ** |
19 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 19 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
20 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 20 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
21 | ** | 21 | ** |
22 | ** See http://www.klaralvdalens-datakonsult.se/Public/products/ for | 22 | ** See http://www.klaralvdalens-datakonsult.se/Public/products/ for |
23 | ** information about KDGantt Commercial License Agreements. | 23 | ** information about KDGantt Commercial License Agreements. |
24 | ** | 24 | ** |
25 | ** Contact info@klaralvdalens-datakonsult.se if any conditions of this | 25 | ** Contact info@klaralvdalens-datakonsult.se if any conditions of this |
26 | ** licensing are not clear to you. | 26 | ** licensing are not clear to you. |
27 | ** | 27 | ** |
28 | ** As a special exception, permission is given to link this program | 28 | ** As a special exception, permission is given to link this program |
29 | ** with any edition of Qt, and distribute the resulting executable, | 29 | ** with any edition of Qt, and distribute the resulting executable, |
30 | ** without including the source code for Qt in the source distribution. | 30 | ** without including the source code for Qt in the source distribution. |
31 | ** | 31 | ** |
32 | **********************************************************************/ | 32 | **********************************************************************/ |
33 | 33 | ||
34 | #include "KDGanttMinimizeSplitter.h" | 34 | #include "KDGanttMinimizeSplitter.h" |
35 | #ifndef QT_NO_SPLITTER___ | 35 | #ifndef QT_NO_SPLITTER___ |
36 | 36 | ||
37 | #include "qpainter.h" | 37 | #include "qpainter.h" |
38 | #include "qdrawutil.h" | 38 | #include "qdrawutil.h" |
39 | #include "qbitmap.h" | 39 | #include "qbitmap.h" |
40 | #if QT_VERSION >= 300 | 40 | #if QT_VERSION >= 0x030000 |
41 | #include "qptrlist.h" | 41 | #include "qptrlist.h" |
42 | #include "qmemarray.h" | 42 | #include "qmemarray.h" |
43 | #else | 43 | #else |
44 | #include <qlist.h> | 44 | #include <qlist.h> |
45 | #include <qarray.h> | 45 | #include <qarray.h> |
46 | #define QPtrList QList | 46 | #define QPtrList QList |
47 | #define QMemArray QArray | 47 | #define QMemArray QArray |
48 | #endif | 48 | #endif |
49 | #include "qlayoutengine_p.h" | 49 | #include "qlayoutengine_p.h" |
50 | #include "qobjectlist.h" | 50 | #include "qobjectlist.h" |
51 | #include "qstyle.h" | 51 | #include "qstyle.h" |
52 | #include "qapplication.h" //sendPostedEvents | 52 | #include "qapplication.h" //sendPostedEvents |
53 | #include <qvaluelist.h> | 53 | #include <qvaluelist.h> |
54 | #include <qcursor.h> | 54 | #include <qcursor.h> |
55 | #ifndef KDGANTT_MASTER_CVS | 55 | #ifndef KDGANTT_MASTER_CVS |
56 | //#include "KDGanttMinimizeSplitter.moc" | 56 | //#include "KDGanttMinimizeSplitter.moc" |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | 59 | ||
60 | 60 | ||
61 | #ifndef DOXYGEN_SKIP_INTERNAL | 61 | #ifndef DOXYGEN_SKIP_INTERNAL |
62 | 62 | ||
63 | #if QT_VERSION >= 232 | 63 | #if QT_VERSION >= 232 |
64 | static int mouseOffset; | 64 | static int mouseOffset; |
65 | static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky | 65 | static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky |
66 | 66 | ||
67 | 67 | ||
68 | KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, | 68 | KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, |
69 | KDGanttMinimizeSplitter *parent, const char * name ) | 69 | KDGanttMinimizeSplitter *parent, const char * name ) |
70 | : QWidget( parent, name ), _activeButton( 0 ), _collapsed( false ) | 70 | : QWidget( parent, name ), _activeButton( 0 ), _collapsed( false ) |
71 | { | 71 | { |
72 | 72 | ||
@@ -598,65 +598,65 @@ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) | |||
598 | while ( s ) { | 598 | while ( s ) { |
599 | if ( s->wid == c->child() ) { | 599 | if ( s->wid == c->child() ) { |
600 | data->list.removeRef( s ); | 600 | data->list.removeRef( s ); |
601 | delete s; | 601 | delete s; |
602 | if ( p && p->isSplitter ) { | 602 | if ( p && p->isSplitter ) { |
603 | data->list.removeRef( p ); | 603 | data->list.removeRef( p ); |
604 | delete p->wid; //will call childEvent | 604 | delete p->wid; //will call childEvent |
605 | delete p; | 605 | delete p; |
606 | } | 606 | } |
607 | recalcId(); | 607 | recalcId(); |
608 | doResize(); | 608 | doResize(); |
609 | return; | 609 | return; |
610 | } | 610 | } |
611 | p = s; | 611 | p = s; |
612 | s = data->list.next(); | 612 | s = data->list.next(); |
613 | } | 613 | } |
614 | } | 614 | } |
615 | } | 615 | } |
616 | 616 | ||
617 | 617 | ||
618 | /*! | 618 | /*! |
619 | Shows a rubber band at position \a p. If \a p is negative, the | 619 | Shows a rubber band at position \a p. If \a p is negative, the |
620 | rubber band is removed. | 620 | rubber band is removed. |
621 | */ | 621 | */ |
622 | void KDGanttMinimizeSplitter::setRubberband( int p ) | 622 | void KDGanttMinimizeSplitter::setRubberband( int p ) |
623 | { | 623 | { |
624 | QPainter paint( this ); | 624 | QPainter paint( this ); |
625 | paint.setPen( gray ); | 625 | paint.setPen( gray ); |
626 | paint.setBrush( gray ); | 626 | paint.setBrush( gray ); |
627 | paint.setRasterOp( XorROP ); | 627 | paint.setRasterOp( XorROP ); |
628 | QRect r = contentsRect(); | 628 | QRect r = contentsRect(); |
629 | const int rBord = 3; //Themable???? | 629 | const int rBord = 3; //Themable???? |
630 | #if QT_VERSION >= 300 | 630 | #if QT_VERSION >= 0x030000 |
631 | int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); | 631 | int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); |
632 | #else | 632 | #else |
633 | int sw = style().splitterWidth(); | 633 | int sw = style().splitterWidth(); |
634 | #endif | 634 | #endif |
635 | if ( orient == Horizontal ) { | 635 | if ( orient == Horizontal ) { |
636 | if ( opaqueOldPos >= 0 ) | 636 | if ( opaqueOldPos >= 0 ) |
637 | paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(), | 637 | paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(), |
638 | 2*rBord, r.height() ); | 638 | 2*rBord, r.height() ); |
639 | if ( p >= 0 ) | 639 | if ( p >= 0 ) |
640 | paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() ); | 640 | paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() ); |
641 | } else { | 641 | } else { |
642 | if ( opaqueOldPos >= 0 ) | 642 | if ( opaqueOldPos >= 0 ) |
643 | paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord, | 643 | paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord, |
644 | r.width(), 2*rBord ); | 644 | r.width(), 2*rBord ); |
645 | if ( p >= 0 ) | 645 | if ( p >= 0 ) |
646 | paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord ); | 646 | paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord ); |
647 | } | 647 | } |
648 | opaqueOldPos = p; | 648 | opaqueOldPos = p; |
649 | } | 649 | } |
650 | 650 | ||
651 | 651 | ||
652 | /*! \reimp */ | 652 | /*! \reimp */ |
653 | bool KDGanttMinimizeSplitter::event( QEvent *e ) | 653 | bool KDGanttMinimizeSplitter::event( QEvent *e ) |
654 | { | 654 | { |
655 | if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) { | 655 | if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) { |
656 | recalc( isVisible() ); | 656 | recalc( isVisible() ); |
657 | if ( e->type() == QEvent::Show ) | 657 | if ( e->type() == QEvent::Show ) |
658 | data->firstShow = FALSE; | 658 | data->firstShow = FALSE; |
659 | } | 659 | } |
660 | return QWidget::event( e ); | 660 | return QWidget::event( e ); |
661 | } | 661 | } |
662 | 662 | ||
@@ -880,65 +880,65 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max ) | |||
880 | int minA = 0; | 880 | int minA = 0; |
881 | int maxA = 0;//after | 881 | int maxA = 0;//after |
882 | int n = data->list.count(); | 882 | int n = data->list.count(); |
883 | if ( id < 0 || id >= n ) | 883 | if ( id < 0 || id >= n ) |
884 | return; | 884 | return; |
885 | int i; | 885 | int i; |
886 | for ( i = 0; i < id; i++ ) { | 886 | for ( i = 0; i < id; i++ ) { |
887 | QSplitterLayoutStruct *s = data->list.at(i); | 887 | QSplitterLayoutStruct *s = data->list.at(i); |
888 | if ( s->wid->isHidden() ) { | 888 | if ( s->wid->isHidden() ) { |
889 | //ignore | 889 | //ignore |
890 | } else if ( s->isSplitter ) { | 890 | } else if ( s->isSplitter ) { |
891 | minB += s->sizer; | 891 | minB += s->sizer; |
892 | maxB += s->sizer; | 892 | maxB += s->sizer; |
893 | } else { | 893 | } else { |
894 | minB += pick( minSize(s->wid) ); | 894 | minB += pick( minSize(s->wid) ); |
895 | maxB += pick( s->wid->maximumSize() ); | 895 | maxB += pick( s->wid->maximumSize() ); |
896 | } | 896 | } |
897 | } | 897 | } |
898 | for ( i = id; i < n; i++ ) { | 898 | for ( i = id; i < n; i++ ) { |
899 | QSplitterLayoutStruct *s = data->list.at(i); | 899 | QSplitterLayoutStruct *s = data->list.at(i); |
900 | if ( s->wid->isHidden() ) { | 900 | if ( s->wid->isHidden() ) { |
901 | //ignore | 901 | //ignore |
902 | } else if ( s->isSplitter ) { | 902 | } else if ( s->isSplitter ) { |
903 | minA += s->sizer; | 903 | minA += s->sizer; |
904 | maxA += s->sizer; | 904 | maxA += s->sizer; |
905 | } else { | 905 | } else { |
906 | minA += pick( minSize(s->wid) ); | 906 | minA += pick( minSize(s->wid) ); |
907 | maxA += pick( s->wid->maximumSize() ); | 907 | maxA += pick( s->wid->maximumSize() ); |
908 | } | 908 | } |
909 | } | 909 | } |
910 | QRect r = contentsRect(); | 910 | QRect r = contentsRect(); |
911 | if ( orient == Horizontal && false ) { | 911 | if ( orient == Horizontal && false ) { |
912 | #if QT_VERSION >= 300 | 912 | #if QT_VERSION >= 0x030000 |
913 | int splitterWidth = style().pixelMetric(QStyle::PM_SplitterWidth, this); | 913 | int splitterWidth = style().pixelMetric(QStyle::PM_SplitterWidth, this); |
914 | #else | 914 | #else |
915 | int splitterWidth = style().splitterWidth(); | 915 | int splitterWidth = style().splitterWidth(); |
916 | #endif | 916 | #endif |
917 | 917 | ||
918 | if ( min ) | 918 | if ( min ) |
919 | *min = pick(r.topRight()) - QMIN( maxB, pick(r.size())-minA ) - splitterWidth; | 919 | *min = pick(r.topRight()) - QMIN( maxB, pick(r.size())-minA ) - splitterWidth; |
920 | if ( max ) | 920 | if ( max ) |
921 | *max = pick(r.topRight()) - QMAX( minB, pick(r.size())-maxA ) - splitterWidth; | 921 | *max = pick(r.topRight()) - QMAX( minB, pick(r.size())-maxA ) - splitterWidth; |
922 | } else { | 922 | } else { |
923 | if ( min ) | 923 | if ( min ) |
924 | *min = pick(r.topLeft()) + QMAX( minB, pick(r.size())-maxA ); | 924 | *min = pick(r.topLeft()) + QMAX( minB, pick(r.size())-maxA ); |
925 | if ( max ) | 925 | if ( max ) |
926 | *max = pick(r.topLeft()) + QMIN( maxB, pick(r.size())-minA ); | 926 | *max = pick(r.topLeft()) + QMIN( maxB, pick(r.size())-minA ); |
927 | } | 927 | } |
928 | } | 928 | } |
929 | 929 | ||
930 | 930 | ||
931 | /*! | 931 | /*! |
932 | Returns the closest legal position to \a p of the splitter with id \a id. | 932 | Returns the closest legal position to \a p of the splitter with id \a id. |
933 | 933 | ||
934 | \sa idAfter() | 934 | \sa idAfter() |
935 | */ | 935 | */ |
936 | 936 | ||
937 | int KDGanttMinimizeSplitter::adjustPos( int p, int id ) | 937 | int KDGanttMinimizeSplitter::adjustPos( int p, int id ) |
938 | { | 938 | { |
939 | int min = 0; | 939 | int min = 0; |
940 | int max = 0; | 940 | int max = 0; |
941 | getRange( id, &min, &max ); | 941 | getRange( id, &min, &max ); |
942 | p = QMAX( min, QMIN( p, max ) ); | 942 | p = QMAX( min, QMIN( p, max ) ); |
943 | 943 | ||
944 | return p; | 944 | return p; |
@@ -1358,65 +1358,65 @@ void KDGanttMinimizeSplitter::setSizes( QValueList<int> list ) | |||
1358 | processChildEvents(); | 1358 | processChildEvents(); |
1359 | QValueList<int>::Iterator it = list.begin(); | 1359 | QValueList<int>::Iterator it = list.begin(); |
1360 | QSplitterLayoutStruct *s = data->list.first(); | 1360 | QSplitterLayoutStruct *s = data->list.first(); |
1361 | while ( s && it != list.end() ) { | 1361 | while ( s && it != list.end() ) { |
1362 | if ( !s->isSplitter ) { | 1362 | if ( !s->isSplitter ) { |
1363 | s->sizer = *it; | 1363 | s->sizer = *it; |
1364 | ++it; | 1364 | ++it; |
1365 | } | 1365 | } |
1366 | s = data->list.next(); | 1366 | s = data->list.next(); |
1367 | } | 1367 | } |
1368 | doResize(); | 1368 | doResize(); |
1369 | } | 1369 | } |
1370 | 1370 | ||
1371 | 1371 | ||
1372 | /*! | 1372 | /*! |
1373 | Gets all posted child events, ensuring that the internal state of | 1373 | Gets all posted child events, ensuring that the internal state of |
1374 | the splitter is consistent. | 1374 | the splitter is consistent. |
1375 | */ | 1375 | */ |
1376 | 1376 | ||
1377 | void KDGanttMinimizeSplitter::processChildEvents() | 1377 | void KDGanttMinimizeSplitter::processChildEvents() |
1378 | { | 1378 | { |
1379 | QApplication::sendPostedEvents( this, QEvent::ChildInserted ); | 1379 | QApplication::sendPostedEvents( this, QEvent::ChildInserted ); |
1380 | } | 1380 | } |
1381 | 1381 | ||
1382 | 1382 | ||
1383 | /*! | 1383 | /*! |
1384 | \reimp | 1384 | \reimp |
1385 | */ | 1385 | */ |
1386 | 1386 | ||
1387 | void KDGanttMinimizeSplitter::styleChange( QStyle& old ) | 1387 | void KDGanttMinimizeSplitter::styleChange( QStyle& old ) |
1388 | { | 1388 | { |
1389 | 1389 | ||
1390 | #if QT_VERSION >= 300 | 1390 | #if QT_VERSION >= 0x030000 |
1391 | int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); | 1391 | int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); |
1392 | #else | 1392 | #else |
1393 | int sw = style().splitterWidth(); | 1393 | int sw = style().splitterWidth(); |
1394 | #endif | 1394 | #endif |
1395 | QSplitterLayoutStruct *s = data->list.first(); | 1395 | QSplitterLayoutStruct *s = data->list.first(); |
1396 | while ( s ) { | 1396 | while ( s ) { |
1397 | if ( s->isSplitter ) | 1397 | if ( s->isSplitter ) |
1398 | s->sizer = sw; | 1398 | s->sizer = sw; |
1399 | s = data->list.next(); | 1399 | s = data->list.next(); |
1400 | } | 1400 | } |
1401 | doResize(); | 1401 | doResize(); |
1402 | QFrame::styleChange( old ); | 1402 | QFrame::styleChange( old ); |
1403 | } | 1403 | } |
1404 | 1404 | ||
1405 | #endif | 1405 | #endif |
1406 | 1406 | ||
1407 | /*! | 1407 | /*! |
1408 | Specifies the direction of the minimize buttons. | 1408 | Specifies the direction of the minimize buttons. |
1409 | If the orientation of the splitter is horizontal then with | 1409 | If the orientation of the splitter is horizontal then with |
1410 | KDGanttMinimizeSplitter::Left or KDGanttMinimizeSplitter::Right should be used, | 1410 | KDGanttMinimizeSplitter::Left or KDGanttMinimizeSplitter::Right should be used, |
1411 | otherwise either KDGanttMinimizeSplitter::Up or KDGanttMinimizeSplitter::Down | 1411 | otherwise either KDGanttMinimizeSplitter::Up or KDGanttMinimizeSplitter::Down |
1412 | should be used. | 1412 | should be used. |
1413 | */ | 1413 | */ |
1414 | void KDGanttMinimizeSplitter::setMinimizeDirection( Direction direction ) | 1414 | void KDGanttMinimizeSplitter::setMinimizeDirection( Direction direction ) |
1415 | { | 1415 | { |
1416 | _direction = direction; | 1416 | _direction = direction; |
1417 | } | 1417 | } |
1418 | 1418 | ||
1419 | /*! | 1419 | /*! |
1420 | Returns the direction of the minimize buttons. | 1420 | Returns the direction of the minimize buttons. |
1421 | */ | 1421 | */ |
1422 | KDGanttMinimizeSplitter::Direction KDGanttMinimizeSplitter::minimizeDirection() const | 1422 | KDGanttMinimizeSplitter::Direction KDGanttMinimizeSplitter::minimizeDirection() const |
diff --git a/microkde/kcalendarsystemgregorian.cpp b/microkde/kcalendarsystemgregorian.cpp index 7c5b62a..cc12b9f 100644 --- a/microkde/kcalendarsystemgregorian.cpp +++ b/microkde/kcalendarsystemgregorian.cpp | |||
@@ -25,83 +25,83 @@ | |||
25 | #include <qstring.h> | 25 | #include <qstring.h> |
26 | 26 | ||
27 | #include <klocale.h> | 27 | #include <klocale.h> |
28 | #include <kdebug.h> | 28 | #include <kdebug.h> |
29 | 29 | ||
30 | #include "kcalendarsystemgregorian.h" | 30 | #include "kcalendarsystemgregorian.h" |
31 | 31 | ||
32 | KCalendarSystemGregorian::KCalendarSystemGregorian(const KLocale * locale) | 32 | KCalendarSystemGregorian::KCalendarSystemGregorian(const KLocale * locale) |
33 | : KCalendarSystem(locale) | 33 | : KCalendarSystem(locale) |
34 | { | 34 | { |
35 | kdDebug(5400) << "Created gregorian calendar" << endl; | 35 | kdDebug(5400) << "Created gregorian calendar" << endl; |
36 | } | 36 | } |
37 | 37 | ||
38 | KCalendarSystemGregorian::~KCalendarSystemGregorian() | 38 | KCalendarSystemGregorian::~KCalendarSystemGregorian() |
39 | { | 39 | { |
40 | } | 40 | } |
41 | 41 | ||
42 | int KCalendarSystemGregorian::year(const QDate& date) const | 42 | int KCalendarSystemGregorian::year(const QDate& date) const |
43 | { | 43 | { |
44 | // kdDebug(5400) << "Gregorian year..." << endl; | 44 | // kdDebug(5400) << "Gregorian year..." << endl; |
45 | return date.year(); | 45 | return date.year(); |
46 | } | 46 | } |
47 | 47 | ||
48 | int KCalendarSystemGregorian::monthsInYear( const QDate & ) const | 48 | int KCalendarSystemGregorian::monthsInYear( const QDate & ) const |
49 | { | 49 | { |
50 | // kdDebug(5400) << "Gregorian monthsInYear" << endl; | 50 | // kdDebug(5400) << "Gregorian monthsInYear" << endl; |
51 | 51 | ||
52 | return 12; | 52 | return 12; |
53 | } | 53 | } |
54 | 54 | ||
55 | int KCalendarSystemGregorian::weeksInYear(int year) const | 55 | int KCalendarSystemGregorian::weeksInYear(int year) const |
56 | { | 56 | { |
57 | #if QT_VERSION >= 300 | 57 | #if QT_VERSION >= 0x030000 |
58 | QDate temp; | 58 | QDate temp; |
59 | temp.setYMD(year, 12, 31); | 59 | temp.setYMD(year, 12, 31); |
60 | 60 | ||
61 | // If the last day of the year is in the first week, we have to check the | 61 | // If the last day of the year is in the first week, we have to check the |
62 | // week before | 62 | // week before |
63 | if ( temp.weekNumber() == 1 ) | 63 | if ( temp.weekNumber() == 1 ) |
64 | temp.addDays(-7); | 64 | temp.addDays(-7); |
65 | 65 | ||
66 | return temp.weekNumber(); | 66 | return temp.weekNumber(); |
67 | #else | 67 | #else |
68 | return 52; | 68 | return 52; |
69 | #endif | 69 | #endif |
70 | } | 70 | } |
71 | 71 | ||
72 | int KCalendarSystemGregorian::weekNumber(const QDate& date, | 72 | int KCalendarSystemGregorian::weekNumber(const QDate& date, |
73 | int * yearNum) const | 73 | int * yearNum) const |
74 | { | 74 | { |
75 | #if QT_VERSION >= 300 | 75 | #if QT_VERSION >= 0x030000 |
76 | return date.weekNumber(yearNum); | 76 | return date.weekNumber(yearNum); |
77 | #else | 77 | #else |
78 | return 1; | 78 | return 1; |
79 | #endif | 79 | #endif |
80 | } | 80 | } |
81 | 81 | ||
82 | QString KCalendarSystemGregorian::monthName(const QDate& date, | 82 | QString KCalendarSystemGregorian::monthName(const QDate& date, |
83 | bool shortName) const | 83 | bool shortName) const |
84 | { | 84 | { |
85 | return monthName(month(date), shortName); | 85 | return monthName(month(date), shortName); |
86 | } | 86 | } |
87 | 87 | ||
88 | QString KCalendarSystemGregorian::monthNamePossessive(const QDate& date, bool shortName) const | 88 | QString KCalendarSystemGregorian::monthNamePossessive(const QDate& date, bool shortName) const |
89 | { | 89 | { |
90 | return monthNamePossessive(month(date), shortName); | 90 | return monthNamePossessive(month(date), shortName); |
91 | } | 91 | } |
92 | 92 | ||
93 | QString KCalendarSystemGregorian::monthName(int month, bool shortName) const | 93 | QString KCalendarSystemGregorian::monthName(int month, bool shortName) const |
94 | { | 94 | { |
95 | // kdDebug(5400) << "Gregorian getMonthName" << endl; | 95 | // kdDebug(5400) << "Gregorian getMonthName" << endl; |
96 | 96 | ||
97 | if ( shortName ) | 97 | if ( shortName ) |
98 | switch ( month ) | 98 | switch ( month ) |
99 | { | 99 | { |
100 | case 1: | 100 | case 1: |
101 | return locale()->translate("January", "Jan"); | 101 | return locale()->translate("January", "Jan"); |
102 | case 2: | 102 | case 2: |
103 | return locale()->translate("February", "Feb"); | 103 | return locale()->translate("February", "Feb"); |
104 | case 3: | 104 | case 3: |
105 | return locale()->translate("March", "Mar"); | 105 | return locale()->translate("March", "Mar"); |
106 | case 4: | 106 | case 4: |
107 | return locale()->translate("April", "Apr"); | 107 | return locale()->translate("April", "Apr"); |
@@ -202,79 +202,79 @@ QString KCalendarSystemGregorian::monthNamePossessive(int month, | |||
202 | return locale()->translate("of May long", "of May"); | 202 | return locale()->translate("of May long", "of May"); |
203 | case 6: | 203 | case 6: |
204 | return locale()->translate("of June"); | 204 | return locale()->translate("of June"); |
205 | case 7: | 205 | case 7: |
206 | return locale()->translate("of July"); | 206 | return locale()->translate("of July"); |
207 | case 8: | 207 | case 8: |
208 | return locale()->translate("of August"); | 208 | return locale()->translate("of August"); |
209 | case 9: | 209 | case 9: |
210 | return locale()->translate("of September"); | 210 | return locale()->translate("of September"); |
211 | case 10: | 211 | case 10: |
212 | return locale()->translate("of October"); | 212 | return locale()->translate("of October"); |
213 | case 11: | 213 | case 11: |
214 | return locale()->translate("of November"); | 214 | return locale()->translate("of November"); |
215 | case 12: | 215 | case 12: |
216 | return locale()->translate("of December"); | 216 | return locale()->translate("of December"); |
217 | } | 217 | } |
218 | 218 | ||
219 | return QString::null; | 219 | return QString::null; |
220 | } | 220 | } |
221 | 221 | ||
222 | bool KCalendarSystemGregorian::setYMD(QDate & date, int y, int m, int d) const | 222 | bool KCalendarSystemGregorian::setYMD(QDate & date, int y, int m, int d) const |
223 | { | 223 | { |
224 | // We don't want Qt to add 1900 to them | 224 | // We don't want Qt to add 1900 to them |
225 | if ( y >= 0 && y <= 99 ) | 225 | if ( y >= 0 && y <= 99 ) |
226 | return false; | 226 | return false; |
227 | 227 | ||
228 | // QDate supports gregorian internally | 228 | // QDate supports gregorian internally |
229 | return date.setYMD(y, m, d); | 229 | return date.setYMD(y, m, d); |
230 | } | 230 | } |
231 | 231 | ||
232 | QDate KCalendarSystemGregorian::addYears(const QDate & date, int nyears) const | 232 | QDate KCalendarSystemGregorian::addYears(const QDate & date, int nyears) const |
233 | { | 233 | { |
234 | #if QT_VERSION >= 300 | 234 | #if QT_VERSION >= 0x030000 |
235 | return date.addYears(nyears); | 235 | return date.addYears(nyears); |
236 | #else | 236 | #else |
237 | int year = date.year() + nyears; | 237 | int year = date.year() + nyears; |
238 | int month = date.month(); | 238 | int month = date.month(); |
239 | int day = date.day(); | 239 | int day = date.day(); |
240 | QDate newDate( year, month, 1 ); | 240 | QDate newDate( year, month, 1 ); |
241 | if ( day > newDate.daysInMonth() ) day = newDate.daysInMonth(); | 241 | if ( day > newDate.daysInMonth() ) day = newDate.daysInMonth(); |
242 | return QDate( year, month, day ); | 242 | return QDate( year, month, day ); |
243 | #endif | 243 | #endif |
244 | } | 244 | } |
245 | 245 | ||
246 | QDate KCalendarSystemGregorian::addMonths(const QDate & date, int nmonths) const | 246 | QDate KCalendarSystemGregorian::addMonths(const QDate & date, int nmonths) const |
247 | { | 247 | { |
248 | #if QT_VERSION >= 300 | 248 | #if QT_VERSION >= 0x030000 |
249 | return date.addMonths(nmonths); | 249 | return date.addMonths(nmonths); |
250 | #else | 250 | #else |
251 | int month = date.month(); | 251 | int month = date.month(); |
252 | int nyears; | 252 | int nyears; |
253 | if ( nmonths >= 0 ) { | 253 | if ( nmonths >= 0 ) { |
254 | month += nmonths; | 254 | month += nmonths; |
255 | nyears = ( month - 1 ) / 12; | 255 | nyears = ( month - 1 ) / 12; |
256 | month = ( ( month - 1 ) % 12 ) + 1; | 256 | month = ( ( month - 1 ) % 12 ) + 1; |
257 | } else { | 257 | } else { |
258 | nyears = nmonths / 12; | 258 | nyears = nmonths / 12; |
259 | // nmonths += nyears * 12; | 259 | // nmonths += nyears * 12; |
260 | nmonths = nmonths % 12; | 260 | nmonths = nmonths % 12; |
261 | month += nmonths; | 261 | month += nmonths; |
262 | if ( month <= 0 ) { | 262 | if ( month <= 0 ) { |
263 | month += 12; | 263 | month += 12; |
264 | --nyears; | 264 | --nyears; |
265 | } | 265 | } |
266 | } | 266 | } |
267 | int year = date.year() + nyears; | 267 | int year = date.year() + nyears; |
268 | int day = date.day(); | 268 | int day = date.day(); |
269 | QDate newDate( year, month, 1 ); | 269 | QDate newDate( year, month, 1 ); |
270 | if ( day > newDate.daysInMonth() ) day = newDate.daysInMonth(); | 270 | if ( day > newDate.daysInMonth() ) day = newDate.daysInMonth(); |
271 | return QDate( year, month, day ); | 271 | return QDate( year, month, day ); |
272 | #endif | 272 | #endif |
273 | } | 273 | } |
274 | 274 | ||
275 | QDate KCalendarSystemGregorian::addDays(const QDate & date, int ndays) const | 275 | QDate KCalendarSystemGregorian::addDays(const QDate & date, int ndays) const |
276 | { | 276 | { |
277 | return date.addDays(ndays); | 277 | return date.addDays(ndays); |
278 | } | 278 | } |
279 | 279 | ||
280 | QString KCalendarSystemGregorian::weekDayName(int col, bool shortName) const | 280 | QString KCalendarSystemGregorian::weekDayName(int col, bool shortName) const |