Browse Source

Added controlled conversions to char* instead of automatic ascii conversions.

The definition of -UTQT_NO_ASCII_CAST is no longer needed.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/3/head
Slávek Banko 6 months ago
parent
commit
9e120e0d4b
Signed by: Slávek Banko <slavek.banko@axis.cz> GPG Key ID: 608F5293A04BE668
4 changed files with 9 additions and 9 deletions
  1. 1
    1
      CMakeLists.txt
  2. 6
    6
      knights/io_internet.cpp
  3. 1
    1
      knights/list_pgn.cpp
  4. 1
    1
      knights/resource.cpp

+ 1
- 1
CMakeLists.txt View File

@@ -58,7 +58,7 @@ include( ConfigureChecks.cmake )
58 58
 
59 59
 ###### global compiler settings
60 60
 
61
-add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST )
61
+add_definitions( -DHAVE_CONFIG_H )
62 62
 
63 63
 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
64 64
 set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )

+ 6
- 6
knights/io_internet.cpp View File

@@ -187,7 +187,7 @@ void io_internet::connectToServer()
187 187
   }
188 188
   else
189 189
   {
190
-    socket = new TDESocket(myServer->URL, myServer->Port, 30);
190
+    socket = new TDESocket(myServer->URL.utf8(), myServer->Port, 30);
191 191
     if(socket->socket() == -1)
192 192
     {
193 193
       /* Couldn't connect to server. Notify User and die gracefully */
@@ -221,7 +221,7 @@ void io_internet::connectToServer()
221 221
 			and close these tabs at will, or have multiple open at once. ALL communication to our tabs
222 222
 			needs to be done with SIGNALS & SLOTS to facilitate this.
223 223
 	*/
224
-	consoleTab = new Console( 0, myServer->Name, myResource );
224
+	consoleTab = new Console( 0, myServer->Name.utf8(), myResource );
225 225
 	myTabList[consoleTab] = consoleTab;
226 226
 	myResource->tabManager->addTab( myTabList[consoleTab], i18n( "%1 Console" ).arg( myServer->Name ) );
227 227
   connect( myTabList[consoleTab], TQT_SIGNAL( sendCMD( const Command& ) ), this, TQT_SLOT( recvCMD( const Command& ) ) );
@@ -847,9 +847,9 @@ void io_internet::parseStyle12(TQString line, const unsigned int Mode)
847 847
       }
848 848
 
849 849
       /* Verbose Coordinate Notation of previous move ( USE AS CAN ) */
850
-      strcpy(move.CAN, fields[27].right(fields[27].length() - 2).replace(TQRegExp("-"), ""));
850
+      strcpy(move.CAN, fields[27].right(fields[27].length() - 2).replace(TQRegExp("-"), "").utf8());
851 851
       /* SAN  */
852
-      strcpy(move.SAN, fields[29].replace(TQRegExp("\\+"), "").replace(TQRegExp("#"), ""));
852
+      strcpy(move.SAN, fields[29].replace(TQRegExp("\\+"), "").replace(TQRegExp("#"), "").utf8());
853 853
 
854 854
       /* fill the line for the command */
855 855
       position_line += fields[1];  /* Internal Rank #7 */
@@ -1024,7 +1024,7 @@ void io_internet::parseMoveList(TQString line)
1024 1024
   move.ICS_MoveCounter = move_counter;
1025 1025
   move.ICS_Mode = ICS_Movelist;
1026 1026
   move.ICS_OnMove = WHITE;
1027
-  strcpy(move.SAN, two_plys[1]);
1027
+  strcpy(move.SAN, two_plys[1].utf8());
1028 1028
   command.setCommand((int&)CMD_Move);
1029 1029
   command.setID(fics_to_knights[ficsMoveListNumber]);
1030 1030
   command.setMove(move);
@@ -1037,7 +1037,7 @@ void io_internet::parseMoveList(TQString line)
1037 1037
     move.ICS_MoveCounter = move_counter;
1038 1038
     move.ICS_Mode = ICS_Movelist;
1039 1039
     move.ICS_OnMove = BLACK;
1040
-    strcpy(move.SAN, two_plys[3]);
1040
+    strcpy(move.SAN, two_plys[3].utf8());
1041 1041
     command.setCommand((int&)CMD_Move);
1042 1042
     command.setID(fics_to_knights[ficsMoveListNumber]);
1043 1043
     command.setMove(move);

+ 1
- 1
knights/list_pgn.cpp View File

@@ -140,6 +140,6 @@ void list_pgn::timerEvent( TQTimerEvent* )
140 140
 															tmpPGN.TAG_Site,
141 141
 															tmpPGN.TAG_Date,
142 142
 															TQString::number(tmpPGN.File_Position) );
143
-		status->message( i18n( TQString( "%1 matches found." ).arg( listView->childCount() ) ) );
143
+		status->message( i18n( "%1 matches found." ).arg( listView->childCount() ) );
144 144
 	}
145 145
 }

+ 1
- 1
knights/resource.cpp View File

@@ -164,7 +164,7 @@ void resource::ConfigRead( void )
164 164
 	PGN_Filename = CFG->readEntry( "PGNFilename", TQString() );
165 165
 	SCID_Image_Path = CFG->readEntry( "SCIDImages", TQString() );
166 166
 	OPTION_Auto_Close_Last_ICS = CFG->readBoolEntry( "AutoCloseLastICS", TRUE );
167
-	OPTION_Show_Extended_PGN = CFG->readEntry( "ShowExtendedPGN", FALSE );
167
+	OPTION_Show_Extended_PGN = CFG->readBoolEntry( "ShowExtendedPGN", FALSE );
168 168
 	OPTION_Auto_Call_Flag = CFG->readBoolEntry( "AutoCallFlag", TRUE );
169 169
 	Email_Command_Line = CFG->readEntry( "EmailCommandLine", TQString("kmail -s %s --attach %m %a") );
170 170
 	Accepted_License = CFG->readBoolEntry( "Alg2p", FALSE );

Loading…
Cancel
Save