From c9792a21add7beeb698ae43d71580e2943dac395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 16 Aug 2021 20:24:39 +0200 Subject: [PATCH] Added controlled conversions to char* instead of automatic ascii conversions. The definition of -UTQT_NO_ASCII_CAST is no longer needed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- CMakeLists.txt | 2 +- src/preferences.cpp | 2 +- src/qalculateexportcsvdialog.cpp | 2 +- src/qalculatefunctionsdialog.cpp | 2 +- src/qalculateresultdisplay.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80777ec..08602f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,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 "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) diff --git a/src/preferences.cpp b/src/preferences.cpp index e75ee66..c7d18f9 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -668,7 +668,7 @@ void save_preferences(bool mode) { filename += "qalculate-tde.cfg"; file = fopen(filename.c_str(), "w+"); if(file == NULL) { - fprintf(stderr, i18n("Couldn't write preferences to\n%s"), filename.c_str()); + fprintf(stderr, i18n("Couldn't write preferences to\n%s").local8Bit(), filename.c_str()); return; } fprintf(file, "\n[General]\n"); diff --git a/src/qalculateexportcsvdialog.cpp b/src/qalculateexportcsvdialog.cpp index a224ee8..7a2ffc6 100644 --- a/src/qalculateexportcsvdialog.cpp +++ b/src/qalculateexportcsvdialog.cpp @@ -152,7 +152,7 @@ void QalculateExportCSVDialog::slotOk() { } if(!CALCULATOR->exportCSV(*matrix_struct, str.ascii(), delimiter)) { TQString error_str; - error_str.sprintf(i18n("Could not export to file \n%s"), str.ascii()); + error_str.sprintf(i18n("Could not export to file \n%s").utf8(), str.ascii()); KMessageBox::error(this, error_str); reject(); } diff --git a/src/qalculatefunctionsdialog.cpp b/src/qalculatefunctionsdialog.cpp index d60c9be..7ea9e90 100644 --- a/src/qalculatefunctionsdialog.cpp +++ b/src/qalculatefunctionsdialog.cpp @@ -366,7 +366,7 @@ void QalculateFunctionsDialog::functionSelected() { str += "
"; if(f->subtype() == SUBTYPE_DATA_SET) { str += "
"; - str2.sprintf(i18n("Retrieves data from the %s data set for a given object and property. If \"info\" is typed as property, a dialog window will pop up with all properties of the object."), f->title().c_str()); + str2.sprintf(i18n("Retrieves data from the %s data set for a given object and property. If \"info\" is typed as property, a dialog window will pop up with all properties of the object.").utf8(), f->title().c_str()); str2.replace("<", "<"); str2.replace(">", ">"); str += str2; diff --git a/src/qalculateresultdisplay.cpp b/src/qalculateresultdisplay.cpp index 0c7ccdf..f5515a5 100644 --- a/src/qalculateresultdisplay.cpp +++ b/src/qalculateresultdisplay.cpp @@ -146,7 +146,7 @@ TQString linkInfo(const MathStructure *m, TQWidget *w, bool full_length = false) str += "
"; str += "
"; TQString str2; - str2.sprintf(i18n("Retrieves data from the %s data set for a given object and property. If \"info\" is typed as property, a dialog window will pop up with all properties of the object."), f->title().c_str()); + str2.sprintf(i18n("Retrieves data from the %s data set for a given object and property. If \"info\" is typed as property, a dialog window will pop up with all properties of the object.").utf8(), f->title().c_str()); str2.replace("<", "<"); str2.replace(">", ">"); str += str2;