author | zautrix <zautrix> | 2004-11-06 14:30:14 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-11-06 14:30:14 (UTC) |
commit | f8841c92d5251f713eb7a025af8fdee52de45b3d (patch) (unidiff) | |
tree | 29c3c48e5da5b5ce05126da46475de1a0a845428 /korganizer | |
parent | 71eeea80d9c449bd1983c1a9207c7123e919b55f (diff) | |
download | kdepimpi-f8841c92d5251f713eb7a025af8fdee52de45b3d.zip kdepimpi-f8841c92d5251f713eb7a025af8fdee52de45b3d.tar.gz kdepimpi-f8841c92d5251f713eb7a025af8fdee52de45b3d.tar.bz2 |
category utf8 fixes
-rw-r--r-- | korganizer/calendarview.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index f8d752a..2321087 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2242,129 +2242,130 @@ void CalendarView::removeCategories() | |||
2242 | { | 2242 | { |
2243 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2243 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2244 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2244 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2245 | QStringList catIncList; | 2245 | QStringList catIncList; |
2246 | QStringList newCatList; | 2246 | QStringList newCatList; |
2247 | Incidence* inc = incList.first(); | 2247 | Incidence* inc = incList.first(); |
2248 | int i; | 2248 | int i; |
2249 | int count = 0; | 2249 | int count = 0; |
2250 | while ( inc ) { | 2250 | while ( inc ) { |
2251 | newCatList.clear(); | 2251 | newCatList.clear(); |
2252 | catIncList = inc->categories() ; | 2252 | catIncList = inc->categories() ; |
2253 | for( i = 0; i< catIncList.count(); ++i ) { | 2253 | for( i = 0; i< catIncList.count(); ++i ) { |
2254 | if ( catList.contains (catIncList[i])) | 2254 | if ( catList.contains (catIncList[i])) |
2255 | newCatList.append( catIncList[i] ); | 2255 | newCatList.append( catIncList[i] ); |
2256 | } | 2256 | } |
2257 | newCatList.sort(); | 2257 | newCatList.sort(); |
2258 | inc->setCategories( newCatList.join(",") ); | 2258 | inc->setCategories( newCatList.join(",") ); |
2259 | inc = incList.next(); | 2259 | inc = incList.next(); |
2260 | } | 2260 | } |
2261 | } | 2261 | } |
2262 | 2262 | ||
2263 | int CalendarView::addCategories() | 2263 | int CalendarView::addCategories() |
2264 | { | 2264 | { |
2265 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2265 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2266 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2266 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2267 | QStringList catIncList; | 2267 | QStringList catIncList; |
2268 | Incidence* inc = incList.first(); | 2268 | Incidence* inc = incList.first(); |
2269 | int i; | 2269 | int i; |
2270 | int count = 0; | 2270 | int count = 0; |
2271 | while ( inc ) { | 2271 | while ( inc ) { |
2272 | catIncList = inc->categories() ; | 2272 | catIncList = inc->categories() ; |
2273 | for( i = 0; i< catIncList.count(); ++i ) { | 2273 | for( i = 0; i< catIncList.count(); ++i ) { |
2274 | if ( !catList.contains (catIncList[i])) { | 2274 | if ( !catList.contains (catIncList[i])) { |
2275 | catList.append( catIncList[i] ); | 2275 | catList.append( catIncList[i] ); |
2276 | //qDebug("add cat %s ", catIncList[i].latin1()); | 2276 | //qDebug("add cat %s ", catIncList[i].latin1()); |
2277 | ++count; | 2277 | ++count; |
2278 | } | 2278 | } |
2279 | } | 2279 | } |
2280 | inc = incList.next(); | 2280 | inc = incList.next(); |
2281 | } | 2281 | } |
2282 | catList.sort(); | 2282 | catList.sort(); |
2283 | KOPrefs::instance()->mCustomCategories = catList; | 2283 | KOPrefs::instance()->mCustomCategories = catList; |
2284 | return count; | 2284 | return count; |
2285 | } | 2285 | } |
2286 | 2286 | ||
2287 | void CalendarView::manageCategories() | 2287 | void CalendarView::manageCategories() |
2288 | { | 2288 | { |
2289 | KOCatPrefs* cp = new KOCatPrefs(); | 2289 | KOCatPrefs* cp = new KOCatPrefs(); |
2290 | cp->show(); | 2290 | cp->show(); |
2291 | int w =cp->sizeHint().width() ; | 2291 | int w =cp->sizeHint().width() ; |
2292 | int h = cp->sizeHint().height() ; | 2292 | int h = cp->sizeHint().height() ; |
2293 | int dw = QApplication::desktop()->width(); | 2293 | int dw = QApplication::desktop()->width(); |
2294 | int dh = QApplication::desktop()->height(); | 2294 | int dh = QApplication::desktop()->height(); |
2295 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2295 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2296 | if ( !cp->exec() ) { | 2296 | if ( !cp->exec() ) { |
2297 | delete cp; | 2297 | delete cp; |
2298 | return; | 2298 | return; |
2299 | } | 2299 | } |
2300 | int count = 0; | 2300 | int count = 0; |
2301 | if ( cp->addCat() ) { | 2301 | if ( cp->addCat() ) { |
2302 | count = addCategories(); | 2302 | count = addCategories(); |
2303 | if ( count ) { | 2303 | if ( count ) { |
2304 | topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); | 2304 | topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); |
2305 | writeSettings(); | 2305 | writeSettings(); |
2306 | } | 2306 | } else |
2307 | topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); | ||
2307 | } else { | 2308 | } else { |
2308 | removeCategories(); | 2309 | removeCategories(); |
2309 | updateView(); | 2310 | updateView(); |
2310 | } | 2311 | } |
2311 | delete cp; | 2312 | delete cp; |
2312 | } | 2313 | } |
2313 | 2314 | ||
2314 | void CalendarView::beamIncidence(Incidence * Inc) | 2315 | void CalendarView::beamIncidence(Incidence * Inc) |
2315 | { | 2316 | { |
2316 | QPtrList<Incidence> delSel ; | 2317 | QPtrList<Incidence> delSel ; |
2317 | delSel.append(Inc); | 2318 | delSel.append(Inc); |
2318 | beamIncidenceList( delSel ); | 2319 | beamIncidenceList( delSel ); |
2319 | } | 2320 | } |
2320 | void CalendarView::beamCalendar() | 2321 | void CalendarView::beamCalendar() |
2321 | { | 2322 | { |
2322 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); | 2323 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); |
2323 | //qDebug("beamCalendar() "); | 2324 | //qDebug("beamCalendar() "); |
2324 | beamIncidenceList( delSel ); | 2325 | beamIncidenceList( delSel ); |
2325 | } | 2326 | } |
2326 | void CalendarView::beamFilteredCalendar() | 2327 | void CalendarView::beamFilteredCalendar() |
2327 | { | 2328 | { |
2328 | QPtrList<Incidence> delSel = mCalendar->incidences(); | 2329 | QPtrList<Incidence> delSel = mCalendar->incidences(); |
2329 | //qDebug("beamFilteredCalendar() "); | 2330 | //qDebug("beamFilteredCalendar() "); |
2330 | beamIncidenceList( delSel ); | 2331 | beamIncidenceList( delSel ); |
2331 | } | 2332 | } |
2332 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) | 2333 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) |
2333 | { | 2334 | { |
2334 | if ( beamDialog->exec () == QDialog::Rejected ) | 2335 | if ( beamDialog->exec () == QDialog::Rejected ) |
2335 | return; | 2336 | return; |
2336 | #ifdef DESKTOP_VERSION | 2337 | #ifdef DESKTOP_VERSION |
2337 | QString fn = locateLocal( "tmp", "kopibeamfile" ); | 2338 | QString fn = locateLocal( "tmp", "kopibeamfile" ); |
2338 | #else | 2339 | #else |
2339 | QString fn = "/tmp/kopibeamfile"; | 2340 | QString fn = "/tmp/kopibeamfile"; |
2340 | #endif | 2341 | #endif |
2341 | QString mes; | 2342 | QString mes; |
2342 | bool createbup = true; | 2343 | bool createbup = true; |
2343 | if ( createbup ) { | 2344 | if ( createbup ) { |
2344 | QString description = "\n"; | 2345 | QString description = "\n"; |
2345 | CalendarLocal* cal = new CalendarLocal(); | 2346 | CalendarLocal* cal = new CalendarLocal(); |
2346 | if ( beamDialog->beamLocal() ) | 2347 | if ( beamDialog->beamLocal() ) |
2347 | cal->setLocalTime(); | 2348 | cal->setLocalTime(); |
2348 | else | 2349 | else |
2349 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2350 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2350 | Incidence *incidence = delSel.first(); | 2351 | Incidence *incidence = delSel.first(); |
2351 | bool addText = false; | 2352 | bool addText = false; |
2352 | if ( delSel.count() < 10 ) | 2353 | if ( delSel.count() < 10 ) |
2353 | addText = true; | 2354 | addText = true; |
2354 | else { | 2355 | else { |
2355 | description.sprintf(i18n(" %d items?"),delSel.count() ); | 2356 | description.sprintf(i18n(" %d items?"),delSel.count() ); |
2356 | } | 2357 | } |
2357 | while ( incidence ) { | 2358 | while ( incidence ) { |
2358 | Incidence *in = incidence->clone(); | 2359 | Incidence *in = incidence->clone(); |
2359 | if ( ! in->summary().isEmpty() ) { | 2360 | if ( ! in->summary().isEmpty() ) { |
2360 | in->setDescription(""); | 2361 | in->setDescription(""); |
2361 | } else { | 2362 | } else { |
2362 | in->setSummary( in->description().left(20)); | 2363 | in->setSummary( in->description().left(20)); |
2363 | in->setDescription(""); | 2364 | in->setDescription(""); |
2364 | } | 2365 | } |
2365 | if ( addText ) | 2366 | if ( addText ) |
2366 | description += in->summary() + "\n"; | 2367 | description += in->summary() + "\n"; |
2367 | cal->addIncidence( in ); | 2368 | cal->addIncidence( in ); |
2368 | incidence = delSel.next(); | 2369 | incidence = delSel.next(); |
2369 | } | 2370 | } |
2370 | if ( beamDialog->beamVcal() ) { | 2371 | if ( beamDialog->beamVcal() ) { |