~ubuntu-branches/ubuntu/natty/kde4libs/natty-proposed

« back to all changes in this revision

Viewing changes to kdecore/sonnet/filter.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell, Scott Kitterman, Jonathan Riddell
  • Date: 2010-11-22 17:59:02 UTC
  • mfrom: (1.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101122175902-yubxubd0pg6hn11z
Tags: 4:4.5.80a-0ubuntu1
[ Scott Kitterman ]
* New upstream beta release
  - Refreshed all patches
  - Updated debian/patches/10_make_libkdeinit4_private.diff to use Qfile
    instead of Qstring in kdecore/kernel/kstandarddirs_unix.cpp
  - Updated debian/patches/kubuntu_01_kubuntu_useragent.diff to provide
    Kubuntu in the Konqueror user agen string with the changes in
    kio/kio/kprotocolmanager.cpp
  - Partially updated debian/patches/kubuntu_05_langpack_desktop_files.diff
    and left the balance in kdecore/localization/klocale.cpp.rej for later
    revision
  - Update debian/patches/kubuntu_06_user_disk_mounting.diff for changes in
    solid/solid/backends/hal/halstorageaccess.cpp
  - Remove debian/patches/kubuntu_71_backport_plasma_webview_changes.diff
    (backported from upstream, so already present now)
  - Add minimum version for libattica-dev of 0.1.90 to build-depends
  - Bump minimum version for libsoprano-dev build-depend to 2.5.60
  - Add minimum version for shared-desktop-ontologies of 0.5 in build-dep

[ Jonathan Riddell ]
* Add build-depends on grantlee, libudev-dev, hupnp (FIXME needs packaging fixes)
* Update kubuntu_04_add_langpack_path.diff 28_find_old_kde4_html_documentation.diff
  22_hack_in_etc_kde4_in_kstandarddirs.diff for QT_NO_CAST_FROM_ASCII
* Update kubuntu_05_langpack_desktop_files.diff for new upstream code
* Add kubuntu_78_solid_trunk.diff to fix solid linking
* Add libnepomukutils4 package for new library
* Don't install kcm_ssl for now, e-mailed upstream to suggest moving to kdebase
* Add kubuntu_79_knewstuff_fix.diff to fix compile broken by non-trunk commit
  http://websvn.kde.org/?view=revision&revision=1199825
* kdelibs5-data replaces old kdebase-runtime-data due to moved file
* Add kubuntu_80_find_hupnp.diff to find hupnp include files, committed upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
    QTextBoundaryFinder::BoundaryReasons boundary = finder.boundaryReasons();
119
119
    int start = finder.position(), end = finder.position();
120
120
    bool inWord = (boundary & QTextBoundaryFinder::StartWord) != 0;
121
 
 
122
121
    while (finder.toNextBoundary() > 0) {
123
122
        boundary = finder.boundaryReasons();
124
 
 
125
123
        if ((boundary & QTextBoundaryFinder::EndWord) && inWord) {
126
124
            end = finder.position();
127
125
            QString str = finder.string().mid(start, end - start);
178
176
        return Filter::end();
179
177
 
180
178
    allUppercase = ( foundWord == foundWord.toUpper() );
181
 
    
 
179
 
182
180
    //TODO implement runtogether correctly.
183
181
    //We must ask to sonnet plugins to do it and not directly here.
184
182
 
185
 
 
186
183
    if ( shouldBeSkipped( allUppercase, runTogether, foundWord ) )
187
184
        return nextWord();
188
185
    return Word( foundWord, start );
238
235
    QString buffer = m_buffer;
239
236
    Word word = wordAtPosition( m_finder.position() );
240
237
    buffer = buffer.replace( word.start, word.word.length(),
241
 
                             QString( "<b>%1</b>" ).arg( word.word ) );
 
238
                             QString::fromLatin1( "<b>%1</b>" ).arg( word.word ) );
242
239
 
243
240
    QString context;
244
241
    if ( begin )
245
 
        context = QString( "%1...")
 
242
        context = QString::fromLatin1("%1...")
246
243
                  .arg( buffer.mid(  0, len ) );
247
244
    else
248
 
        context = QString( "...%1..." )
 
245
        context = QString::fromLatin1("...%1...")
249
246
                  .arg( buffer.mid(  m_finder.position() - 20, len ) );
250
247
 
251
 
    context.replace( '\n', ' ' );
 
248
    context.replace( QLatin1Char('\n'), QLatin1Char(' ') );
252
249
 
253
250
    return context;
254
251
}
264
261
 
265
262
    int length = m_buffer.length();
266
263
    //URL - if so skip
267
 
    if ( currentChar == ':'
 
264
    if ( currentChar == QLatin1Char(':')
268
265
         && (currentPosition+1 < length)
269
 
         && (m_buffer.at( ++currentPosition ) == '/' || ( currentPosition + 1 ) >= length ) ) {
 
266
         && (m_buffer.at( ++currentPosition ) == QLatin1Char('/') || ( currentPosition + 1 ) >= length ) ) {
270
267
        //in both cases url is considered finished at the first whitespace occurrence
271
268
        //TODO hey, "http://en.wikipedia.org/wiki/Main Page" --Nick Shaforostoff
272
269
        while ( !m_buffer.at( currentPosition++ ).isSpace() && currentPosition < length )
276
273
    }
277
274
 
278
275
    //Email - if so skip
279
 
    if ( currentChar == '@') {
 
276
    if ( currentChar == QLatin1Char('@')) {
280
277
        while ( ++currentPosition < length && !m_buffer.at( currentPosition ).isSpace() )
281
278
            ;
282
279
        m_finder.setPosition(currentPosition);
296
293
{
297
294
    bool checkUpper = ( d->settings ) ?
298
295
                      d->settings->checkUppercase () : true;
 
296
 
299
297
    bool skipRunTogether = ( d->settings ) ?
300
298
                           d->settings->skipRunTogether() : true;
301
299