summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-11-02 22:33:43 +0100
committerSlávek Banko <slavek.banko@axis.cz>2020-11-05 18:50:24 +0100
commitaca58384d909cd450bae59a6f46679d8cbb3606a (patch)
tree570e5f599175ac15434d0c87a5a4173a3ade0c55
parent26de10618a0767658160762b87f1ec2c9c1cbc26 (diff)
downloadktechlab-aca58384d909cd450bae59a6f46679d8cbb3606a.tar.gz
ktechlab-aca58384d909cd450bae59a6f46679d8cbb3606a.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> (cherry picked from commit 2c73ccdf45212ab2a43582955be0eff21c70f971)
-rw-r--r--CMakeLists.txt2
-rw-r--r--microbe/instruction.cpp6
-rw-r--r--microbe/main.cpp4
-rw-r--r--microbe/pic14.cpp2
-rw-r--r--src/itemdocument.cpp14
-rw-r--r--src/itemdocumentdata.cpp4
-rw-r--r--src/ktechlab.cpp2
-rw-r--r--src/languages/language.cpp2
-rw-r--r--src/textdocument.cpp2
-rw-r--r--src/view.cpp4
-rw-r--r--src/viewcontainer.cpp8
11 files changed, 27 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 247022e..72fb829 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,7 +62,7 @@ include( ConfigureChecks.cmake )
###### global compiler settings
-add_definitions( -DHAVE_CONFIG_H -UQT_NO_ASCII_CAST )
+add_definitions( -DHAVE_CONFIG_H )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
diff --git a/microbe/instruction.cpp b/microbe/instruction.cpp
index 26332c0..2a77b98 100644
--- a/microbe/instruction.cpp
+++ b/microbe/instruction.cpp
@@ -517,8 +517,8 @@ bool RegisterState::operator == ( const RegisterState & state ) const
void RegisterState::print()
{
- cout << " known="<<binary(known)<<endl;
- cout << " value="<<binary(value)<<endl;
+ cout << " known=" << binary(known).local8Bit() << endl;
+ cout << " value=" << binary(value).local8Bit() << endl;
}
//END class RegisterState
@@ -714,7 +714,7 @@ void ProcessorState::print()
RegisterMap::iterator end = m_registers.end();
for ( RegisterMap::iterator it = m_registers.begin(); it != end; ++it )
{
- cout << " " << it.key().name() << ":\n";
+ cout << " " << it.key().name().local8Bit() << ":\n";
it.data().print();
}
}
diff --git a/microbe/main.cpp b/microbe/main.cpp
index 7b6d5ab..affa666 100644
--- a/microbe/main.cpp
+++ b/microbe/main.cpp
@@ -64,14 +64,14 @@ int main(int argc, char **argv)
if ( !errorReport.isEmpty() )
{
- cerr << mb.errorReport();
+ cerr << mb.errorReport().local8Bit();
return 1; // If there was an error, don't write the output to file.
}
else
{
ofstream out(args->arg(1));
- out << s;
+ out << s.local8Bit();
return 0;
}
}
diff --git a/microbe/pic14.cpp b/microbe/pic14.cpp
index 5c92ef3..1ac4c27 100644
--- a/microbe/pic14.cpp
+++ b/microbe/pic14.cpp
@@ -135,7 +135,7 @@ PIC14::Type PIC14::toType( const TQString & _text )
if ( text == "16F628" )
return P16F628;
- cerr << TQString("%1 is not a known PIC identifier\n").arg(_text);
+ cerr << TQString("%1 is not a known PIC identifier\n").arg(_text).local8Bit();
return unknown;
}
diff --git a/src/itemdocument.cpp b/src/itemdocument.cpp
index 9a73877..7ed27dd 100644
--- a/src/itemdocument.cpp
+++ b/src/itemdocument.cpp
@@ -811,7 +811,7 @@ void ItemDocument::exportToImage()
// we need an object so we can retrieve which image type was selected by the user
// so setup the filedialog.
- KFileDialog exportDialog(TQString(), "*.png|PNG Image\n*.bmp|BMP Image\n*.svg|SVG Image" , p_ktechlab, i18n("Export As Image"), true, cropCheck);
+ KFileDialog exportDialog(TQString(), "*.png|PNG Image\n*.bmp|BMP Image\n*.svg|SVG Image" , p_ktechlab, i18n("Export As Image").utf8(), true, cropCheck);
exportDialog.setOperationMode( KFileDialog::Saving );
// now actually show it
@@ -911,21 +911,25 @@ void ItemDocument::exportToImage()
if ( cropCheck->isChecked() )
{
if( type == "SVG" )
- saveResult = dynamic_cast<TQPicture*>(outputImage)->save( url.path(), type);
+ saveResult = dynamic_cast<TQPicture*>(outputImage)->save(url.path(), type.utf8());
else
{
TQImage img = dynamic_cast<TQPixmap*>(outputImage)->convertToImage();
img = img.copy(cropArea);
- saveResult = img.save(url.path(),type);
+ saveResult = img.save(url.path(), type.utf8());
}
}
else
{
if ( type=="SVG" )
- saveResult = dynamic_cast<TQPicture*>(outputImage)->save( url.path(), type );
+ {
+ saveResult = dynamic_cast<TQPicture*>(outputImage)->save(url.path(), type.utf8());
+ }
else
- saveResult = dynamic_cast<TQPixmap*>(outputImage)->save( url.path(), type );
+ {
+ saveResult = dynamic_cast<TQPixmap*>(outputImage)->save(url.path(), type.utf8());
+ }
}
//if(saveResult == true) KMessageBox::information( this, i18n("Sucessfully exported to \"%1\"").arg( url.filename() ), i18n("Image Export") );
diff --git a/src/itemdocumentdata.cpp b/src/itemdocumentdata.cpp
index c0efc5d..669d1c8 100644
--- a/src/itemdocumentdata.cpp
+++ b/src/itemdocumentdata.cpp
@@ -683,7 +683,7 @@ void ItemDocumentData::elementToConnectorData( TQDomElement element )
ConnectorData connectorData;
- connectorData.manualRoute = element.attribute( "manual-route", "0" );
+ connectorData.manualRoute = element.attribute("manual-route", "0").toInt();
TQString route = element.attribute( "route", "" );
TQStringList points = TQStringList::split( ",", route );
@@ -992,7 +992,7 @@ void ItemDocumentData::mergeWithDocument( ItemDocument *itemDocument, bool selec
{
if ( !it.data().type.isEmpty() && !itemDocument->itemWithID( it.key() ) )
{
- Item *item = itemLibrary()->createItem( it.data().type, itemDocument, false, it.key(), false );
+ Item *item = itemLibrary()->createItem(it.data().type, itemDocument, false, it.key().utf8(), false);
if ( item && !itemDocument->isValidItem(item) )
{
kdWarning() << "Attempted to create invalid item with id: " << it.key() << endl;
diff --git a/src/ktechlab.cpp b/src/ktechlab.cpp
index e0294e1..ff35a0e 100644
--- a/src/ktechlab.cpp
+++ b/src/ktechlab.cpp
@@ -592,7 +592,7 @@ void KTechlab::slotDragContextActivated( int id )
TDEAction * KTechlab::action( const TQString & name ) const
{
- TDEAction * action = actionCollection()->action(name);
+ TDEAction * action = actionCollection()->action(name.utf8());
if ( !action )
kdError() << k_funcinfo << "No such action: " << name << endl;
return action;
diff --git a/src/languages/language.cpp b/src/languages/language.cpp
index 67afac4..2395ecb 100644
--- a/src/languages/language.cpp
+++ b/src/languages/language.cpp
@@ -27,7 +27,7 @@
//BEGIN class Language
Language::Language( ProcessChain *processChain, KTechlab *parent, const TQString &name )
- : TQObject(parent,name)
+ : TQObject(parent, name.utf8())
{
p_ktechlab = parent;
p_processChain = processChain;
diff --git a/src/textdocument.cpp b/src/textdocument.cpp
index ae4bfe7..9de69e8 100644
--- a/src/textdocument.cpp
+++ b/src/textdocument.cpp
@@ -605,7 +605,7 @@ void TextDocument::slotUpdateMarksInfo()
{
TDEAction * a = new TDEAction( i18n("%1 - %2").arg( TQString::number( mark->line+1 ) ).arg( m_doc->textLine(mark->line) ),
0, this, TQT_SLOT(slotBookmarkRequested()), this,
- TQString("bookmark_%1").arg(TQString::number(mark->line).ascii()) );
+ TQString("bookmark_%1").arg(TQString::number(mark->line)).latin1() );
m_bookmarkActions.append(a);
}
}
diff --git a/src/view.cpp b/src/view.cpp
index 81f88b7..52d2417 100644
--- a/src/view.cpp
+++ b/src/view.cpp
@@ -61,7 +61,7 @@ class KVSSBSep : public TQWidget {
//BEGIN class View
View::View( Document *document, ViewContainer *viewContainer, uint viewAreaId, const char *name )
- : TQWidget( viewContainer->viewArea(viewAreaId), name ? name : (const char *)("view_" + TQString::number(viewAreaId)) ),
+ : TQWidget( viewContainer->viewArea(viewAreaId), name ? name : TQString("view_%1").arg(TQString::number(viewAreaId)).latin1() ),
KXMLGUIClient()
{
m_dcopID = 0;
@@ -103,7 +103,7 @@ View::~View()
TDEAction * View::action( const TQString & name ) const
{
- TDEAction * action = actionCollection()->action(name);
+ TDEAction * action = actionCollection()->action(name.utf8());
if ( !action )
kdError() << k_funcinfo << "No such action: " << name << endl;
return action;
diff --git a/src/viewcontainer.cpp b/src/viewcontainer.cpp
index 980eccb..594a473 100644
--- a/src/viewcontainer.cpp
+++ b/src/viewcontainer.cpp
@@ -412,8 +412,8 @@ ViewArea *ViewArea::createViewArea( Position position, uint id )
setOrientation( ( position == Right ) ? Qt::Horizontal : Qt::Vertical );
- p_viewArea1 = new ViewArea( this, p_viewContainer, m_id, (const char*)("viewarea_"+TQString::number(m_id)) );
- p_viewArea2 = new ViewArea( this, p_viewContainer, id, (const char*)("viewarea_"+TQString::number(id)) );
+ p_viewArea1 = new ViewArea(this, p_viewContainer, m_id, TQString("viewarea_%1").arg(TQString::number(m_id)).latin1());
+ p_viewArea2 = new ViewArea(this, p_viewContainer, id, TQString("viewarea_%1").arg(TQString::number(id)).latin1());
connect( p_viewArea1, TQT_SIGNAL(destroyed(TQObject* )), this, TQT_SLOT(viewAreaDestroyed(TQObject* )) );
connect( p_viewArea2, TQT_SIGNAL(destroyed(TQObject* )), this, TQT_SLOT(viewAreaDestroyed(TQObject* )) );
@@ -559,7 +559,7 @@ void ViewArea::restoreState( TDEConfig *config, int id, const TQString &groupNam
if ( contains.size() >= 1 )
{
int viewArea1Id = contains[0];
- p_viewArea1 = new ViewArea( this, p_viewContainer, viewArea1Id, (const char*)("viewarea_"+TQString::number(viewArea1Id)) );
+ p_viewArea1 = new ViewArea(this, p_viewContainer, viewArea1Id, TQString("viewarea_%1").arg(TQString::number(viewArea1Id)).latin1());
connect( p_viewArea1, TQT_SIGNAL(destroyed(TQObject* )), this, TQT_SLOT(viewAreaDestroyed(TQObject* )) );
p_viewArea1->restoreState( config, viewArea1Id, groupName );
p_viewArea1->show();
@@ -568,7 +568,7 @@ void ViewArea::restoreState( TDEConfig *config, int id, const TQString &groupNam
if ( contains.size() >= 2 )
{
int viewArea2Id = contains[1];
- p_viewArea2 = new ViewArea( this, p_viewContainer, viewArea2Id, (const char*)("viewarea_"+TQString::number(viewArea2Id)) );
+ p_viewArea2 = new ViewArea(this, p_viewContainer, viewArea2Id, TQString("viewarea_%1").arg(TQString::number(viewArea2Id)).latin1());
connect( p_viewArea2, TQT_SIGNAL(destroyed(TQObject* )), this, TQT_SLOT(viewAreaDestroyed(TQObject* )) );
p_viewArea2->restoreState( config, viewArea2Id, groupName );
p_viewArea2->show();