commit kdepimlibs4 for openSUSE:Factory
Hello community, here is the log from the commit of package kdepimlibs4 for openSUSE:Factory checked in at Tue Sep 1 21:44:21 CEST 2009. -------- --- KDE/kdepimlibs4/kdepimlibs4.changes 2009-08-26 16:10:16.000000000 +0200 +++ kdepimlibs4/kdepimlibs4.changes 2009-08-28 14:00:28.000000000 +0200 @@ -1,0 +2,6 @@ +Fri Aug 28 14:00:22 CEST 2009 - dmueller@suse.de + +- update to 4.3.1 + * see http://kde.org/announcements/changelogs/changelog4_3_0to4_3_1.php for details + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- kdepimlibs-4.3.0.tar.bz2 New: ---- kdepimlibs-4.3.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdepimlibs4.spec ++++++ --- /var/tmp/diff_new_pack.hWGIGw/_old 2009-09-01 21:43:41.000000000 +0200 +++ /var/tmp/diff_new_pack.hWGIGw/_new 2009-09-01 21:43:41.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package kdepimlibs4 (Version 4.3.0) +# spec file for package kdepimlibs4 (Version 4.3.1) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -23,8 +23,8 @@ Group: System/GUI/KDE Summary: KDE PIM Libraries Url: http://www.kde.org -Version: 4.3.0 -Release: 2 +Version: 4.3.1 +Release: 1 Source0: kdepimlibs-%version.tar.bz2 Patch0: 4_3_BRANCH.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -85,29 +85,29 @@ %files -n libkdepimlibs4 %defattr(-,root,root) %doc COPYING COPYING.BSD COPYING.LIB -%_libdir/libkabc.so.* -%_libdir/libkabc_file_core.so.* -%_libdir/libkcal.so.* -%_libdir/libkldap.so.* -%_libdir/libkmime.so.* -%_libdir/libkresources.so.* -%_libdir/libktnef.so.* -%_libdir/libkxmlrpcclient.so.* -%_libdir/libsyndication.so.* -%_libdir/libkimap.so.* -%_libdir/libkblog.so.* -%_libdir/libkpimutils.so.* -%_libdir/libmailtransport.so.* -%_libdir/libgpgme++.so.* -%_libdir/libgpgme++-pthread.so.* +%_kde4_libdir/libkabc.so.* +%_kde4_libdir/libkabc_file_core.so.* +%_kde4_libdir/libkcal.so.* +%_kde4_libdir/libkldap.so.* +%_kde4_libdir/libkmime.so.* +%_kde4_libdir/libkresources.so.* +%_kde4_libdir/libktnef.so.* +%_kde4_libdir/libkxmlrpcclient.so.* +%_kde4_libdir/libsyndication.so.* +%_kde4_libdir/libkimap.so.* +%_kde4_libdir/libkblog.so.* +%_kde4_libdir/libkpimutils.so.* +%_kde4_libdir/libmailtransport.so.* +%_kde4_libdir/libgpgme++.so.* +%_kde4_libdir/libgpgme++-pthread.so.* %if %suse_version > 1020 -%_libdir/libgpgme++-pth.so.* +%_kde4_libdir/libgpgme++-pth.so.* %endif -%_libdir/libkpimidentities.so.* -%_libdir/libqgpgme.so.* -%_libdir/libkholidays.so.* -%_libdir/libmicroblog.so.* -%_libdir/libkpimtextedit.so.* +%_kde4_libdir/libkpimidentities.so.* +%_kde4_libdir/libqgpgme.so.* +%_kde4_libdir/libkholidays.so.* +%_kde4_libdir/libmicroblog.so.* +%_kde4_libdir/libkpimtextedit.so.* %package -n libakonadi4 License: LGPL v2.1 or later @@ -133,9 +133,9 @@ %files -n libakonadi4 %defattr(-,root,root) %doc COPYING COPYING.LIB -%_libdir/libakonadi-kde.so* -%_libdir/libakonadi-kmime.so* -%_libdir/libakonadi-kabc.so* +%_kde4_libdir/libakonadi-kde.so* +%_kde4_libdir/libakonadi-kmime.so* +%_kde4_libdir/libakonadi-kabc.so* %package -n libkdepimlibs4-devel License: LGPL v2.1 or later @@ -159,44 +159,44 @@ %defattr(-,root,root) %doc COPYING COPYING.BSD COPYING.LIB # move this one to cmake ? -%dir %_libdir/cmake -%_libdir/cmake/KdepimLibs +%dir %_kde4_libdir/cmake +%_kde4_libdir/cmake/KdepimLibs /usr/include/* -%_kde_share_dir/apps/cmake -%_libdir/libkabc.so -%_libdir/libkabc_file_core.so -%_libdir/libkcal.so -%_libdir/libkldap.so -%_libdir/libkmime.so -%_libdir/libkresources.so -%_libdir/libktnef.so -%_libdir/libkxmlrpcclient.so -%_libdir/libsyndication.so -%_libdir/libkimap.so -%_libdir/libkblog.so -%_libdir/libkpimutils.so -%_libdir/libmailtransport.so -%_libdir/libgpgme++.so -%_libdir/libgpgme++-pthread.so +%_kde4_appsdir/cmake +%_kde4_libdir/libkabc.so +%_kde4_libdir/libkabc_file_core.so +%_kde4_libdir/libkcal.so +%_kde4_libdir/libkldap.so +%_kde4_libdir/libkmime.so +%_kde4_libdir/libkresources.so +%_kde4_libdir/libktnef.so +%_kde4_libdir/libkxmlrpcclient.so +%_kde4_libdir/libsyndication.so +%_kde4_libdir/libkimap.so +%_kde4_libdir/libkblog.so +%_kde4_libdir/libkpimutils.so +%_kde4_libdir/libmailtransport.so +%_kde4_libdir/libgpgme++.so +%_kde4_libdir/libgpgme++-pthread.so %if %suse_version > 1020 -%_libdir/libgpgme++-pth.so +%_kde4_libdir/libgpgme++-pth.so %endif -%_libdir/libkpimidentities.so -%_libdir/libqgpgme.so -%_libdir/libkholidays.so -%_libdir/libmicroblog.so -%_libdir/libkpimtextedit.so -%dir %_libdir/gpgmepp -%_libdir/gpgmepp/GpgmeppConfig.cmake -%_libdir/gpgmepp/GpgmeppLibraryDepends.cmake +%_kde4_libdir/libkpimidentities.so +%_kde4_libdir/libqgpgme.so +%_kde4_libdir/libkholidays.so +%_kde4_libdir/libmicroblog.so +%_kde4_libdir/libkpimtextedit.so +%dir %_kde4_libdir/gpgmepp +%_kde4_libdir/gpgmepp/GpgmeppConfig.cmake +%_kde4_libdir/gpgmepp/GpgmeppLibraryDepends.cmake %files %defattr(-,root,root) %doc COPYING COPYING.BSD COPYING.LIB -%exclude %_kde_share_dir/apps/cmake -%doc %lang(en) /usr/share/doc/kde/HTML/en/kcontrol -%doc %lang(en) /usr/share/doc/kde/HTML/en/kioslave -%_libdir/kde4 +%exclude %_kde4_appsdir/cmake +%doc %lang(en) %_kde4_htmldir/en/kcontrol +%doc %lang(en) %_kde4_htmldir/en/kioslave +%_kde4_libdir/kde4 %_kde_share_dir/apps /usr/share/dbus-1/*/* %_kde_share_dir/services ++++++ kdepimlibs-4.3.0.tar.bz2 -> kdepimlibs-4.3.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/CMakeLists.txt new/kdepimlibs-4.3.1/CMakeLists.txt --- old/kdepimlibs-4.3.0/CMakeLists.txt 2009-07-29 13:09:57.000000000 +0200 +++ new/kdepimlibs-4.3.1/CMakeLists.txt 2009-08-27 10:17:12.000000000 +0200 @@ -11,7 +11,7 @@ ############### The kdepimlibs version (used e.g. in KdepimLibsConfig.cmake) ############### set(KDEPIMLIBS_VERSION_MAJOR 4) set(KDEPIMLIBS_VERSION_MINOR 3) -set(KDEPIMLIBS_VERSION_PATCH 00) +set(KDEPIMLIBS_VERSION_PATCH 1) set(KDEPIMLIBS_VERSION ${KDEPIMLIBS_VERSION_MAJOR}.${KDEPIMLIBS_VERSION_MINOR}.${KDEPIMLIBS_VERSION_PATCH}) ############### search packages used by KDE ############### @@ -42,8 +42,8 @@ if (NOT KDEPIM_ONLY_KLEO) #FindAkonadi.cmake is only there for compatibility reasons, but we don't want to use that. - find_package(Akonadi 1.1.91 QUIET NO_MODULE) - macro_log_feature(Akonadi_FOUND "Akonadi" "Akonadi server (from kdesupport)" "http://pim.kde.org/akonadi" TRUE "1.1.95" "Akonadi is required to build KdepimLibs.") + find_package(Akonadi 1.2.0 QUIET NO_MODULE) + macro_log_feature(Akonadi_FOUND "Akonadi" "Akonadi server (from kdesupport)" "http://pim.kde.org/akonadi" TRUE "1.2.0" "Akonadi is required to build KdepimLibs.") find_package(Sasl2) macro_log_feature(SASL2_FOUND "cyrus-sasl" "Cyrus SASL API" "http://asg.web.cmu.edu/sasl/sasl-library.html" TRUE "" "Required to support authentication of logins in the IMAP and Sieve kioslaves.") Files old/kdepimlibs-4.3.0/doc/kcontrol/kresources/index.cache.bz2 and new/kdepimlibs-4.3.1/doc/kcontrol/kresources/index.cache.bz2 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/kcal/attendee.cpp new/kdepimlibs-4.3.1/kcal/attendee.cpp --- old/kdepimlibs-4.3.0/kcal/attendee.cpp 2009-05-14 19:26:01.000000000 +0200 +++ new/kdepimlibs-4.3.1/kcal/attendee.cpp 2009-08-27 10:17:10.000000000 +0200 @@ -153,6 +153,9 @@ case InProcess: return i18nc( "@item to-do in process of being completed", "In Process" ); break; + case None: + return i18nc( "@item event or to-do status unknown", "Unknown" ); + break; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/kcal/freebusy.cpp new/kdepimlibs-4.3.1/kcal/freebusy.cpp --- old/kdepimlibs-4.3.0/kcal/freebusy.cpp 2009-04-05 22:00:09.000000000 +0200 +++ new/kdepimlibs-4.3.1/kcal/freebusy.cpp 2009-08-27 10:17:10.000000000 +0200 @@ -104,7 +104,10 @@ setDtEnd( end ); // Get all the events in the calendar - Event::List eventList = d->mCalendar->rawEvents( start.date(), end.date() ); + Event::List eventList; + if ( d->mCalendar ) { + eventList = d->mCalendar->rawEvents( start.date(), end.date() ); + } int extraDays, i, x, duration; duration = start.daysTo( end ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/kcal/icalformat_p.cpp new/kdepimlibs-4.3.1/kcal/icalformat_p.cpp --- old/kdepimlibs-4.3.0/kcal/icalformat_p.cpp 2009-07-08 16:42:53.000000000 +0200 +++ new/kdepimlibs-4.3.1/kcal/icalformat_p.cpp 2009-08-27 10:17:10.000000000 +0200 @@ -629,7 +629,7 @@ if ( !c.key().startsWith( "X-KDE" ) && //krazy:exclude=strings !c.key().startsWith( "X-LibKCal" ) && //krazy:exclude=strings !c.key().startsWith( "X-MICROSOFT" ) && //krazy:exclude=strings - !c.key().startsWith( "X-MOZILLA" ) && //krazy:exclude=strings + !c.key().startsWith( "X-MOZ" ) && //krazy:exclude=strings !c.key().startsWith( "X-PILOT" ) ) { //krazy:exclude=strings // use text values for the typical X-FOO property. // except for vendor specific X-FOO properties. @@ -1440,8 +1440,8 @@ p = icalproperty_get_first_parameter( attach, ICAL_X_PARAMETER ); while ( p ) { - if ( strncmp ( icalparameter_get_xname( p ), "X-LABEL", 7 ) == 0 ) { - attachment->setLabel( icalparameter_get_xvalue( p ) ); + if ( strncmp( icalparameter_get_xname( p ), "X-LABEL", 7 ) == 0 ) { + attachment->setLabel( QString::fromUtf8( icalparameter_get_xvalue( p ) ) ); } p = icalproperty_get_next_parameter( attach, ICAL_X_PARAMETER ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/kcal/incidenceformatter.cpp new/kdepimlibs-4.3.1/kcal/incidenceformatter.cpp --- old/kdepimlibs-4.3.0/kcal/incidenceformatter.cpp 2009-07-21 17:16:32.000000000 +0200 +++ new/kdepimlibs-4.3.1/kcal/incidenceformatter.cpp 2009-08-27 10:17:10.000000000 +0200 @@ -1541,11 +1541,13 @@ { if ( incidence && incidence->revision() > 0 && ( existingIncidence || !helper->calendar() ) ) { html += tdOpen; - if ( incBase->type() == "Todo" ) { - //TODO: 4.4, remove the [] - html += helper->makeLink( "reply", i18n( "[Enter this into my to-do list]" ) ); - } else { - html += helper->makeLink( "reply", i18n( "[Enter this into my calendar]" ) ); + if ( incBase ) { + if ( incBase->type() == "Todo" ) { + //TODO: 4.4, remove the [] + html += helper->makeLink( "reply", i18n( "[Enter this into my to-do list]" ) ); + } else { + html += helper->makeLink( "reply", i18n( "[Enter this into my calendar]" ) ); + } } html += tdClose; } @@ -1589,7 +1591,7 @@ html += tdClose; // Check in calendar - if ( incBase->type() == "Event" ) { + if ( incBase && incBase->type() == "Event" ) { html += tdOpen; //TODO: 4.4, remove the [] //TODO: 4.4, change to "Check calendar" @@ -1613,10 +1615,12 @@ html += tdOpen; //TODO: 4.4, remove the [] //TODO: 4.4, change string to "Enter this response into my..." - if ( incBase->type() == "Todo" ) { - html += helper->makeLink( "reply", i18n( "[Enter this into my to-do list]" ) ); - } else { - html += helper->makeLink( "reply", i18n( "[Enter this into my calendar]" ) ); + if ( incBase ) { + if ( incBase->type() == "Todo" ) { + html += helper->makeLink( "reply", i18n( "[Enter this into my to-do list]" ) ); + } else { + html += helper->makeLink( "reply", i18n( "[Enter this into my calendar]" ) ); + } } html += tdClose; break; @@ -2228,7 +2232,7 @@ "Recurs every <numid>%1</numid> months on the %2 %3 until %4", recur->frequency(), dayList[rule.pos() + 31], - calSys->weekDayName( rule.day(),KCalendarSystem::LongDayName ), + calSys->weekDayName( rule.day(), KCalendarSystem::LongDayName ), recurEnd( incidence ) ); if ( recur->duration() > 0 ) { txt += i18nc( "number of occurrences", @@ -2270,20 +2274,22 @@ case Recurrence::rYearlyMonth: { if ( recur->duration() != -1 ) { - txt = i18ncp( "Recurs Every N years on month-name [1st|2nd|...]" - " until end-date", - "Recurs yearly on %2 %3 until %4", - "Recurs every %1 years on %2 %3 until %4", - recur->frequency(), - calSys->monthName( recur->yearMonths()[0], recur->startDate().year() ), - dayList[ recur->yearDates()[0] + 31 ], - recurEnd( incidence ) ); - if ( recur->duration() > 0 ) { - txt += i18nc( "number of occurrences", - " (<numid>%1</numid> occurrences)", - recur->duration() ); + if ( !recur->yearDates().isEmpty() ) { + txt = i18ncp( "Recurs Every N years on month-name [1st|2nd|...]" + " until end-date", + "Recurs yearly on %2 %3 until %4", + "Recurs every %1 years on %2 %3 until %4", + recur->frequency(), + calSys->monthName( recur->yearMonths()[0], recur->startDate().year() ), + dayList[ recur->yearDates()[0] + 31 ], + recurEnd( incidence ) ); + if ( recur->duration() > 0 ) { + txt += i18nc( "number of occurrences", + " (<numid>%1</numid> occurrences)", + recur->duration() ); + } + return txt; } - return txt; } if ( !recur->yearDates().isEmpty() ) { return i18ncp( "Recurs Every N years on month-name [1st|2nd|...]", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/kholidays/holidays/CMakeLists.txt new/kdepimlibs-4.3.1/kholidays/holidays/CMakeLists.txt --- old/kdepimlibs-4.3.0/kholidays/holidays/CMakeLists.txt 2009-07-08 16:42:53.000000000 +0200 +++ new/kdepimlibs-4.3.1/kholidays/holidays/CMakeLists.txt 2009-08-27 10:17:11.000000000 +0200 @@ -13,6 +13,7 @@ holiday_catalan holiday_ch holiday_cl + holiday_cn holiday_co holiday_cz holiday_de diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/kholidays/holidays/holiday_cn new/kdepimlibs-4.3.1/kholidays/holidays/holiday_cn --- old/kdepimlibs-4.3.0/kholidays/holidays/holiday_cn 1970-01-01 01:00:00.000000000 +0100 +++ new/kdepimlibs-4.3.1/kholidays/holidays/holiday_cn 2009-08-27 10:17:11.000000000 +0200 @@ -0,0 +1,40 @@ +: This file is UTF-8 encoded +: Holiday file for P.R. China +: Data from http://en.wikipedia.org/w/index.php?title=Public_holidays_in_the_People%27s_Republic_of_China&oldid=297123230 +: Author: Patrick Nagel <mail@patrick-nagel.net> +: +"元旦 (New Year)" weekend on 1 january +magenta "国际妇女节 (International Women's Day)" on 8 march +black "植树节 (Arbor Day)" on 12 march +"劳动节 (Labor Day)" weekend on 1 may +blue "青年节 (Youth Day)" on 4 may +cyan "六一儿童节 (Children's Day)" on 1 june +black "建党节 (CPC Founding Day)" on 1 july +green "建军节 (Army Day)" on 1 august +"国庆节 (National Day)" weekend on 1 october length 3 days +: +: Lunar calendar based holidays +: and special free (on weekdays) / work (on weekends) arrangements for 2009 +: yellow for free days, red for working days +: Data from http://cnreviews.com/life/living-in-china/china_public_holiday_2009_20081210... +: and various en.wikipedia.org pages +: +yellow "节假日 (day off)" weekend on 2 january 2009 +red "工作日 (working day)" on 4 january 2009 +red "工作日 (working day)" on 24 january 2009 +"春节 (Chinese New Year / Spring Festival)" weekend on 25 january 2009 length 3 days +yellow "节假日 (day off)" weekend on 28 january 2009 length 3 days +red "工作日 (working day)" on 1 february 2009 +black "元宵节 (Lantern Festival)" on 9 february 2009 +"清明节 (Qing Ming Festival / Tomb Sweeping Day)" weekend on 4 april 2009 +yellow "节假日 (day off)" weekend on 6 april 2009 +"端午节 (Dragon Boat Festival)" weekend on 28 may 2009 +yellow "节假日 (day off)" weekend on 29 may 2009 +red "工作日 (working day)" on 31 may 2009 +black "七夕节 Lover's Day" on 26 august 2009 +: black "中元节 Ghost Festival" on 3 september 2009 +red "工作日 (working day)" on 27 september 2009 +"中秋节 (Mid-Autumn Festival)" weekend on 3 october 2009 +yellow "节假日 (day off)" weekend on 5 october 2009 length 4 days +red "工作日 (working day)" on 10 october 2009 +black "重阳节 (Double Ninth Day / Elders' Day)" on 26 october 2009 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/kioslave/pop3/pop3.cpp new/kdepimlibs-4.3.1/kioslave/pop3/pop3.cpp --- old/kdepimlibs-4.3.0/kioslave/pop3/pop3.cpp 2009-04-28 15:45:51.000000000 +0200 +++ new/kdepimlibs-4.3.1/kioslave/pop3/pop3.cpp 2009-08-27 10:17:11.000000000 +0200 @@ -470,7 +470,7 @@ myReadLine(buf, sizeof(buf) - 1); // HACK: This assumes fread stops at the first \n and not \r - if (strcmp(buf, ".\r\n") == 0) { + if ( (buf[0] == 0) || (strcmp(buf, ".\r\n") == 0) ) { break; // End of data } // sanders, changed -2 to -1 below @@ -831,7 +831,7 @@ myReadLine(buf, sizeof(buf) - 1); // HACK: This assumes fread stops at the first \n and not \r - if (strcmp(buf, ".\r\n") == 0) { + if ( (buf[0] == 0) || (strcmp(buf, ".\r\n") == 0) ) { break; // End of data } // sanders, changed -2 to -1 below diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/kpimutils/linklocator.cpp new/kdepimlibs-4.3.1/kpimutils/linklocator.cpp --- old/kdepimlibs-4.3.0/kpimutils/linklocator.cpp 2008-10-23 01:03:18.000000000 +0200 +++ new/kdepimlibs-4.3.1/kpimutils/linklocator.cpp 2009-08-27 10:17:09.000000000 +0200 @@ -107,23 +107,52 @@ { QString url; if ( atUrl() ) { - // handle cases like this: <link>http://foobar.org/</link> - int start = mPos; - while ( mPos < (int)mText.length() && - mText[mPos] > ' ' && mText[mPos] != '"' && - QString( "<>()[]" ).indexOf( mText[mPos] ) == -1 ) { - ++mPos; + // NOTE: see http://tools.ietf.org/html/rfc3986#appendix-A and especially appendix-C + // Appendix-C mainly says, that when extracting URLs from plain text, line breaks shall + // be allowed and should be ignored when the URI is extracted. + + // This implementation follows this recommendation and + // allows the URL to be enclosed within different kind of brackets/quotes + // If an URL is enclosed, whitespace characters are allowed and removed, otherwise + // the URL ends with the first whitespace + // Also, if the URL is enclosed in brackets, the URL itself is not allowed + // to contain the closing bracket, as this would be detected as the end of the URL + + QChar beforeUrl, afterUrl; + + // detect if the url has been surrounded by brackets or quotes + if ( mPos > 0 ) { + beforeUrl = mText[mPos - 1]; + + if ( beforeUrl == '(' ) + afterUrl = ')'; + else if ( beforeUrl == '[' ) + afterUrl = ']'; + else if ( beforeUrl == '<' ) + afterUrl = '>'; + else if ( beforeUrl == '>' ) // for e.g. <link>http://.....</link> + afterUrl = '<'; + else if ( beforeUrl == '"' ) + afterUrl = '"'; } - /* some URLs really end with: # / & - _ */ - const QString allowedSpecialChars = QString( "#/&-_" ); - while ( mPos > start && mText[mPos-1].isPunct() && - allowedSpecialChars.indexOf( mText[mPos-1] ) == -1 ) { - --mPos; + url.reserve( maxUrlLen() ); // avoid allocs + int start = mPos; + while ( ( mPos < (int)mText.length() ) && + ( mText[mPos].isPrint() || mText[mPos].isSpace() ) && + ( ( afterUrl.isNull() && !mText[mPos].isSpace() ) || + ( !afterUrl.isNull() && mText[mPos] != afterUrl ) ) + ) { + if ( !mText[mPos].isSpace() ) { // skip whitespace + url.append( mText[mPos] ); + if ( url.length() > maxUrlLen() ) + break; + } + + mPos++; } - url = mText.mid( start, mPos - start ); - if ( isEmptyUrl(url) || mPos - start > maxUrlLen() ) { + if ( isEmptyUrl(url) || ( url.length() > maxUrlLen() ) ) { mPos = start; url = ""; } else { @@ -268,20 +297,38 @@ ch = locator.mText[locator.mPos]; if ( flags & PreserveSpaces ) { if ( ch == ' ' ) { - if ( startOfLine ) { + if ( locator.mPos + 1 < locator.mText.length() ) { + if ( locator.mText[locator.mPos + 1] != ' ' ) { + + // A single space, make it breaking if not at the start or end of the line + const bool endOfLine = locator.mText[locator.mPos + 1] == '\n'; + if ( !startOfLine && !endOfLine ) + result += ' '; + else + result += " "; + } + else { + + // Whitespace of more than one space, make it all non-breaking + while( locator.mPos < locator.mText.length() && locator.mText[locator.mPos] == ' ' ) { + result += " "; + locator.mPos++; + x++; + } + + // We incremented once to often, undo that + locator.mPos--; + x--; + } + } + else { + // Last space in the text, it is non-breaking result += " "; - locator.mPos++, x++; - startOfLine = false; } - while ( locator.mText[locator.mPos] == ' ' ) { - result += ' '; - locator.mPos++, x++; - if ( locator.mText[locator.mPos] == ' ' ) { - result += " "; - locator.mPos++, x++; - } + + if ( startOfLine ) { + startOfLine = false; } - locator.mPos--, x--; continue; } else if ( ch == '\t' ) { do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/kpimutils/tests/testemail.cpp new/kdepimlibs-4.3.1/kpimutils/tests/testemail.cpp --- old/kdepimlibs-4.3.0/kpimutils/tests/testemail.cpp 2008-10-23 01:03:18.000000000 +0200 +++ new/kdepimlibs-4.3.1/kpimutils/tests/testemail.cpp 2009-08-28 05:47:35.000000000 +0200 @@ -120,6 +120,15 @@ return true; } +static bool checkIsValidAddressList( const QString &list, const QString &expErrorCode ) +{ + QString badAddress; + EmailParseResult realErrorCode = isValidAddressList( list, badAddress ); + QString errorCode = emailTestParseResultToString( realErrorCode ); + check( "isValidAddressList " + list + " errorCode ", errorCode, expErrorCode ); + return true; +} + static bool checkIsValidSimpleEmailAddress( const QString &input, const QString &expResult ) { bool validEmail = isValidSimpleAddress( input ); @@ -407,6 +416,14 @@ checkIsValidEmailAddress( "Matt Douhan <matt\"@@\"fruitsalad.org>", "TooFewAts" ); + //bug 139477 + checkIsValidAddressList( "martin.schulte@guug.de, msadmin@guug.de, msnewsletter@guug.de", "AddressOk" ); + checkIsValidAddressList( "martin.schulte@guug.de; msadmin@guug.de; msnewsletter@guug.de", "AddressOk" ); + checkIsValidAddressList( "martin.schulte@guug.de, msadmin@guug.de., msnewsletter@guug.de", "AddressOk" ); + checkIsValidAddressList( "Martin Schulte <martin.schulte@guug.de>, MS Admin <msadmin@guug.de>, MS News <msnewsletter@guug.de>", "AddressOk" ); + checkIsValidAddressList( "Martin Schulte <martin.schulte@guug.de>; MS Admin <msadmin@guug.de>; MS News <msnewsletter@guug.de>", "AddressOk" ); + checkIsValidAddressList( "Martin Schulte <martin.schulte@guug.de.>, MS Admin <msadmin@guug.de>, MS News <msnewsletter@guug.de>", "AddressOk" ); + // checks for "pure" email addresses in the form of xxx@yyy.tld checkIsValidSimpleEmailAddress( "matt@fruitsalad.org", "true" ); checkIsValidSimpleEmailAddress( QString::fromUtf8( "test@täst.invalid" ), "true" ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/kpimutils/tests/testlinklocator.cpp new/kdepimlibs-4.3.1/kpimutils/tests/testlinklocator.cpp --- old/kdepimlibs-4.3.0/kpimutils/tests/testlinklocator.cpp 2008-10-23 01:03:18.000000000 +0200 +++ new/kdepimlibs-4.3.1/kpimutils/tests/testlinklocator.cpp 2009-08-27 10:17:09.000000000 +0200 @@ -19,6 +19,7 @@ Boston, MA 02110-1301, USA. */ #include <qtest_kde.h> +#include <kdebug.h> #include "testlinklocator.h" #include "testlinklocator.moc" @@ -104,3 +105,192 @@ QVERIFY( llq.getEmailAddress() == "foo@bar-bar.baz" ); } +void LinkLocatorTest::testGetUrl() +{ + QStringList brackets; + brackets << "" << ""; // no brackets + brackets << "(" << ")"; + brackets << "<" << ">"; + brackets << "[" << "]"; + brackets << "\"" << "\""; + brackets << "<link>" << "</link>"; + + for (int i = 0; i < brackets.count(); i += 2) + testGetUrl2(brackets[i], brackets[i+1]); +} + +void LinkLocatorTest::testGetUrl2(const QString &left, const QString &right) +{ + QStringList schemas; + schemas << "http://"; + schemas << "https://"; + schemas << "vnc://"; + schemas << "fish://"; + schemas << "ftp://"; + schemas << "ftps://"; + schemas << "sftp://"; + schemas << "smb://"; + schemas << "file://"; + + QStringList urls; + urls << "www.kde.org"; + urls << "user@www.kde.org"; + urls << "user:pass@www.kde.org"; + urls << "user:pass@www.kde.org:1234"; + urls << "user:pass@www.kde.org:1234/sub/path"; + urls << "user:pass@www.kde.org:1234/sub/path?a=1"; + urls << "user:pass@www.kde.org:1234/sub/path?a=1#anchor"; + urls << "user:pass@www.kde.org:1234/sub/\npath \n /long/ path \t ?a=1#anchor"; + urls << "user:pass@www.kde.org:1234/sub/path/special(123)?a=1#anchor"; + urls << "user:pass@www.kde.org:1234/sub/path:with:colon/special(123)?a=1#anchor"; + urls << "user:pass@www.kde.org:1234/sub/path:with:colon/special(123)?a=1#anchor[bla"; + urls << "user:pass@www.kde.org:1234/sub/path:with:colon/special(123)?a=1#anchor[bla]"; + urls << "user:pass@www.kde.org:1234/\nsub/path:with:colon/\nspecial(123)?\na=1#anchor[bla]"; + urls << "user:pass@www.kde.org:1234/ \n sub/path:with:colon/ \n\t \t special(123)?\n\t \n\t a=1#anchor[bla]"; + + foreach (QString schema, schemas) + { + foreach (QString url, urls) + { + // by defintion: if the URL is enclosed in brackets, the URL itself is not allowed + // to contain the closing bracket, as this would be detected as the end of the URL + if ( ( left.length() == 1 ) && ( url.contains( right[0] ) ) ) + continue; + + // if the url contains a whitespace, it must be enclosed with brackets + if ( (url.contains('\n') || url.contains('\t') || url.contains(' ')) && + left.isEmpty() ) + continue; + + QString test(left + schema + url + right); + LinkLocator ll(test, left.length()); + QString gotUrl = ll.getUrl(); + + // we want to have the url without whitespace + url.remove(' '); + url.remove('\n'); + url.remove('\t'); + + bool ok = ( gotUrl == (schema + url) ); + //qDebug() << "check:" << (ok ? "OK" : "NOK") << test << "=>" << (schema + url); + if ( !ok ) qDebug() << "got:" << gotUrl; + QVERIFY2( ok, qPrintable(test) ); + } + } + + QStringList urlsWithoutSchema; + urlsWithoutSchema << ".kde.org"; + urlsWithoutSchema << ".kde.org:1234/sub/path"; + urlsWithoutSchema << ".kde.org:1234/sub/path?a=1"; + urlsWithoutSchema << ".kde.org:1234/sub/path?a=1#anchor"; + urlsWithoutSchema << ".kde.org:1234/sub/path/special(123)?a=1#anchor"; + urlsWithoutSchema << ".kde.org:1234/sub/path:with:colon/special(123)?a=1#anchor"; + urlsWithoutSchema << ".kde.org:1234/sub/path:with:colon/special(123)?a=1#anchor[bla"; + urlsWithoutSchema << ".kde.org:1234/sub/path:with:colon/special(123)?a=1#anchor[bla]"; + urlsWithoutSchema << ".kde.org:1234/\nsub/path:with:colon/\nspecial(123)?\na=1#anchor[bla]"; + urlsWithoutSchema << ".kde.org:1234/ \n sub/path:with:colon/ \n\t \t special(123)?\n\t \n\t a=1#anchor[bla]"; + + QStringList starts; + starts << "www" << "ftp" << "news:www"; + + foreach (QString start, starts) + { + foreach (QString url, urlsWithoutSchema) + { + // by defintion: if the URL is enclosed in brackets, the URL itself is not allowed + // to contain the closing bracket, as this would be detected as the end of the URL + if ( ( left.length() == 1 ) && ( url.contains( right[0] ) ) ) + continue; + + // if the url contains a whitespace, it must be enclosed with brackets + if ( (url.contains('\n') || url.contains('\t') || url.contains(' ')) && + left.isEmpty() ) + continue; + + QString test(left + start + url + right); + LinkLocator ll(test, left.length()); + QString gotUrl = ll.getUrl(); + + // we want to have the url without whitespace + url.remove(' '); + url.remove('\n'); + url.remove('\t'); + + bool ok = ( gotUrl == (start + url) ); + //qDebug() << "check:" << (ok ? "OK" : "NOK") << test << "=>" << (start + url); + if ( !ok ) qDebug() << "got:" << gotUrl; + QVERIFY2( ok, qPrintable(gotUrl) ); + } + } + + // test max url length + QString url = "http://www.kde.org/this/is/a_very_loooooong_url/test/test/test"; + { + LinkLocator ll(url); + ll.setMaxUrlLen(10); + QVERIFY( ll.getUrl().isEmpty() ); // url too long + } + { + LinkLocator ll(url); + ll.setMaxUrlLen(url.length() - 1); + QVERIFY( ll.getUrl().isEmpty() ); // url too long + } + { + LinkLocator ll(url); + ll.setMaxUrlLen(url.length()); + QVERIFY( ll.getUrl() == url ); + } + { + LinkLocator ll(url); + ll.setMaxUrlLen(url.length() + 1); + QVERIFY( ll.getUrl() == url ); + } + + // mailto + { + QString addr = "mailto:test@kde.org"; + QString test(left + addr + right); + LinkLocator ll(test, left.length()); + + QString gotUrl = ll.getUrl(); + + bool ok = ( gotUrl == addr ); + //qDebug() << "check:" << (ok ? "OK" : "NOK") << test << "=>" << addr; + if ( !ok ) qDebug() << "got:" << gotUrl; + QVERIFY2( ok, qPrintable(gotUrl) ); + } +} + +void LinkLocatorTest::testHtmlConvert_data() +{ + QTest::addColumn<QString>("plainText"); + QTest::addColumn<int>("flags"); + QTest::addColumn<QString>("htmlText"); + + //QTest::newRow( "" ) << "foo" << 0 << "foo"; + //QTest::newRow( "" ) << " foo " << 0 << " foo "; + // Linker error when using PreserveSpaces, therefore the hardcoded 0x01 + QTest::newRow( "" ) << " foo" << 0x01 << " foo"; + QTest::newRow( "" ) << " foo" << 0x01 << " foo"; + QTest::newRow( "" ) << " foo " << 0x01 << " foo "; + QTest::newRow( "" ) << " foo " << 0x01 << " foo "; + QTest::newRow( "" ) << "bla bla bla bla bla" << 0x01 << "bla bla bla bla bla"; + QTest::newRow( "" ) << "bla bla bla \n bla bla bla " << 0x01 + << "bla bla bla <br />\n bla bla bla "; + QTest::newRow( "" ) << "bla bla bla" << 0x01 + << "bla bla bla"; + QTest::newRow( "" ) << " bla bla \n bla bla a\n bla bla " << 0x01 + << " bla bla <br />\n bla bla a<br />\n bla bla "; +} + +void LinkLocatorTest::testHtmlConvert() +{ + QFETCH(QString, plainText); + QFETCH(int, flags); + QFETCH(QString, htmlText); + + QString actualHtml = LinkLocator::convertToHtml( plainText, flags ); + QCOMPARE( actualHtml, htmlText ); +} + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/kpimutils/tests/testlinklocator.h new/kdepimlibs-4.3.1/kpimutils/tests/testlinklocator.h --- old/kdepimlibs-4.3.0/kpimutils/tests/testlinklocator.h 2008-01-29 10:14:48.000000000 +0100 +++ new/kdepimlibs-4.3.1/kpimutils/tests/testlinklocator.h 2009-08-27 10:17:09.000000000 +0200 @@ -29,6 +29,12 @@ Q_OBJECT private Q_SLOTS: void testGetEmailAddress(); + void testGetUrl(); + void testHtmlConvert(); + void testHtmlConvert_data(); + + private: + void testGetUrl2(const QString &left, const QString &right); }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.3.0/mailtransport/transportjob.h new/kdepimlibs-4.3.1/mailtransport/transportjob.h --- old/kdepimlibs-4.3.0/mailtransport/transportjob.h 2008-01-29 10:14:59.000000000 +0100 +++ new/kdepimlibs-4.3.1/mailtransport/transportjob.h 2009-08-27 10:17:12.000000000 +0200 @@ -46,21 +46,25 @@ /** Sets the sender of the mail. + @p sender must be the plain email address, not including display name. */ void setSender( const QString &sender ); /** Sets the "To" receiver(s) of the mail. + @p to must be the plain email address(es), not including display name. */ void setTo( const QStringList &to ); /** Sets the "Cc" receiver(s) of the mail. + @p cc must be the plain email address(es), not including display name. */ void setCc( const QStringList &cc ); /** Sets the "Bcc" receiver(s) of the mail. + @p bcc must be the plain email address(es), not including display name. */ void setBcc( const QStringList &bcc ); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de