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>
Slávek Banko 5 months ago
parent
commit
6ca21693d5
Signed by: Slávek Banko <slavek.banko@axis.cz> GPG Key ID: 608F5293A04BE668
6 changed files with 15 additions and 15 deletions
  1. 1
    1
      CMakeLists.txt
  2. 3
    3
      kdirstat/kcleanup.cpp
  3. 2
    2
      kdirstat/kdirsaver.cpp
  4. 2
    2
      kdirstat/kdirstatapp.cpp
  5. 3
    3
      kdirstat/kdirtree.cpp
  6. 4
    4
      kdirstat/kdirtreeview.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 "-Wl,--no-undefined" )

+ 3
- 3
kdirstat/kcleanup.cpp View File

@@ -36,7 +36,7 @@ KCleanup::KCleanup( TQString		id,
36 36
     : TDEAction( title,
37 37
 	       0,	// accel
38 38
 	       parent,
39
-	       id )
39
+	       id.utf8() )
40 40
     
41 41
     , _id	( id	  )
42 42
     , _command	( command )
@@ -312,9 +312,9 @@ KCleanup::expandVariables( const KFileInfo *	item,
312 312
     TQString expanded = unexpanded;
313 313
 
314 314
     expanded.replace( TQRegExp( "%p" ),
315
-		      "\"" + TQString::fromLocal8Bit( item->url() )  + "\"" );
315
+		      "\"" + item->url() + "\"" );
316 316
     expanded.replace( TQRegExp( "%n" ),
317
-		      "\"" + TQString::fromLocal8Bit( item->name() ) + "\"" );
317
+		      "\"" + item->name() + "\"" );
318 318
 
319 319
     if ( KDE::versionMajor() >= 3 && KDE::versionMinor() >= 4 )
320 320
 	expanded.replace( TQRegExp( "%t" ), "trash:/" );

+ 2
- 2
kdirstat/kdirsaver.cpp View File

@@ -49,7 +49,7 @@ KDirSaver::cd( const TQString & newPath )
49 49
 {
50 50
     if ( ! newPath.isEmpty() )
51 51
     {
52
-	chdir( newPath );
52
+	chdir( newPath.local8Bit() );
53 53
     }
54 54
 }
55 55
 
@@ -64,7 +64,7 @@ KDirSaver::currentDirPath() const
64 64
 void
65 65
 KDirSaver::restore()
66 66
 {
67
-    chdir( oldWorkingDir.path() );
67
+    chdir( oldWorkingDir.path().local8Bit() );
68 68
 }
69 69
 
70 70
 

+ 2
- 2
kdirstat/kdirstatapp.cpp View File

@@ -524,7 +524,7 @@ void
524 524
 KDirStatApp::editCopy()
525 525
 {
526 526
     if ( _treeView->selection() )
527
-	kapp->clipboard()->setText( TQString::fromLocal8Bit(_treeView->selection()->orig()->url()) );
527
+	kapp->clipboard()->setText(_treeView->selection()->orig()->url());
528 528
 
529 529
 #if 0
530 530
 #warning debug
@@ -568,7 +568,7 @@ KDirStatApp::selectionChanged( KFileInfo *selection )
568 568
 	else
569 569
 	    _fileContinueReadingAtMountPoint->setEnabled( false );
570 570
 
571
-	statusMsg( TQString::fromLocal8Bit(selection->url()) );
571
+	statusMsg(selection->url());
572 572
     }
573 573
     else
574 574
     {

+ 3
- 3
kdirstat/kdirtree.cpp View File

@@ -859,7 +859,7 @@ KLocalDirReadJob::startReading()
859 859
     struct stat		statInfo;
860 860
     TQString		dirName	 = _dir->url();
861 861
 
862
-    if ( ( _diskDir = opendir( dirName ) ) )
862
+    if ( ( _diskDir = opendir( dirName.local8Bit() ) ) )
863 863
     {
864 864
 	_tree->sendProgressInfo( dirName );
865 865
 	_dir->setReadState( KDirReading );
@@ -873,7 +873,7 @@ KLocalDirReadJob::startReading()
873 873
 	    {
874 874
 		TQString fullName = dirName + "/" + entryName;
875 875
 
876
-		if ( lstat( fullName, &statInfo ) == 0 )	// lstat() OK
876
+		if ( lstat( fullName.local8Bit(), &statInfo ) == 0 )	// lstat() OK
877 877
 		{
878 878
 		    if ( S_ISDIR( statInfo.st_mode ) )	// directory child?
879 879
 		    {
@@ -957,7 +957,7 @@ KLocalDirReadJob::stat( const KURL & 	url,
957 957
 {
958 958
     struct stat statInfo;
959 959
 
960
-    if ( lstat( url.path(), &statInfo ) == 0 )		// lstat() OK
960
+    if ( lstat( url.path().local8Bit(), &statInfo ) == 0 )		// lstat() OK
961 961
     {
962 962
 	TQString name = parent ? url.filename() : url.path();
963 963
 

+ 4
- 4
kdirstat/kdirtreeview.cpp View File

@@ -1010,7 +1010,7 @@ KDirTreeViewItem::init( KDirTreeView *		view,
1010 1010
     }
1011 1011
     else
1012 1012
     {
1013
-	setText( view->nameCol(), TQString::fromLocal8Bit(_orig->name()) );
1013
+	setText( view->nameCol(), _orig->name() );
1014 1014
 
1015 1015
 	if ( ! _orig->isDevice() )
1016 1016
 	{
@@ -1526,9 +1526,9 @@ KDirTreeViewItem::asciiDump()
1526 1526
 {
1527 1527
     TQString dump;
1528 1528
 
1529
-    dump.sprintf( "%10s  %s\n",
1530
-		  (const char *) formatSize( _orig->totalSize() ),
1531
-		  (const char *) _orig->debugUrl() );
1529
+    dump = TQString("%1  %2\n")
1530
+		.arg(formatSize(_orig->totalSize()), 10)
1531
+		.arg(_orig->debugUrl().local8Bit());
1532 1532
 
1533 1533
     if ( isOpen() )
1534 1534
     {

Loading…
Cancel
Save