summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2025-08-04 03:29:51 +0300
committerAlexander Golubev <fatzer2@gmail.com>2025-08-05 02:24:46 +0300
commita6ab7f1c6dcf3076aa5488a790d81f42cbc93b48 (patch)
tree398109d81d95d7b01032abd655fc0340aa91479c /src/tests
parent19201b658c807f6ffa3c9dcaa02c90b38312e2d7 (diff)
downloadkrecipes-master.tar.gz
krecipes-master.zip
Use TQImage rather than TQPixmap in the backend-oriented codeHEADmaster
TQImage is more suitable for i/o operations and long-term storage rather than TQPixmap (which is better for immediate display on the screen). The UI rarely does displays all those photos and does it one-by-one (i.e. there is no big gallery), so there is no significant performance penalty for the use of TQImage. On the contrary this way we should save some memory on allocations associated X11 stuff for pixmaps and loading time when the database contains a lot of photos. Note that there is yet another use of TQPixmap in `htmlexporter` which cannot be replaced because it uses TQPainter, which didn't supported QImage until Qt5. Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/CMakeLists.txt3
-rw-r--r--src/tests/checks.h2
-rw-r--r--src/tests/kretest.cpp4
3 files changed, 4 insertions, 5 deletions
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 0b5495d..27f85ce 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -45,8 +45,7 @@ endfunction()
##### kretest (executable)
-# The test needs X11 for TQPixmap to run, hence not running it automatically
-tde_add_check_executable( kretest AUTOMOC
+tde_add_check_executable( kretest AUTOMOC TEST
SOURCES kretest.cpp
LINK
krecipesexporters-static krecipesimporters-static
diff --git a/src/tests/checks.h b/src/tests/checks.h
index 618d0c0..5409a33 100644
--- a/src/tests/checks.h
+++ b/src/tests/checks.h
@@ -66,7 +66,7 @@ bool check(const TQString &txt, double a, double b)
return true;
}
-bool check(const TQString &txt, const TQPixmap &a, const TQPixmap &b)
+bool check(const TQString &txt, const TQImage &a, const TQImage &b)
{
if ( a.size() != b.size() ) {
diff --git a/src/tests/kretest.cpp b/src/tests/kretest.cpp
index 93c1e1e..9b48e74 100644
--- a/src/tests/kretest.cpp
+++ b/src/tests/kretest.cpp
@@ -28,8 +28,8 @@ main(int argc, char *argv[])
TDEAboutData *about = new TDEAboutData("kretest", I18N_NOOP("kretest"), "1.0",
nullptr, TDEAboutData::License_GPL, nullptr, nullptr, nullptr, nullptr);
TDECmdLineArgs::init(argc, argv, about);
- // The test needs GUI for TQPixmap
- TDEApplication a;
+ TDEApplication::disableAutoDcopRegistration(); // will reduce noise when we run without X11
+ TDEApplication a(/* allowStyles =*/ false, /* GUIenabled =*/ false);
printf("Creating KreImporter.\n");
KreImporter importer;