summaryrefslogtreecommitdiffstats
path: root/kmymoney2
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2022-03-18 04:03:50 +0100
committerSlávek Banko <slavek.banko@axis.cz>2022-03-20 18:50:59 +0100
commit5ec229a4470f605eca53326853ff246a49e80189 (patch)
tree5b40a3f1189bdd4307d903f13235fe6ba7081c46 /kmymoney2
parent49e34b02b0bb609ce6e9ff1d2d96bdfcb03617d1 (diff)
downloadkmymoney-5ec229a4470f605eca53326853ff246a49e80189.tar.gz
kmymoney-5ec229a4470f605eca53326853ff246a49e80189.zip
Enforce the use of TQt with STL only where it is necessary.
The definition of -UTQT_NO_STL is no longer needed. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit f3fd991c693316d26e360438eff8ecff8a54553d)
Diffstat (limited to 'kmymoney2')
-rw-r--r--kmymoney2/converter/convertertest.cpp2
-rw-r--r--kmymoney2/mymoney/mymoneymoney.h13
-rw-r--r--kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp12
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragesql.cpp12
-rw-r--r--kmymoney2/reports/pivottabletest.cpp4
-rw-r--r--kmymoney2/reports/querytabletest.cpp10
6 files changed, 35 insertions, 18 deletions
diff --git a/kmymoney2/converter/convertertest.cpp b/kmymoney2/converter/convertertest.cpp
index 9766e2d..f8a5568 100644
--- a/kmymoney2/converter/convertertest.cpp
+++ b/kmymoney2/converter/convertertest.cpp
@@ -204,6 +204,6 @@ void ConverterTest::testDateFormat()
}
catch (MyMoneyException* e)
{
- CPPUNIT_FAIL(e->what());
+ CPPUNIT_FAIL(e->what().local8Bit().data());
}
}
diff --git a/kmymoney2/mymoney/mymoneymoney.h b/kmymoney2/mymoney/mymoneymoney.h
index 97534b5..bbf500b 100644
--- a/kmymoney2/mymoney/mymoneymoney.h
+++ b/kmymoney2/mymoney/mymoneymoney.h
@@ -40,17 +40,10 @@
#include <kmymoney/export.h>
#include <kmymoney/mymoneyexception.h>
-// Check for standard definitions
-#ifdef HAVE_STDINT_H
- #ifndef __STDC_LIMIT_MACROS
- #define __STDC_LIMIT_MACROS // force definition of min and max values
- #endif
- #include <stdint.h>
-#else
- #include <limits.h>
- #define INT64_MAX LLONG_MAX
- #define INT64_MIN LLONG_MIN
+#ifndef __STDC_LIMIT_MACROS
+ #define __STDC_LIMIT_MACROS // force definition of min and max values
#endif
+#include <inttypes.h>
typedef int64_t signed64;
typedef uint64_t unsigned64;
diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp
index 98b6286..ced8e9a 100644
--- a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp
+++ b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp
@@ -15,6 +15,12 @@
* *
***************************************************************************/
+// force to use TQt with STL
+#if defined(TQT_NO_STL)
+# define DISABLE_TQT_NO_STL
+# undef TQT_NO_STL
+#endif
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -1883,3 +1889,9 @@ void MyMoneyDatabaseMgr::removeReferences(const TQString& id)
#undef TRY
#undef CATCH
#undef PASS
+
+// restore TQT_NO_STL
+#if defined(DISABLE_TQT_NO_STL)
+# undef DISABLE_TQT_NO_STL
+# define TQT_NO_STL
+#endif
diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
index e5914bb..952db4f 100644
--- a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
+++ b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
@@ -16,6 +16,12 @@
* *
***************************************************************************/
+// force to use TQt with STL
+#if defined(TQT_NO_STL)
+# define DISABLE_TQT_NO_STL
+# undef TQT_NO_STL
+#endif
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -4503,3 +4509,9 @@ const TQString MyMoneyDbDatetimeColumn::generateDDL (databaseTypeE dbType) const
if (isNotNull()) qs += " NOT NULL";
return qs;
}
+
+// restore TQT_NO_STL
+#if defined(DISABLE_TQT_NO_STL)
+# undef DISABLE_TQT_NO_STL
+# define TQT_NO_STL
+#endif
diff --git a/kmymoney2/reports/pivottabletest.cpp b/kmymoney2/reports/pivottabletest.cpp
index cb86a39..6edf5ac 100644
--- a/kmymoney2/reports/pivottabletest.cpp
+++ b/kmymoney2/reports/pivottabletest.cpp
@@ -121,7 +121,7 @@ void PivotTableTest::testNetWorthSingle()
}
catch(MyMoneyException *e)
{
- CPPUNIT_FAIL(e->what());
+ CPPUNIT_FAIL(e->what().local8Bit().data());
delete e;
}
}
@@ -938,7 +938,7 @@ void PivotTableTest::testInvestment(void)
}
catch(MyMoneyException *e)
{
- CPPUNIT_FAIL(e->what());
+ CPPUNIT_FAIL(e->what().local8Bit().data());
delete e;
}
}
diff --git a/kmymoney2/reports/querytabletest.cpp b/kmymoney2/reports/querytabletest.cpp
index 458589d..39037d1 100644
--- a/kmymoney2/reports/querytabletest.cpp
+++ b/kmymoney2/reports/querytabletest.cpp
@@ -283,7 +283,7 @@ void QueryTableTest::testQueryBasics()
}
catch(MyMoneyException *e)
{
- CPPUNIT_FAIL(e->what());
+ CPPUNIT_FAIL(e->what().local8Bit().data());
delete e;
}
@@ -429,7 +429,7 @@ void QueryTableTest::testAccountQuery()
}
catch(MyMoneyException *e)
{
- CPPUNIT_FAIL(e->what());
+ CPPUNIT_FAIL(e->what().local8Bit().data());
delete e;
}
}
@@ -605,7 +605,7 @@ void QueryTableTest::testInvestment(void)
}
catch(MyMoneyException *e)
{
- CPPUNIT_FAIL(e->what());
+ CPPUNIT_FAIL(e->what().local8Bit().data());
delete e;
}
}
@@ -659,7 +659,7 @@ void QueryTableTest::testInvestment(void)
}
catch(MyMoneyException *e)
{
- CPPUNIT_FAIL(e->what());
+ CPPUNIT_FAIL(e->what().local8Bit().data());
delete e;
}
@@ -690,7 +690,7 @@ void QueryTableTest::testTaxReport()
TQString html = qtbl_3.renderHTML();
CPPUNIT_ASSERT(rows.count() == 1);
} catch(MyMoneyException *e) {
- CPPUNIT_FAIL(e->what());
+ CPPUNIT_FAIL(e->what().local8Bit().data());
delete e;
}
}