All pastes #156894 Raw Edit

Someone

public text v1 · immutable
·published 2006-09-01 02:55 UTC
rendered paste body
I applied the following patch to konqueror :

Index: konq_listviewitems.cc
===================================================================
--- konq_listviewitems.cc       (révision 579318)
+++ konq_listviewitems.cc       (copie de travail)
@@ -287,8 +287,12 @@
          break;
       }
    }
-   if ( m_pListViewWidget->caseInsensitiveSort() )
+   if ( m_pListViewWidget->caseInsensitiveSort() ) {
+       kdDebug(1202) << "string1 : '" << text( col ) << "'" << endl;
+       kdDebug(1202) << "string2 : '" << k->text( col ) << "'" << endl;
+       kdDebug(1202) << "result of string1.lower().localeAwareCompare(string2.lower() ) : " << text( col ).lower().localeAwareCompare( k->text( col ).lower() ) << endl;
        return text( col ).lower().localeAwareCompare( k->text( col ).lower() );
+}
    else {
        return m_pListViewWidget->m_pSettings->caseSensitiveCompare( text( col ), k->text( col ) );
    }

The result going in a folder with the files b.b and ba is :
konqueror: string1 : 'b.b'
konqueror: string2 : 'ba'
konqueror: result of string1.lower().localeAwareCompare(string2.lower() ) : 1

Now I made the following c++ file :

#include <qstring.h>
#include <iostream.h>

int main() {
        QString string1( "b.b" );
        QString string2( "ba" );
        cout << "string1 : '" << string1 << "'" << endl;
        cout << "string2 : '" << string2 << "'" << endl;
        cout << "result of string1.lower().localeAwareCompare(string2.lower() ) : " << string1.lower().localeAwareCompare( string2.lower() ) << endl;
}

and the result is :
string1 : 'b.b'
string2 : 'ba'
result of string1.lower().localeAwareCompare(string2.lower() ) : -1