diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2020-11-02 22:33:43 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-11-02 22:33:47 +0100 |
commit | 2c73ccdf45212ab2a43582955be0eff21c70f971 (patch) | |
tree | 4754dd610c96338dc39ca60e38a7e794ef6c6966 /src | |
parent | f23df438132393cf20cb93f9922325dc49792573 (diff) | |
download | ktechlab-2c73ccdf45212ab2a43582955be0eff21c70f971.tar.gz ktechlab-2c73ccdf45212ab2a43582955be0eff21c70f971.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>
Diffstat (limited to 'src')
-rw-r--r-- | src/itemdocument.cpp | 14 | ||||
-rw-r--r-- | src/itemdocumentdata.cpp | 4 | ||||
-rw-r--r-- | src/ktechlab.cpp | 2 | ||||
-rw-r--r-- | src/languages/language.cpp | 2 | ||||
-rw-r--r-- | src/textdocument.cpp | 2 | ||||
-rw-r--r-- | src/view.cpp | 4 | ||||
-rw-r--r-- | src/viewcontainer.cpp | 8 |
7 files changed, 20 insertions, 16 deletions
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(); |