diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2018-11-04 12:39:40 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2018-11-04 12:43:15 +0100 |
commit | 6ca21693d592267199f780156930c2de92d25e30 (patch) | |
tree | 79fc3db4bf244115847fd773bb7fa58dd50275d1 | |
parent | 76fb9f08873a6808bd4d07d327549b7441b7758d (diff) | |
download | kdirstat-6ca21693d592267199f780156930c2de92d25e30.tar.gz kdirstat-6ca21693d592267199f780156930c2de92d25e30.zip |
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>
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | kdirstat/kcleanup.cpp | 6 | ||||
-rw-r--r-- | kdirstat/kdirsaver.cpp | 4 | ||||
-rw-r--r-- | kdirstat/kdirstatapp.cpp | 4 | ||||
-rw-r--r-- | kdirstat/kdirtree.cpp | 6 | ||||
-rw-r--r-- | kdirstat/kdirtreeview.cpp | 8 |
6 files changed, 15 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6eb345f..abea8b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ include( ConfigureChecks.cmake ) ###### global compiler settings -add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST ) +add_definitions( -DHAVE_CONFIG_H ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" ) diff --git a/kdirstat/kcleanup.cpp b/kdirstat/kcleanup.cpp index 146d7b9..a6e2694 100644 --- a/kdirstat/kcleanup.cpp +++ b/kdirstat/kcleanup.cpp @@ -36,7 +36,7 @@ KCleanup::KCleanup( TQString id, : TDEAction( title, 0, // accel parent, - id ) + id.utf8() ) , _id ( id ) , _command ( command ) @@ -312,9 +312,9 @@ KCleanup::expandVariables( const KFileInfo * item, TQString expanded = unexpanded; expanded.replace( TQRegExp( "%p" ), - "\"" + TQString::fromLocal8Bit( item->url() ) + "\"" ); + "\"" + item->url() + "\"" ); expanded.replace( TQRegExp( "%n" ), - "\"" + TQString::fromLocal8Bit( item->name() ) + "\"" ); + "\"" + item->name() + "\"" ); if ( KDE::versionMajor() >= 3 && KDE::versionMinor() >= 4 ) expanded.replace( TQRegExp( "%t" ), "trash:/" ); diff --git a/kdirstat/kdirsaver.cpp b/kdirstat/kdirsaver.cpp index 2f1b79d..f86596b 100644 --- a/kdirstat/kdirsaver.cpp +++ b/kdirstat/kdirsaver.cpp @@ -49,7 +49,7 @@ KDirSaver::cd( const TQString & newPath ) { if ( ! newPath.isEmpty() ) { - chdir( newPath ); + chdir( newPath.local8Bit() ); } } @@ -64,7 +64,7 @@ KDirSaver::currentDirPath() const void KDirSaver::restore() { - chdir( oldWorkingDir.path() ); + chdir( oldWorkingDir.path().local8Bit() ); } diff --git a/kdirstat/kdirstatapp.cpp b/kdirstat/kdirstatapp.cpp index 5ec99df..af86b36 100644 --- a/kdirstat/kdirstatapp.cpp +++ b/kdirstat/kdirstatapp.cpp @@ -524,7 +524,7 @@ void KDirStatApp::editCopy() { if ( _treeView->selection() ) - kapp->clipboard()->setText( TQString::fromLocal8Bit(_treeView->selection()->orig()->url()) ); + kapp->clipboard()->setText(_treeView->selection()->orig()->url()); #if 0 #warning debug @@ -568,7 +568,7 @@ KDirStatApp::selectionChanged( KFileInfo *selection ) else _fileContinueReadingAtMountPoint->setEnabled( false ); - statusMsg( TQString::fromLocal8Bit(selection->url()) ); + statusMsg(selection->url()); } else { diff --git a/kdirstat/kdirtree.cpp b/kdirstat/kdirtree.cpp index fd2ecb2..a4aafd2 100644 --- a/kdirstat/kdirtree.cpp +++ b/kdirstat/kdirtree.cpp @@ -859,7 +859,7 @@ KLocalDirReadJob::startReading() struct stat statInfo; TQString dirName = _dir->url(); - if ( ( _diskDir = opendir( dirName ) ) ) + if ( ( _diskDir = opendir( dirName.local8Bit() ) ) ) { _tree->sendProgressInfo( dirName ); _dir->setReadState( KDirReading ); @@ -873,7 +873,7 @@ KLocalDirReadJob::startReading() { TQString fullName = dirName + "/" + entryName; - if ( lstat( fullName, &statInfo ) == 0 ) // lstat() OK + if ( lstat( fullName.local8Bit(), &statInfo ) == 0 ) // lstat() OK { if ( S_ISDIR( statInfo.st_mode ) ) // directory child? { @@ -957,7 +957,7 @@ KLocalDirReadJob::stat( const KURL & url, { struct stat statInfo; - if ( lstat( url.path(), &statInfo ) == 0 ) // lstat() OK + if ( lstat( url.path().local8Bit(), &statInfo ) == 0 ) // lstat() OK { TQString name = parent ? url.filename() : url.path(); diff --git a/kdirstat/kdirtreeview.cpp b/kdirstat/kdirtreeview.cpp index f18fc9d..6eb9657 100644 --- a/kdirstat/kdirtreeview.cpp +++ b/kdirstat/kdirtreeview.cpp @@ -1010,7 +1010,7 @@ KDirTreeViewItem::init( KDirTreeView * view, } else { - setText( view->nameCol(), TQString::fromLocal8Bit(_orig->name()) ); + setText( view->nameCol(), _orig->name() ); if ( ! _orig->isDevice() ) { @@ -1526,9 +1526,9 @@ KDirTreeViewItem::asciiDump() { TQString dump; - dump.sprintf( "%10s %s\n", - (const char *) formatSize( _orig->totalSize() ), - (const char *) _orig->debugUrl() ); + dump = TQString("%1 %2\n") + .arg(formatSize(_orig->totalSize()), 10) + .arg(_orig->debugUrl().local8Bit()); if ( isOpen() ) { |