summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Simplify tests.xml filesHEADmasterPekka Vuorela2 days2-2233/+114
| | | | | | | | | | | | | | | | | | | | | | | | There shouldn't be really point in listing each test case inside a unit test, executing the test binary by default just executes everything within it. That's here lead to excessively verbose files which are painful to maintain and ensure all the tests are there. And evidently these were already missing tst_qmailaccountconfiguration tst_qmailstorageaction and tst_crypto. And no traces or protocol tests, though those don't really work good now. Now just having one test set and cases for each binary there. Removed environment details as those shouldn't really matter. Files identical except other having -qt5 on paths (which we should really handle e.g. via an .in file but that's for later). Disclaimer: not actually tested due to tests not supporting even installation now. Change-Id: I506c61959c0b1960d1056e7b38bbf184b964cb25 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Clean up service plugin signal connections - minor API changesPekka Vuorela4 days3-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | The states and signals were painful to follow due to bad naming and excessive overloading. Here: - Renamed some API to avoid overloading, help readability and allow new connect() syntax without resolving the overloads. - updateStatus() signals and slots renamed a bit to make it clearer what is a signal and what is a slot. And avoiding overloading QMailMessageService::updateStatus() to simplify signal connection. - Cleaned up QMailTranport API. It's not doing urls but hostnames and the signals were especially hard to follow - Use the new connect() syntax in messageserver side - Avoiding some protected: / virtual methods when there's nothing even able to inherit the class. - At least print SSL errors instead of signal that's not connected anywhere. - Some minor simplifications and code style adjustments. The SSL error handling is still funny but at least a bit easier to track. Change-Id: If168e15ef068fedee46b9401d695ed5dae7962ba Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Rename QMailMessageMetadata::content as contentCategoryPekka Vuorela4 days9-69/+69
| | | | | | | | | | | | | | | | | | | | The related functionality was confusing when setContent() didn't actually set any content but rather the type of it. Also there are other setContent() methods around that actually set the content. Then again calling this contentType() would have collided further in the inheritance tree by method returning a QMailMessageContentType which is referring to header fields. Thus switched this to a third distinct name. Old setter and getter names provided for backwards compatibility which should work at least for the very basic cases of setting and comparing type. Change-Id: I4c54548f3c2c85096fde64b3221e233dd3feefa3 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Fix running tst_qmailmessageheader and one test inside itPekka Vuorela4 days1-7/+8
| | | | | | | | | | | Commit 9da97137adae broke the output test by slightly shorter string. Went unnoticed as the whole test was marked passed no matter how many failures it had. Change-Id: I65d3321541d96bee0d7c56fd2fecaed84bb60b61 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Replace remaining 'Qt Extended' references with 'Qt Messaging Framework'Pekka Vuorela4 days1-1/+1
| | | | | | | Change-Id: I04d2c685c76dc3e72b16a6fb7eb82f2ab0e510c1 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Adjust again some smaller code detailsPekka Vuorela10 days1-1/+3
| | | | | | | | | | | | | | | - Wrap some overly long lines - Honor coding conventions better here and there - Use nullptr more instead of '0' - Switch remaining cases of Q_DECL_OVERRIDE and Q_NULLPTR to standard keywords. - Removed some unnecessary #includes - etc. Change-Id: Ia9a01807da88298a6c1c1bbb22c854743ed19429 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Fix tst_crypto and its setupPekka Vuorela10 days4-26/+30
| | | | | | | | | | | | | | The test wasn't included in cmake test, and it had trouble finding its resources in shadow build. The test data needed also a bit of changing which got missing here on commit c1e4c9728f80e36ed. Small other cleanups while at it. Change-Id: I74e38ef32afba1b36cc78cc2c69fde7f79f6b0ce Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Avoid some more qtopia referencesPekka Vuorela11 days1-2/+2
| | | | | | Change-Id: I36c493538d5c8b167e9bddf1979916773fc5f895 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Remove tests.xml references to removed testsPekka Vuorela12 days2-154/+0
| | | | | | | Change-Id: Id09f957ac460f4fcd68bc2d2c3d85078895e2da2 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Remove public cmake dbus declaration and usage in unit testPekka Vuorela12 days1-35/+0
| | | | | | | | | | | | | | Especially the part at the end of the unit test using QMailStoreNullImplementation seemed pointless when nothing was really checked from it. For the rest, the account addition is already tested so just removing the whole test method. Change-Id: Iec2110df67e66514f4853ea985e8e38fe198f37a Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Avoid cmake warning on symlinkPekka Vuorela2025-11-281-1/+1
| | | | | | | | | Force creating the link so it doesn't warn for such to already exist. Change-Id: I733508fa3d5403edb81c75027367e7acf25a7153 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Repurpose .pro files for qt5 support - almost worksPekka Vuorela2025-11-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | There's still need for having qt5 support out there and the .pro files don't anyway compile with qt6 by now. Adjusting those and the code to build on qt5 didn't even require much adjustments. The hack to get _p.h includes work without private prefix, that used to be there for qmake build, is horrible but at least it's relatively small and affecting only .pro files. The examples had some existing issues building there, missing includes and not entirely disabled protocol editor support. The "almost works" part: builds fine but the metatype side is slightly lacking, resulting also a unit test failure. On qt5 qmailipc.h would need qRegisterMetaTypeStreamOperators() call after qRegisterMetaType() but I'm not eager to add qt version ifdeffing inside a macro, at least now. Hoping to clean up the whole metatype registration first. Change-Id: I6e620175383690ce4e6eb4c841e314ccf031026f Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Make LongString construction more explicitPekka Vuorela2025-11-201-1/+1
| | | | | | | | | | | | | Strange API when bytearray parameter on ctor use the content but QString opens a file. Neither were even 'explicit'. Added 'explicit' and made the file opening use even more explicit static method. Change-Id: I41c6f91eba2adcc93aa534e1d4edff5f9fa9f907 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Rename tst_locks as tst_qmailaccountkey to match contentPekka Vuorela2025-11-199-71/+41
| | | | | | | | | | Not much locking here. There used to be one locking test case but the class got removed as unused in 2014, commit 7a314eb53ac. Change-Id: Ifc41ca6db63aab2291cbc4efa6c4d306fbf9a17e Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Use more standard paths for user data, remove QMail::tempPath()Pekka Vuorela2025-11-121-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid data root directly in home directory, rather use QStandardPaths. For backwards compatibility the old path is still used if it's there and the new one doesn't exist. QMail::tempPath() got removed. Evidently it's not much needed and shouldn't really exist. The qmfclient doesn't use it al all and generally apps should store their temporary things in their own places. It's rarely wanted that there would be a common place to store such. On the contrary, apps should play mostly in their own sandboxes. TempPath was used on the server side but mostly either wrong or unnecessary: - requests file is messageserver app specific, shouldn't be visible to others. - QMailMessageSource was using it wrong. New messages are added to database, not temp path. - LongStream with public cleanupTempFiles() could be dangerous if it was called by multiple processes and having a common directory. (Another story whether such an api should even exist though) - SMTP, IMAP and LongStream can live with more generic locations. The generic locations for the last ones are borderline whether it should be TempLocation or CacheLocation. For side: interestingly the usage is mostly storing content in files to save memory while Linux world with /tmp as tmpfs has moved to storing files in memory to make them faster. For now made smtp use temp location as that's a quite simple usage, while imap and longstream in cache dir as they do have some more complicated detaches and append usages, and they were earlier out of the actual /tmp. Did some simplifications to LongStream and a proper error case handling to smtp client out of space error while at it. Change-Id: If52de231082085d804939002371f5a407cd0fecd Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Adjust installation pathsPekka Vuorela2025-11-111-0/+3
| | | | | | | | | | | | | | | | Install headers and plugins to qt6 directory as it should have been long time already. Didn't touch .pro files as those don't work with current qt6 and are used more with qt5 build. Use common common 'messagingframework' container dir for plugins. The plugin type directly under qt plugins dir was confusing, and possibly even colliding with other qt plugins. Crypto at least seems used by qt itself. Change-Id: I2c674ba184a53d602dc2a1fc24f83a955268a166 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Avoid qFatal in imap clientPekka Vuorela2025-11-012-6/+0
| | | | | | | | | | | Nicer if plugins don't try to make the whole messagingserver to exit. Removed also a couple qtopia references, an if() check that's guaranteed to succeed and did some more simplifications on servicehandler. Change-Id: Ibf98d57d86cd4f183f40d71b712ca1539f17b755 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Remove QPrivateImplementationPekka Vuorela2025-10-297-333/+0
| | | | | | | | | Everything is now migrated to common Qt ways. Change-Id: Ic310067bc6ed46743bfcf6c5d667cc65ab6893e3 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Polish QMailMessage classes, and something small elsewherePekka Vuorela2025-10-273-11/+0
| | | | | | | | | | | | | | | | | | | | - Made setBody() virtual and avoid dynamic_cast to check which type of instance was used - Cleaned up some cosmetic details, fixed typos etc - Restricted some variable scopes - Renamed some global constants with UpperCase name - Commented out some dead code - Use nullptr instead of NULL or 0 - Renamed vague "void QMailMessagePart::defaultContentType()" - Made attachment methods in QMailMessagePartContainer virtual. The implementation does some dynamic_casts to check the type of the instance, which would rather be better as overridden implementation. Didn't do that yet, but the virtuals should avoid a later ABI break if/when such is done. Change-Id: Ia7dc212a1b609d0b02c2cc269082a0e39667c157 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Remove empty test methodsPekka Vuorela2025-10-273-241/+1
| | | | | | | | | | Should be obvious enough that setter and getter are tested with a single test case etc. Change-Id: Ie64d1e48cd27ee1f30d7c006d6dd4f469e73cf95 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Remove deprecated retrieveAll requestPekka Vuorela2025-10-151-1/+0
| | | | | | | Change-Id: I3d973ca81b5dcf532233aa97c1065f93c6bb840e Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Remove QMail::messageServerPath() and messageSettingsPath()Pekka Vuorela2025-10-156-93/+0
| | | | | | | | | | | | | | | | | | | Not used in the library itself and the implementations don't make too much sense: the paths are using QCoreApplication::applicationDirPath() referring the random client app binary path so there's no much idea where the qmf content really is. There is some use for the server path in an example project, perhaps even proving how little it makes sense as it tries to launch a specific hard-coded binary from the directory. If something, the API should have a method for requesting launching the messageserver. Change-Id: I9b4b245e5c17f2e49fe3b9ed8b30cb175c5e8e45 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Use conventional qt pimplification on QMailMessageSetPekka Vuorela2025-10-151-1/+1
| | | | | | | | | | | | | | No much reason here either to use the custom QPrivate. The whole class set is quite funky and IMO subject for deletion, or moving to qwidgets side with FolderModel, but for starters now just avoiding now the custom pimplification in hope of getting rid of that soon. Change-Id: I5fe24574d5b9e3c24e944c6c8ae78b1f2f958bc1 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Clean up ImapClientPekka Vuorela2025-10-141-1/+0
| | | | | | | | | | | | | | | | - Some switches were mixing return; and break; without any actual difference between them. - retrieveMessages() accountCheck parameter was named wrong in declaration vs implementation - Some slot parameters were declared const but implementation not having such. - Simplified error handling in a method to consistently handle error first instead of nesting deeper into ifs. Change-Id: I99b2528b20db9bbdf801bc7dbe361cc7b361b9f8 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Remove more unnecessary usage of core5compatPekka Vuorela2025-10-1422-26/+25
| | | | | | | | | | | | | | Besides QTextCodec in a couple places, the remaining use was just - Couple simple QRegExps in protocol plugins. - QLinkedList in messageserver. QList should be good enough for that. Also spotted one ancient symbian test file and cleaned up some minor details. Change-Id: I348fd8d54ca3a6a6fcba1a757f33c7b490661706 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Remove some dead code and clean up a bitPekka Vuorela2025-10-111-2/+0
| | | | | | | | | | Some internal mail service command helpers have been dead for long time. For USE_ALTERNATE_MAILSTORE_IMPLEMENTATION only some references in 2010. Change-Id: I6bf8efb76f4f4e6b1877e7fe617c5c7b2370d8b3 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Pass function out parameters as pointers instead of refsPekka Vuorela2025-10-113-9/+6
| | | | | | | | | Even if minor internal function, it's easier to follow. Change-Id: I7a13f4c3e36c878213ca668e1895c15f60d4cfeb Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Replace QmfList usage with QListPekka Vuorela2025-10-085-314/+0
| | | | | | | | | | | | QmfList was added on Qt6 migration as stopgap because of QList changes on iterator & content pointer details. Most of that seems to related to QMailMessageThreadedModel which now uses internally std::list. Doesn't seem that great stuff to begin with. Change-Id: I7c37cf69256273138e29001688de742c1d7ad40f Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Fix slightly off indent, adjust enum style and minor detailsPekka Vuorela2025-10-012-3/+5
| | | | | | | Change-Id: I4ad9396f40535fdf4b010af76e121f1339698e50 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Avoid (explicit) QmfList outside the libraryPekka Vuorela2025-09-291-24/+31
| | | | | | | | | | | | | | | | | Paving the way to get rid of the QmfList which was added sort of stopgap on Qt6 migration because of the QList changes. - Imap plugin using for() loop which should work for any container type returned by the methods. - tst_qmailstore unit test just getting the list of addresses after we are sure those won't change. A few more lines but avoids the custom type. - On previous changed also indexing fully 0 based to keep it more robust. "Hi 0" type of subjects shouldn't really matter on tests. Change-Id: I7a74dbe7654d5f3dd80435d5bf9af110b875b03a Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Avoid failing on expected unit test failures, and some cleanupsPekka Vuorela2025-09-299-31/+8
| | | | | | | | | | | | | | | | - Imap test is marked insignicant in .pro but that allows success also, cmake's WILL_FAIL doesn't. Comment out latter to avoid unexpected failure. - Instead of failing, skip tst_qmailstorageaction if there's no messageserver running as such is not there with simple 'make test'. - Removed some qtopia style file references, adjusted cosmetic details, added/removed #includes depending on whether needed or not. Avoiding some pointless trinary operators. Change-Id: Ia7f2fd8e7c7318a138e1cb043f1da436902943c0 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Deprecate Fwd classes in favor of just introducing enums in real classesPekka Vuorela2025-09-2612-64/+63
| | | | | | | | | | | | | | | | | | | | | | | The Fwd classes were inherited by the actual classes, allowing to #include only the fwd and not the bigger real class header. Such a compilation time micro optimization shouldn't really be worth complicating the API. Thus just moved the enum content to actual classes. For some backwards compatibility made the Fwd classes typedeffed to the real ones. Crypto side didn't even have a proper class, only the Fwd and suppose all the usage of the code just did include anyway for the whole crypto api. The QMailFolderFwd::PredefinedFolderId was having a cyclic dependency when moved to QMailFolder: QMailFolderId ctor variant was depending on it and QMailFolder was depending on the Id. Moved the predefined id to the Id class which feels like a better home anyway. Change-Id: I9a9aa9c407ae90cc11b37179fe417e3a002ce94b Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: <matti.viljanen@kapsi.fi>
* Use qDeleteAll() more and some more cosmetic cleanupsPekka Vuorela2025-09-262-6/+3
| | | | | | | | | | For interesting detail ServiceActionQueue::clear() seemed badly done and likely leaking memory. Change-Id: Ibeb429bd46957dc1bac9e56f2bc8889a2e64b191 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Clean up some cosmetic detailsPekka Vuorela2025-09-1925-174/+109
| | | | | | | | | | | | | | | | | | | Mostly coding conventions here. - Method opening braces to their own lines - Adjusted some inconsistent init list styles - Removed some redundant static declarations inside anon namespace - Replaced one delete loop with qDeleteAll() - Remove some trailing extra new lines - Added some missing spaces after commas - for (), if (), switch as common qt style - Removed some unnecessary scopes within switch cases Etc. Change-Id: Ide9ad7fea6f5fce3b854af2bf05874623c474028 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Adjust tst_qmailmessagepart content-disposition expectationPekka Vuorela2025-09-184-3/+6
| | | | | | | | | | | | | Commit c5a923b12d749 made empty Content-Disposition be skipped but didn't touch the unit test. While at it added some notes to cmake files of unit tests which are expected to fail and have such notice in the .pro file. Change-Id: Ia51777e03598e1e50ed0b29cb98f070357c9865c Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Rename QMailMessage::setInResponseToDamien Caliste2025-07-271-4/+4
| | | | | | | | | | | | Because of automatic conversion from MessageId to Message, the calls to setInResponseTo(id) are interpreted as setInResponseTo(msg), making it infinitely recurring. Avoid this kind of issues by renaming the newly introduced function in QMailMessage to setReplyReferences(). Change-Id: I2acb1b6a7a6277c3685eabe757a6e9b11e798d06 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Setup references header when replying to a messageDamien Caliste2025-06-231-0/+28
| | | | | | | | | Add a convenient function in QMailMessage to properly compute the In-Reply-to: and References: headers when replying to a message. Change-Id: Ibe962383d95e101b612258eb0ced980fef7e7203 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Add a read receipt constructorDamien Caliste2025-06-161-0/+45
| | | | | | | | | | Add a constructor for a QMailMessage as a read receipt for a given message. The message is created according to RFC8098 as a multipart/report message. Change-Id: I41b70fd40e5f7e0a92e04cd92c387542b47686ce Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Rewrite logging with QLoggingCategoryDamien Caliste2025-06-1312-476/+8
| | | | | | | | | Replace the custom logging mechanism with QLoggingCategory. Also declare the warnings with the proper category. Change-Id: If87d53d27ea0c65abd434af9f99fe49ce634d6dd Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Add missing spaces after for/if/while/switchPekka Vuorela2025-05-093-5/+5
| | | | | | | Change-Id: I57c6ed78099b3359a16ce807da95325e755f0197 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Remove trailing whitespace with sed scriptPekka Vuorela2025-05-0913-459/+459
| | | | | | | Change-Id: Iebfffe7a6d5b2db40f0508ecd7c8ccddfa6665a6 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Introduce an API handling external accountsDamien Caliste2025-05-061-6/+7
| | | | | | | | | | | The new QMailAccountManager API is used by the mail store to deal with accounts, when provided. By default, the existing SQL handling of the accounts is used. Change-Id: Ided2132ce8bfc7a4efebff90cbb2a727134f8fda Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Move SQL-related parts into a dedicated classDamien Caliste2025-05-061-4/+4
| | | | | | | | | | Cut QMailStorePrivate into two: - one new class that is handling SQL-related actions, - the remaining part, containing the cache and the notifications. Change-Id: Ide3f70a5da8e85b465dc0ccd07a4bc15e549f519 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Declare tests in the build systemDamien Caliste2025-04-0231-16/+131
| | | | | | | | | | | | | | | | | | Tests can be run with `ctest`. The `--verbose` option makes the output of each test visible. Fix also minor failures: - make qlogsystem test locale independent, - make qmailstore test properly listening to the messagePropertyUpdated() signal. IMAP, POP and SMTP tests are declared as always failing for the moment, since they try to connect to a mail server (but they are still useful for debug purposes). Change-Id: I7ae548110a8eeb37bd07b031a8433d38ea53529e Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Add signal testing for QMailStoreDamien Caliste2025-03-261-0/+41
| | | | | Change-Id: I2f3a3e790480b37e7c85d536b88e8621036fd2b5 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Return an invalid service when not foundDamien Caliste2025-03-171-0/+5
| | | | | | | | | | | | If a QMailAccountConfiguration does not have a given service, and does not have the configuration to create it, it must return an invalid ::ServiceConfiguration object, instead of the undefined value of the terminated iterator. Change-Id: Ic7dd5b56ddd876ef8a48ea00fbb8f279f765062d Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Guido Berhoerster <guido+qt@berhoerster.name>
* Remove custom implementation for mime type database, small api breakPekka Vuorela2025-02-252-7/+4
| | | | | | | | | | | | | There's been QMimeDatabase and friends since Qt 5.0. Guess this implementation precedes that. Shouldn't be needed anymore. This is a small API break but migration to Qt api should be simple and likely the usage was only internal. Change-Id: I6d4b6bfd45ad040bd4c6e2b29afc5607a0d3615c Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* New ServiceConfiguration API to use string listsDamien Caliste2025-02-195-0/+144
| | | | | | | | | | | | Some configuration values require a string list, like the scopes in OAuth2 protocol for authentication. String list can be serialized to string, but instead of doing it at each place it is needed, this patch introduces a way to do it at the ServiceConfiguration level. Change-Id: I1741d41ecf60a4e07087e2744916eb2065d6710c Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Move LongStream to server library, streamline the implementationPekka Vuorela2025-02-116-15/+16
| | | | | | | | | | | | | | | | | | The qmfclient was using this just to get storage info, which is somewhat out of scope for the class api anyway. And also the "errorMessage" meaning out-of-space error was bad API. Got rid of OS specific storage calculation in favor of QStorageInfo and streamlined the error string method. To me the implementation feels like trying a bit too much to check the available space, but I'll not touch that now. Change-Id: Ice4256c0cdf3fa3dc52c1354ab07a433862e66ae Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Remove obsolete file locking methodsGuido Berhoerster2025-02-032-21/+1
| | | | | | | | | Add new method QMail::isMessageServerRunning() as clients have checked the message server lock file in order to determine whether the server was running. Change-Id: I0fcc55ae1d4d96a484257ece0c4fdd1bcf0b20d6 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>