Revision: 6181
Author: nogu.dev
Date: Sat Feb 27 15:04:04 2010
Log: * qt4/candwin/qt4.cpp
* qt4/candwin/uim-candwin-qt4.pro.in
  - Remove dependency on Qt3Support module.
http://code.google.com/p/uim/source/detail?r=6181

Modified:
 /trunk/qt4/candwin/qt4.cpp
 /trunk/qt4/candwin/uim-candwin-qt4.pro.in

=======================================
--- /trunk/qt4/candwin/qt4.cpp  Sat Feb 27 15:03:50 2010
+++ /trunk/qt4/candwin/qt4.cpp  Sat Feb 27 15:04:04 2010
@@ -89,7 +89,7 @@
           this , SLOT( slotCandidateSelected( QTableWidgetItem * ) ) );

     //setup NumberLabel
-    numLabel = new QLabel( this, "candidateLabel" );
+    numLabel = new QLabel;
     numLabel->setFocusPolicy( Qt::NoFocus );

     nrCandidates = 0;
@@ -137,15 +137,15 @@
     if ( !list[ 1 ].isEmpty()
         && list[ 1 ].startsWith( QLatin1String( "charset" ) ) )
     {
-        const QStringList l = QStringList::split( "=", list[ 1 ] );
-        codec = QTextCodec::codecForName( l[ 1 ] );
+ const QStringList l = list[ 1 ].split( '=', QString::SkipEmptyParts );
+        codec = QTextCodec::codecForName( l[ 1 ].toAscii() );
     }

     // get display_limit
     if ( !list[ 2 ].isEmpty()
         && list[ 2 ].startsWith( QLatin1String( "display_limit" ) ) )
     {
-        const QStringList l = QStringList::split( "=", list[ 2 ] );
+ const QStringList l = list[ 2 ].split( '=', QString::SkipEmptyParts );
         displayLimit = l[ 1 ].toInt();
     }

@@ -156,13 +156,13 @@
             break;

         // split heading_label and cand_str
-        QStringList l = QStringList::split( "\t", list [ i ], true );
+        QStringList l = list[ i ].split( '\t' );

         // store data
         CandData d;
         QString headString;
         if ( codec )
-            headString = codec->toUnicode( l [ 0 ] );
+            headString = codec->toUnicode( l[ 0 ].toAscii() );
         else
             headString = l [ 0 ];

@@ -175,7 +175,7 @@
         QString candString = l.join( "\t" );

         if ( codec )
-            d.str = codec->toUnicode( candString );
+            d.str = codec->toUnicode( candString.toAscii() );
         else
             d.str = candString;

@@ -302,15 +302,15 @@
     if ( !list[ 1 ].isEmpty()
         && list[ 1 ].startsWith( QLatin1String( "charset" ) ) )
     {
-        const QStringList l = QStringList::split( "=", list[ 1 ] );
-        codec = QTextCodec::codecForName( l[ 1 ] );
+ const QStringList l = list[ 1 ].split( '=', QString::SkipEmptyParts );
+        codec = QTextCodec::codecForName( l[ 1 ].toAscii() );
     }

     // get page
     if ( !list[ 2 ].isEmpty()
         && list[ 2 ].startsWith( QLatin1String( "page" ) ) )
     {
-        const QStringList l = QStringList::split( "=", list[ 2 ] );
+ const QStringList l = list[ 2 ].split( '=', QString::SkipEmptyParts );
         page = l[ 1 ].toInt();
     }

@@ -322,13 +322,13 @@
             break;

         // split heading_label and cand_str
-        QStringList l = QStringList::split( "\t", list [ i ], true );
+        QStringList l = list [ i ].split( '\t' );

         // store data
         CandData &d = stores[page * displayLimit + i - 3];
         QString headString;
         if ( codec )
-            headString = codec->toUnicode( l [ 0 ] );
+            headString = codec->toUnicode( l [ 0 ].toAscii() );
         else
             headString = l [ 0 ];

@@ -341,7 +341,7 @@
         QString candString = l.join( "\t" );

         if ( codec )
-            d.str = codec->toUnicode( candString );
+            d.str = codec->toUnicode( candString.toAscii() );
         else
             d.str = candString;
     }
@@ -367,7 +367,7 @@
         n = read( fd, buf, 4096 - 1 );
         if ( n == 0 )
         {
-            close( fd );
+            ::close( fd );
             exit( 1 );
         }
         if ( n == -1 )
@@ -377,7 +377,8 @@
         strcat( read_buf, buf );
     }

- QStringList msgList = QStringList::split( "\n\n", QString( read_buf ) );
+    QStringList msgList
+        = QString( read_buf ).split( "\n\n", QString::SkipEmptyParts );

     QStringList::Iterator it = msgList.begin();
     const QStringList::Iterator end = msgList.end();
@@ -389,9 +390,9 @@
 void CandidateWindow::strParse( const QString& str )
 {
 #if defined(ENABLE_DEBUG)
-    qDebug( "str = %s", ( const char* ) str.local8Bit() );
+    qDebug( "str = %s", str.toLocal8Bit().constData() );
 #endif
-    QStringList list = QStringList::split( "\n", str );
+    QStringList list = str.split( '\n', QString::SkipEmptyParts );

     QStringList::Iterator it = list.begin();
     const QStringList::Iterator end = list.end();
@@ -601,7 +602,6 @@
     QApplication a( argc, argv );

     CandidateWindow b;
-    a.setMainWidget( &b );

     return a.exec();
 }
=======================================
--- /trunk/qt4/candwin/uim-candwin-qt4.pro.in   Sun Dec 27 17:09:44 2009
+++ /trunk/qt4/candwin/uim-candwin-qt4.pro.in   Sat Feb 27 15:04:04 2010
@@ -1,6 +1,5 @@
 TEMPLATE = app
 CONFIG += @QT_CONFIG_OPTS@
-QT += qt3support

 INCLUDEPATH += @top_builddir@ @top_builddir@/uim \
                @top_srcdir@ @top_srcdir@/uim \

Reply via email to