diff options
| author | Damien Caliste <dcaliste@free.fr> | 2024-10-11 10:24:53 +0200 |
|---|---|---|
| committer | Damien Caliste <dcaliste@free.fr> | 2024-10-17 12:36:56 +0200 |
| commit | b1879636a46fc5523dab24824a391130690a93d3 (patch) | |
| tree | 802dfcda24149fae0f1df7b0dae4f6adb952ddbf | |
| parent | 7f47e037dbfaf9e3ecb38fbf2093a14d621e25eb (diff) | |
Add CMake build system
Adjust source code where necessary like:
- #include <private/...> cannot be used since
private is the installation path, but not
the path used in the sources,
- fix map definition in qmailservice.xml,
- had to add #include <qmailstore.h> to
qmailserviceaction.h since qt_add_dbus_adaptor
can only include one header,
- add a method using QDBusVariant in
ServiceHandler so the adaptor can call it.
Change-Id: Idbecf4214dffdf523ccd8558370e8d2854b5d99a
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
97 files changed, 1036 insertions, 145 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..312083f4 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.16) + +project(QtMessagingFramework + VERSION 4.0.4 + DESCRIPTION "a C++ library and daemon server process to build email clients") + +set(CMAKE_AUTOMOC ON) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_CXX_STANDARD 11) + +option(BUILD_WIDGETS "Build widgets" OFF) +option(BUILD_MESSAGESERVER_PLUGINS "Build plugins for the message server" ON) +option(USE_HTML_PARSER "Use HTML parser to handle rich text" OFF) + +include(FeatureSummary) +include(GNUInstallDirs) +include(CTest) + +find_package(PkgConfig REQUIRED) + +find_package(Qt6 REQUIRED COMPONENTS Core Xml DBus Sql Network Test Core5Compat OPTIONAL_COMPONENTS LinguistTools) +if(BUILD_WIDGETS) +find_package(Qt6 REQUIRED COMPONENTS Widgets) +endif() +if(USE_HTML_PARSER) +find_package(Qt6 REQUIRED COMPONENTS Gui) +endif() +pkg_check_modules(ICU icu-i18n IMPORTED_TARGET) + +add_subdirectory(src) +add_subdirectory(tests) +add_subdirectory(benchmarks) +add_subdirectory(examples) + +if (TARGET Qt6::LinguistTools) + qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES ar de en_GB en_SU en_US es fr it ja ko pt_BR zh_CN zh_TW) +endif() + +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt new file mode 100644 index 00000000..25f290b0 --- /dev/null +++ b/benchmarks/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(tst_messageserver) diff --git a/benchmarks/tst_messageserver/CMakeLists.txt b/benchmarks/tst_messageserver/CMakeLists.txt new file mode 100644 index 00000000..105020a6 --- /dev/null +++ b/benchmarks/tst_messageserver/CMakeLists.txt @@ -0,0 +1,25 @@ +set(QMF_SOURCES + ../../src/plugins/messageservices/imap/imapconfiguration.h + ../../src/plugins/messageservices/imap/imapconfiguration.cpp) + +add_executable(tst_messageserver + benchmarkcontext.h + qscopedconnection.h + testfsusage.h + testmalloc.h + 3rdparty/cycle_p.h + benchmarkcontext.cpp + qscopedconnection.cpp + testfsusage.cpp + testmalloc.cpp + tst_messageserver.cpp + ${QMF_SOURCES}) +target_include_directories(tst_messageserver + PRIVATE + ../../src/tools/messageserver + ../../src/plugins/messageservices/imap) +target_link_libraries(tst_messageserver + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient MessageServer) + +install(TARGETS tst_messageserver + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/benchmarks/tst_messageserver/benchmarkcontext.cpp b/benchmarks/tst_messageserver/benchmarkcontext.cpp index 0155c6ed..a275138d 100644 --- a/benchmarks/tst_messageserver/benchmarkcontext.cpp +++ b/benchmarks/tst_messageserver/benchmarkcontext.cpp @@ -51,6 +51,7 @@ #include <QCoreApplication> #include <qmaillog.h> #include <QDir> +#include <QElapsedTimer> #include <QTest> #undef HAVE_TICK_COUNTER // not useful for this test @@ -60,7 +61,7 @@ class BenchmarkContextPrivate public: bool xml; qint64 qmfUsage; - QTime time; + QElapsedTimer time; #ifdef HAVE_TICK_COUNTER CycleCounterTicks ticks; #endif diff --git a/benchmarks/tst_messageserver/testmalloc.cpp b/benchmarks/tst_messageserver/testmalloc.cpp index 9a50288b..5f5a4ac5 100644 --- a/benchmarks/tst_messageserver/testmalloc.cpp +++ b/benchmarks/tst_messageserver/testmalloc.cpp @@ -110,7 +110,7 @@ int TestMalloc::peakUsable() { if (!D) TestMallocPrivate::init(); if (D->valid) - return D->peak_usable.load(); + return D->peak_usable.loadRelaxed(); else return -1; } @@ -119,7 +119,7 @@ int TestMalloc::peakTotal() { if (!D) TestMallocPrivate::init(); if (D->valid) - return D->peak_total.load(); + return D->peak_total.loadRelaxed(); else return -1; } @@ -128,7 +128,7 @@ int TestMalloc::nowUsable() { if (!D) TestMallocPrivate::init(); if (D->valid) - return D->now_usable.load(); + return D->now_usable.loadRelaxed(); else return -1; } @@ -137,7 +137,7 @@ int TestMalloc::nowTotal() { if (!D) TestMallocPrivate::init(); if (D->valid) - return D->now_usable.load() + D->now_overhead.load(); + return D->now_usable.loadRelaxed() + D->now_overhead.loadRelaxed(); else return -1; } @@ -145,15 +145,15 @@ int TestMalloc::nowTotal() void TestMalloc::resetPeak() { if (!D) TestMallocPrivate::init(); - D->peak_usable.fetchAndStoreOrdered(D->now_usable.load()); - D->peak_total.fetchAndStoreOrdered(D->now_usable.load() + D->now_overhead.load()); + D->peak_usable.fetchAndStoreOrdered(D->now_usable.loadRelaxed()); + D->peak_total.fetchAndStoreOrdered(D->now_usable.loadRelaxed() + D->now_overhead.loadRelaxed()); } void TestMalloc::resetNow() { if (!D) TestMallocPrivate::init(); - D->now_usable.store(0); - D->now_overhead.store(0); + D->now_usable.storeRelaxed(0); + D->now_overhead.storeRelaxed(0); } #ifndef __MALLOC_HOOK_VOLATILE @@ -171,8 +171,8 @@ void TestMallocPrivate::init() */ struct mallinfo info = mallinfo(); static TestMallocPrivate testmalloc; - testmalloc.now_usable.store(info.uordblks); - testmalloc.now_overhead.store(0); /* cannot get this figure, but should be close to 0. */ + testmalloc.now_usable.storeRelaxed(info.uordblks); + testmalloc.now_overhead.storeRelaxed(0); /* cannot get this figure, but should be close to 0. */ TestMalloc::resetPeak(); testmalloc.selftest(); @@ -200,7 +200,7 @@ void TestMallocPrivate::afterMorecore() void TestMallocPrivate::selftest() { - int before = this->now_usable.load(); + int before = this->now_usable.loadRelaxed(); int during; int after; char* array = 0; @@ -209,10 +209,10 @@ void TestMallocPrivate::selftest() ba.resize(512); array = new char[512]; - during = this->now_usable.load(); + during = this->now_usable.loadRelaxed(); } delete [] array; - after = this->now_usable.load(); + after = this->now_usable.loadRelaxed(); if (!(during >= before+1024)) { qWarning("Heap usage measurement fail: heap before byte array was %d, during was %d (expected at least %d). Heap usage will not be measured.", before, during, before + 1024); @@ -233,11 +233,11 @@ void TestMallocPrivate::selftest() void TestMallocPrivate::updatePeak() { - if (now_usable.load() > peak_usable.load()) { - peak_usable.fetchAndStoreOrdered(now_usable.load()); + if (now_usable.loadRelaxed() > peak_usable.loadRelaxed()) { + peak_usable.fetchAndStoreOrdered(now_usable.loadRelaxed()); } - if (now_usable.load() + now_overhead.load() > peak_total.load()) { - peak_total.fetchAndStoreOrdered(now_usable.load() + now_overhead.load()); + if (now_usable.loadRelaxed() + now_overhead.loadRelaxed() > peak_total.loadRelaxed()) { + peak_total.fetchAndStoreOrdered(now_usable.loadRelaxed() + now_overhead.loadRelaxed()); } } @@ -316,8 +316,8 @@ extern "C" void free(void* in) REF; __libc_free(in); if (D && oldsize) { - D->now_usable.fetchAndAddOrdered(-oldsize); - D->now_overhead.fetchAndAddOrdered(-CHUNK_OVERHEAD); + D->now_usable.fetchAndSubOrdered(oldsize); + D->now_overhead.fetchAndSubOrdered(CHUNK_OVERHEAD); D->updatePeak(); } DEREF; diff --git a/benchmarks/tst_messageserver/tst_messageserver.cpp b/benchmarks/tst_messageserver/tst_messageserver.cpp index d2c5c330..961e04c4 100644 --- a/benchmarks/tst_messageserver/tst_messageserver.cpp +++ b/benchmarks/tst_messageserver/tst_messageserver.cpp @@ -767,7 +767,7 @@ int main(int argc, char** argv) This is because we intend to fork() later on and we don't want to have to process events for the sake of the child process. */ - QApplication app(argc, argv); + QCoreApplication app(argc, argv); int iters = 1; bool verbose = false; diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 1199629e..93661a6a 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -10,14 +10,5 @@ machine_type: instructions: Build: - - type: EnvironmentVariable - variableName: SOURCE_DIR - variableValue: "{{.SourceDir}}" - - type: SetBuildDirectory - directory: "{{.AgentWorkingDir}}/build" - - type: MakeDirectory - directory: "{{.BuildDir}}" - - type: ChangeDirectory - directory: "{{.BuildDir}}" - #- !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml" + - !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml" Test: [] diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 00000000..9c3777c5 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,5 @@ +if(BUILD_WIDGETS) + add_subdirectory(serverobserver) + add_subdirectory(qtmail) + add_subdirectory(messagingaccounts) +endif() diff --git a/examples/messagingaccounts/CMakeLists.txt b/examples/messagingaccounts/CMakeLists.txt new file mode 100644 index 00000000..0251c51d --- /dev/null +++ b/examples/messagingaccounts/CMakeLists.txt @@ -0,0 +1,6 @@ +qt_add_resources(SRC messagingaccounts.qrc) + +add_executable(messagingaccounts5 ${SRC} main_messagingaccounts.cpp) +target_include_directories(messagingaccounts5 PRIVATE ../qtmail) +target_link_libraries(messagingaccounts5 + PUBLIC Qt6::Core QtMail) diff --git a/examples/qtmail/CMakeLists.txt b/examples/qtmail/CMakeLists.txt new file mode 100644 index 00000000..a97c4130 --- /dev/null +++ b/examples/qtmail/CMakeLists.txt @@ -0,0 +1,58 @@ +set(HEADERS + emailclient.h + messagelistview.h + searchview.h + selectcomposerwidget.h + readmail.h + writemail.h + accountsettings.h + editaccount.h + statusmonitorwidget.h + statusbar.h + statusmonitor.h + qmailcomposer.h + qmailviewer.h + attachmentlistwidget.h + detailspage_p.h + emailcomposer.h + attachmentoptions.h + browserwidget.h + genericviewer.h) + +set(SRC + emailclient.cpp + messagelistview.cpp + searchview.cpp + selectcomposerwidget.cpp + readmail.cpp + writemail.cpp + accountsettings.cpp + editaccount.cpp + statusmonitorwidget.cpp + statusbar.cpp + statusmonitor.cpp + qmailcomposer.cpp + qmailviewer.cpp + attachmentlistwidget.cpp + detailspage.cpp + emailcomposer.cpp + attachmentoptions.cpp + browserwidget.cpp + genericviewer.cpp) + +qt_add_resources(SRC qtmail.qrc) +qt_wrap_ui(SRC searchviewbasephone.ui) + +add_library(QtMail ${SRC} ${HEADERS}) +target_include_directories(QtMail + PUBLIC + ../../src/libraries/qmfclient + ../../src/libraries/qmfclient/support + ../../src/libraries/qmfmessageserver + ../../src/libraries/qmfwidgets) +target_link_libraries(QtMail + PUBLIC Qt6::Core Qt6::Core5Compat Qt6::Widgets QmfClient QmfMessageServer QmfWidgets) + +add_executable(qtmail5 main.cpp) +target_link_libraries(qtmail5 + PUBLIC Qt6::Core QtMail) diff --git a/examples/qtmail/accountsettings.h b/examples/qtmail/accountsettings.h index 82314663..4f2ec914 100644 --- a/examples/qtmail/accountsettings.h +++ b/examples/qtmail/accountsettings.h @@ -57,7 +57,7 @@ class AccountSettings : public QDialog { Q_OBJECT public: - AccountSettings(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = 0); + AccountSettings(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::Widget); signals: void deleteAccount(const QMailAccountId &id); diff --git a/examples/qtmail/attachmentlistwidget.cpp b/examples/qtmail/attachmentlistwidget.cpp index 2cd1e5ad..fe496fe8 100644 --- a/examples/qtmail/attachmentlistwidget.cpp +++ b/examples/qtmail/attachmentlistwidget.cpp @@ -448,10 +448,14 @@ void AttachmentListWidget::addAttachment(const QString& attachment) void AttachmentListWidget::addAttachments(const QStringList& attachments) { - QSet<QString> newAttachments = attachments.toSet() - m_attachments.toSet(); - + QStringList newAttachments; + for (const QString &attachment : attachments) { + if (!m_attachments.contains(attachment)) { + newAttachments << attachment; + } + } if (!newAttachments.isEmpty()) { - m_attachments += newAttachments.toList(); + m_attachments += newAttachments; m_model->setAttachments(m_attachments); setVisible(!m_model->isEmpty()); diff --git a/examples/qtmail/attachmentoptions.cpp b/examples/qtmail/attachmentoptions.cpp index 94a7265a..ce225f10 100644 --- a/examples/qtmail/attachmentoptions.cpp +++ b/examples/qtmail/attachmentoptions.cpp @@ -163,7 +163,7 @@ ImageDisplay::ImageDisplay(QWidget* parent) QVBoxLayout* vb = new QVBoxLayout(this); vb->addWidget(_area); - vb->setMargin(0); + vb->setContentsMargins(0, 0, 0, 0); vb->setSpacing(0); connect(_sizeToFit, SIGNAL(triggered()), this, SLOT(sizeToFit())); diff --git a/examples/qtmail/browserwidget.cpp b/examples/qtmail/browserwidget.cpp index 3a2775b9..a1212be6 100644 --- a/examples/qtmail/browserwidget.cpp +++ b/examples/qtmail/browserwidget.cpp @@ -1034,14 +1034,14 @@ QString appendLine(const QString& preceding, const QString& suffix) QString result(preceding); - int nwsIndex = QRegExp("[^\\s]").indexIn(suffix); + int nwsIndex = suffix.indexOf(QRegularExpression("[^\\s]")); if (nwsIndex > 0) { // This line starts with whitespace, which we'll have to protect to keep // We can't afford to make huge tracts of whitespace; ASCII art will be broken! // Convert any run of up to 4 spaces to a tab; convert all tabs to two spaces each QString leader(suffix.left(nwsIndex)); - leader.replace(QRegExp(" {1,4}"), "\t"); + leader.replace(QRegularExpression(" {1,4}"), "\t"); // Convert the spaces to non-breaking leader.replace("\t", " "); @@ -1055,7 +1055,7 @@ QString appendLine(const QString& preceding, const QString& suffix) QString unwrap(const QString& txt, const QString& prepend) { - QStringList lines = txt.split('\n', QString::KeepEmptyParts); + QStringList lines = txt.split('\n', Qt::KeepEmptyParts); QString result; result.reserve(txt.length()); @@ -1071,7 +1071,7 @@ QString unwrap(const QString& txt, const QString& prepend) if (prev == lines.begin()) continue; } else { - int wsIndex = (*it).indexOf(QRegExp("\\s")); + int wsIndex = (*it).indexOf(QRegularExpression("\\s")); if (wsIndex == 0) { // This was probably an intentional newline } else { @@ -1208,7 +1208,7 @@ QString BrowserWidget::buildParagraph(const QString& txt, const QString& prepend if (preserveWs) return input.replace('\n', "<br>"); - QStringList p = input.split( ' ', QString::SkipEmptyParts ); + QStringList p = input.split( ' ', Qt::SkipEmptyParts ); return p.join(QString(' ')); } @@ -1223,7 +1223,7 @@ QString BrowserWidget::encodeUrlAndMail(const QString& txt) // We should be optimistic in our URL matching - the link resolution can // always fail, but if we don't match it, then we can't make it into a link - QRegExp urlPattern("(" + QRegularExpression urlPattern("(" "(?:http|https|ftp)://" "|" "mailto:" @@ -1251,21 +1251,24 @@ QString BrowserWidget::encodeUrlAndMail(const QString& txt) "\\*\\+\\-\\/\\=\\?\\^\\_\\`" "\\{\\|\\}\\~\\&\\(\\)]*" ")?"); + QRegularExpressionMatch urlMatch; // Find and encode file:// links - QRegExp filePattern("(file://\\S+)"); + QRegularExpression filePattern("(file://\\S+)"); + QRegularExpressionMatch fileMatch; // Find and encode email addresses - QRegExp addressPattern(QMailAddress::emailAddressPattern()); + QRegularExpression addressPattern(QMailAddress::emailAddressPattern()); + QRegularExpressionMatch addressMatch; - int urlPos = urlPattern.indexIn(txt); - int addressPos = addressPattern.indexIn(txt); - int filePos = filePattern.indexIn(txt); + int urlPos = txt.indexOf(urlPattern, 0, &urlMatch); + int addressPos = txt.indexOf(addressPattern, 0, &fileMatch); + int filePos = txt.indexOf(filePattern, 0, &addressMatch); - int lastPos = 0; + int lastPos = 0, matchLength = 0; while ((urlPos != -1) || (addressPos != -1) || (filePos != -1)) { int *matchPos = 0; - QRegExp *matchPattern = 0; + QRegularExpression *matchPattern = 0; // Which pattern has the first match? if ((urlPos != -1) && @@ -1273,16 +1276,19 @@ QString BrowserWidget::encodeUrlAndMail(const QString& txt) ((filePos == -1) || (filePos >= urlPos))) { matchPos = &urlPos; matchPattern = &urlPattern; + matchLength = urlMatch.capturedLength(0); } else if ((addressPos != -1) && ((urlPos == -1) || (urlPos >= addressPos)) && ((filePos == -1) || (filePos >= addressPos))) { matchPos = &addressPos; matchPattern = &addressPattern; + matchLength = addressMatch.capturedLength(0); } else if ((filePos != -1) && ((urlPos == -1) || (urlPos >= filePos)) && ((addressPos == -1) || (addressPos >= filePos))) { matchPos = &filePos; matchPattern = &filePattern; + matchLength = fileMatch.capturedLength(0); } else { Q_ASSERT(false); return QString(); @@ -1292,23 +1298,23 @@ QString BrowserWidget::encodeUrlAndMail(const QString& txt) if (matchPattern == &urlPattern) { // Is this a valid URL? - QString scheme = urlPattern.cap(1); - QString credentials = urlPattern.cap(2); - QString host(urlPattern.cap(3)); + QString scheme = urlMatch.captured(1); + QString credentials = urlMatch.captured(2); + QString host(urlMatch.captured(3)); // Ensure that the host is not purely a number // Also ignore credentials with no scheme if (scheme.isEmpty() && - ((host.indexOf(QRegExp("[^\\d\\.]")) == -1) || (!credentials.isEmpty()))) { + ((host.indexOf(QRegularExpression("[^\\d\\.]")) == -1) || (!credentials.isEmpty()))) { // Ignore this match - urlPos = urlPattern.indexIn(txt, urlPos + 1); + urlPos = txt.indexOf(urlPattern, urlPos + 1); continue; } else { char parenTypes[] = { '(', ')', '[', ']', '{', '}', '<', '>', '\0' }; QString leading; QString trailing; - QString url = urlPattern.cap(0); + QString url = urlMatch.captured(0); QChar firstChar(url.at(0)); QChar lastChar(url.at(url.length() - 1)); @@ -1342,11 +1348,11 @@ QString BrowserWidget::encodeUrlAndMail(const QString& txt) replacement = refUrl(url, scheme, leading, trailing); } } else if (matchPattern == &addressPattern) { - QString address = addressPattern.cap(0); + QString address = addressMatch.captured(0); replacement = refMailTo(QMailAddress(address)); } else if (matchPattern == &filePattern) { - QString file = filePattern.cap(0); + QString file = fileMatch.captured(0); replacement = refUrl(file, "file://", QString(), QString()); } @@ -1357,18 +1363,18 @@ QString BrowserWidget::encodeUrlAndMail(const QString& txt) result.append(replacement); // Find the following pattern match for this pattern - lastPos = *matchPos + matchPattern->cap(0).length(); - *matchPos = matchPattern->indexIn(txt, lastPos); + lastPos = *matchPos + matchLength; + *matchPos = txt.indexOf(*matchPattern, lastPos); // Bypass any other matches contained within the matched text if ((urlPos != -1) && (urlPos < lastPos)) { - urlPos = urlPattern.indexIn(txt, lastPos); + urlPos = txt.indexOf(urlPattern, lastPos); } if ((addressPos != -1) && (addressPos < lastPos)) { - addressPos = addressPattern.indexIn(txt, lastPos); + addressPos = txt.indexOf(addressPattern, lastPos); } if ((filePos != -1) && (filePos < lastPos)) { - filePos = filePattern.indexIn(txt, lastPos); + filePos = txt.indexOf(filePattern, lastPos); } } diff --git a/examples/qtmail/detailspage.cpp b/examples/qtmail/detailspage.cpp index d7595daf..f4b02d96 100644 --- a/examples/qtmail/detailspage.cpp +++ b/examples/qtmail/detailspage.cpp @@ -41,7 +41,6 @@ #include <qpixmap.h> #include <qtoolbutton.h> #include <qmenu.h> -#include <qdesktopwidget.h> #include <qevent.h> #include <qpushbutton.h> #include <QScrollArea> @@ -49,6 +48,7 @@ #include <qmailstore.h> #include <qmailaccount.h> #include <QApplication> +#include <QGuiApplication> static const QString placeholder("(no subject)"); @@ -121,7 +121,7 @@ DetailsPage::DetailsPage( QWidget *parent, const char *name ) // } const int margin = 2; - setMaximumWidth( qApp->desktop()->width() - 2 * margin ); + setMaximumWidth( QGuiApplication::primaryScreen()->geometry().width() - 2 * margin ); QGridLayout *l = new QGridLayout( this ); int rowCount = 0; diff --git a/examples/qtmail/editaccount.cpp b/examples/qtmail/editaccount.cpp index d542e607..df96f713 100644 --- a/examples/qtmail/editaccount.cpp +++ b/examples/qtmail/editaccount.cpp @@ -81,13 +81,13 @@ EditAccount::EditAccount(QWidget* parent, const char* name, Qt::WindowFlags fl) separator->setFrameStyle(QFrame::HLine); QFormLayout* formLayout = new QFormLayout; - formLayout->setMargin(6); + formLayout->setContentsMargins(6, 6, 6, 6); formLayout->setSpacing(4); formLayout->addRow(tr("Name"), accountNameInput); formLayout->addWidget(enabledCheckbox); QVBoxLayout* mainlayout = new QVBoxLayout(this); - mainlayout->setMargin(0); + mainlayout->setContentsMargins(0, 0, 0, 0); mainlayout->setSpacing(4); mainlayout->addLayout(formLayout); mainlayout->addWidget(separator); @@ -125,7 +125,7 @@ EditAccount::EditAccount(QWidget* parent, const char* name, Qt::WindowFlags fl) bottomLayout->addWidget(okButton); bottomLayout->addWidget(cancelButton); bottomLayout->setSpacing(4); - bottomLayout->setMargin(6); + bottomLayout->setContentsMargins(6, 6, 6, 6); mainlayout->addLayout(bottomLayout); } diff --git a/examples/qtmail/editaccount.h b/examples/qtmail/editaccount.h index 403e9479..e94e7b95 100644 --- a/examples/qtmail/editaccount.h +++ b/examples/qtmail/editaccount.h @@ -54,7 +54,7 @@ class EditAccount : public QDialog Q_OBJECT public: - EditAccount(QWidget* parent = Q_NULLPTR, const char* name = Q_NULLPTR, Qt::WindowFlags fl = 0); + EditAccount(QWidget* parent = Q_NULLPTR, const char* name = Q_NULLPTR, Qt::WindowFlags fl = Qt::Widget); void setAccount(QMailAccount *in, QMailAccountConfiguration* config); diff --git a/examples/qtmail/emailclient.cpp b/examples/qtmail/emailclient.cpp index 90d30668..67be6b3e 100644 --- a/examples/qtmail/emailclient.cpp +++ b/examples/qtmail/emailclient.cpp @@ -48,7 +48,7 @@ #include <qmailstore.h> #include <qmailtimestamp.h> #include <QApplication> -#include <QDesktopWidget> +#include <QGuiApplication> #include <QFile> #include <QGridLayout> #include <QHBoxLayout> @@ -638,14 +638,10 @@ void EmailClient::setVisible(bool visible) if(visible) { QPoint p(0, 0); - int extraw = 0, extrah = 0, scrn = 0; + const QScreen *scrn = QGuiApplication::primaryScreen(); + int extraw = 0, extrah = 0; QRect desk; - if (QApplication::desktop()->isVirtualDesktop()) { - scrn = QApplication::desktop()->screenNumber(QCursor::pos()); - } else { - scrn = QApplication::desktop()->screenNumber(this); - } - desk = QApplication::desktop()->availableGeometry(scrn); + desk = scrn->availableGeometry(); QWidgetList list = QApplication::topLevelWidgets(); for (int i = 0; (extraw == 0 || extrah == 0) && i < list.size(); ++i) { @@ -1720,7 +1716,9 @@ void EmailClient::deleteSelectedMessages() if(!localOnlyIds.isEmpty()) { QMailStore::instance()->removeMessages(QMailMessageKey::id(localOnlyIds)); - deleteList = (deleteList.toSet().subtract(localOnlyIds.toSet())).toList(); + for (const QMailMessageId &id : localOnlyIds) { + deleteList.removeAll(id); + } } if(!deleteList.isEmpty()) storageAction("Deleting messages..")->deleteMessages(deleteList); @@ -2008,7 +2006,7 @@ void EmailClient::flagRetrievalActivityChanged(QMailServiceAction::Activity acti // Are there pending message IDS to be checked? if (!flagMessageIds.isEmpty()) { - m_flagRetrievalAction->retrieveMessages(flagMessageIds.toList(), QMailRetrievalAction::Flags); + m_flagRetrievalAction->retrieveMessages(QList<QMailMessageId>(flagMessageIds.begin(), flagMessageIds.end()), QMailRetrievalAction::Flags); flagMessageIds.clear(); } } @@ -2304,7 +2302,7 @@ void EmailClient::retrieveVisibleMessagesFlags() if (m_flagRetrievalAction->isRunning()) { // There is a flag retrieval already ocurring; save these IDs to be checked afterwards - flagMessageIds += ids.toSet(); + flagMessageIds += QSet<QMailMessageId>(ids.begin(), ids.end()); } else { m_flagRetrievalAction->retrieveMessages(ids, QMailRetrievalAction::Flags); } @@ -2879,10 +2877,10 @@ void EmailClient::nextMessage() { QWidget *list = messageListView()->findChild<QWidget*>("messagelistview"); if (list) { - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Down, 0)); - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Down, 0)); - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, 0)); - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Enter, 0)); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier)); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Down, Qt::NoModifier)); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier)); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Enter, Qt::NoModifier)); } } @@ -2890,10 +2888,10 @@ void EmailClient::previousMessage() { QWidget *list = messageListView()->findChild<QWidget*>("messagelistview"); if (list) { - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Up, 0)); - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Up, 0)); - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, 0)); - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Enter, 0)); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier)); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Up, Qt::NoModifier)); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier)); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Enter, Qt::NoModifier)); } } @@ -2901,8 +2899,8 @@ void EmailClient::nextUnreadMessage() { QWidget *list = messageListView()->findChild<QWidget*>("messagelistview"); if (list) { - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Plus, 0, "+")); - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Plus, 0, "+")); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Plus, Qt::NoModifier, "+")); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Plus, Qt::NoModifier, "+")); } } @@ -2910,10 +2908,10 @@ void EmailClient::previousUnreadMessage() { QWidget *list = messageListView()->findChild<QWidget*>("messagelistview"); if (list) { - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Minus, 0, "-")); - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Minus, 0, "-")); - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, 0)); - QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Enter, 0)); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Minus, Qt::NoModifier, "-")); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Minus, Qt::NoModifier, "-")); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier)); + QApplication::postEvent(list, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Enter, Qt::NoModifier)); } } @@ -2922,8 +2920,8 @@ void EmailClient::scrollReaderDown() QWidget *renderer = readMailWidget()->findChild<QWidget*>("renderer"); if (renderer) { - QApplication::postEvent(renderer, new QKeyEvent(QEvent::KeyPress, Qt::Key_Down, 0)); - QApplication::postEvent(renderer, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Down, 0)); + QApplication::postEvent(renderer, new QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier)); + QApplication::postEvent(renderer, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Down, Qt::NoModifier)); } } @@ -2931,8 +2929,8 @@ void EmailClient::scrollReaderUp() { QWidget *renderer = readMailWidget()->findChild<QWidget*>("renderer"); if (renderer) { - QApplication::postEvent(renderer, new QKeyEvent(QEvent::KeyPress, Qt::Key_Up, 0)); - QApplication::postEvent(renderer, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Up, 0)); + QApplication::postEvent(renderer, new QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier)); + QApplication::postEvent(renderer, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Up, Qt::NoModifier)); } } diff --git a/examples/qtmail/emailclient.h b/examples/qtmail/emailclient.h index 8dea6992..df8c2207 100644 --- a/examples/qtmail/emailclient.h +++ b/examples/qtmail/emailclient.h @@ -66,7 +66,6 @@ QT_BEGIN_NAMESPACE class QAction; class QStackedWidget; -class QStringList; class QToolBar; QT_END_NAMESPACE @@ -76,7 +75,7 @@ class MessageUiBase : public QMainWindow Q_OBJECT public: - MessageUiBase(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = 0); + MessageUiBase(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::Widget); virtual ~MessageUiBase() {} signals: @@ -145,7 +144,7 @@ class EmailClient : public MessageUiBase Q_OBJECT public: - EmailClient(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = 0); + EmailClient(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::Widget); ~EmailClient(); bool cleanExit(bool force); diff --git a/examples/qtmail/emailcomposer.cpp b/examples/qtmail/emailcomposer.cpp index a8a831a5..01ffe5a1 100644 --- a/examples/qtmail/emailcomposer.cpp +++ b/examples/qtmail/emailcomposer.cpp @@ -63,6 +63,7 @@ #include <QUrl> #include <QSyntaxHighlighter> #include <QCompleter> +#include <QRegularExpression> static int minimumLeftWidth = 65; static const QString placeholder("(no subject)"); @@ -74,7 +75,7 @@ typedef QList<Recipient> RecipientList; static QCompleter* sentFolderCompleter() { const int completionAddressLimit(1000); - QSet<QString> addressSet; + QStringList addressList; QMailMessageKey::Properties props(QMailMessageKey::Recipients); QMailMessageKey key(QMailMessageKey::status(QMailMessage::Sent)); QMailMessageMetaDataList metaDataList(QMailStore::instance()->messagesMetaData(key, props, QMailStore::ReturnDistinct)); @@ -82,14 +83,14 @@ static QCompleter* sentFolderCompleter() foreach(QMailAddress address, metaData.recipients()) { QString s(address.toString()); if (!s.simplified().isEmpty()) { - addressSet.insert(s); + addressList.append(s); } } - if (addressSet.count() >= completionAddressLimit) + if (addressList.count() >= completionAddressLimit) break; } - QCompleter *completer(new QCompleter(addressSet.toList())); + QCompleter *completer(new QCompleter(addressList)); completer->setCaseSensitivity(Qt::CaseInsensitive); return completer; } @@ -469,10 +470,11 @@ void SpellingHighlighter::highlightBlock(const QString &text) spellingFormat.setUnderlineStyle(QTextCharFormat::SpellCheckUnderline); spellingFormat.setUnderlineColor(Qt::red); - QRegExp wordExpression("\\b\\w+\\b"); - int index = text.indexOf(wordExpression); + QRegularExpression wordExpression("(\\b\\w+\\b)"); + QRegularExpressionMatch match; + int index = text.indexOf(wordExpression, 0, &match); while (index >= 0) { - int length = wordExpression.matchedLength(); + int length = match.capturedLength(); if (!dictionary->contains(text.mid(index, length))) setFormat(index, length, spellingFormat); index = text.indexOf(wordExpression, index + length); @@ -930,7 +932,7 @@ void EmailComposerInterface::create(const QMailMessage& sourceMail) QString contentLocation = sourceMail.customField(name); if (contentLocation.isEmpty()) { // See if we can use the value in the message (remove any folded whitespace) - contentLocation = QUrl(part.contentLocation().remove(QRegExp("\\s"))).toLocalFile(); + contentLocation = QUrl(part.contentLocation().remove(QRegularExpression("\\s"))).toLocalFile(); } if (part.referenceType() != QMailMessagePart::None) { diff --git a/examples/qtmail/genericviewer.cpp b/examples/qtmail/genericviewer.cpp index 79198171..0aa4339e 100644 --- a/examples/qtmail/genericviewer.cpp +++ b/examples/qtmail/genericviewer.cpp @@ -178,10 +178,11 @@ void GenericViewer::linkClicked(const QUrl& link) QString command = link.toString(); if (command.startsWith(QLatin1String("attachment"))) { - QRegExp splitter("attachment;([^;]+)(?:;([\\d\\.]*))?"); - if (splitter.exactMatch(command)) { - QString cmd = splitter.cap(1); - QString location = splitter.cap(2); + QRegularExpression splitter("attachment;([^;]+)(?:;([\\d\\.]*))?"); + QRegularExpressionMatch match; + if (command.indexOf(splitter, 0, &match) >= 0) { + QString cmd = match.captured(1); + QString location = match.captured(2); if (!location.isEmpty()) { QMailMessagePart::Location partLocation(location); @@ -200,9 +201,10 @@ void GenericViewer::linkClicked(const QUrl& link) } } } else if (command.startsWith(QLatin1String("download"))) { - QRegExp splitter("download(?:;(\\d+))?"); - if (splitter.exactMatch(command)) { - QString bytes = splitter.cap(1); + QRegularExpression splitter("download(?:;(\\d+))?"); + QRegularExpressionMatch match; + if (command.indexOf(splitter, 0, &match) >= 0) { + QString bytes = match.captured(1); if (!bytes.isEmpty()) { emit retrieveMessagePortion(bytes.toUInt()); } else { diff --git a/examples/qtmail/messagelistview.cpp b/examples/qtmail/messagelistview.cpp index 07120c85..59b18e91 100644 --- a/examples/qtmail/messagelistview.cpp +++ b/examples/qtmail/messagelistview.cpp @@ -363,8 +363,8 @@ void MessageList::keyPressEvent(QKeyEvent* e) if (unread) { setCurrentIndex(index); scrollTo(index); - QApplication::postEvent(this, new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, 0)); - QApplication::postEvent(this, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Enter, 0)); + QApplication::postEvent(this, new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier)); + QApplication::postEvent(this, new QKeyEvent(QEvent::KeyRelease, Qt::Key_Enter, Qt::NoModifier)); break; } if (e->key() == Qt::Key_Plus) { diff --git a/examples/qtmail/readmail.cpp b/examples/qtmail/readmail.cpp index 902423d6..d6e986e2 100644 --- a/examples/qtmail/readmail.cpp +++ b/examples/qtmail/readmail.cpp @@ -541,3 +541,4 @@ void ReadMail::updateReadStatus() } } +#include "readmail.moc" diff --git a/examples/qtmail/readmail.h b/examples/qtmail/readmail.h index f4edc689..6a180b18 100644 --- a/examples/qtmail/readmail.h +++ b/examples/qtmail/readmail.h @@ -57,7 +57,7 @@ class ReadMail : public QFrame Q_OBJECT public: - ReadMail( QWidget* parent = Q_NULLPTR, Qt::WindowFlags fl = 0 ); + ReadMail( QWidget* parent = Q_NULLPTR, Qt::WindowFlags fl = Qt::Widget ); void displayMessage(const QMailMessageId& message, QMailViewerFactory::PresentationType, bool nextAvailable, bool previousAvailable); QMailMessageId displayedMessage() const; diff --git a/examples/qtmail/searchview.cpp b/examples/qtmail/searchview.cpp index 1b5e7d32..43a66529 100644 --- a/examples/qtmail/searchview.cpp +++ b/examples/qtmail/searchview.cpp @@ -507,8 +507,8 @@ QMailMessageKey() if(ct == Equality) { - QMailMessageKey startRange = receptionTimeStamp(QDateTime(value.value<QDate>()),QMailDataComparator::GreaterThanEqual); - QMailMessageKey endRange = receptionTimeStamp(QDateTime(value.value<QDate>().addDays(1)),QMailDataComparator::LessThan); + QMailMessageKey startRange = receptionTimeStamp(value.value<QDate>().startOfDay(),QMailDataComparator::GreaterThanEqual); + QMailMessageKey endRange = receptionTimeStamp(value.value<QDate>().addDays(1).startOfDay(),QMailDataComparator::LessThan); if(ec == QMailDataComparator::Equal) QMailMessageKey::operator=(startRange & endRange); @@ -518,11 +518,11 @@ QMailMessageKey() else { if(rc == QMailDataComparator::GreaterThan) - QMailMessageKey::operator=(receptionTimeStamp(QDateTime(value.value<QDate>().addDays(1)),QMailDataComparator::GreaterThanEqual)); + QMailMessageKey::operator=(receptionTimeStamp(value.value<QDate>().addDays(1).startOfDay(),QMailDataComparator::GreaterThanEqual)); else if(rc == QMailDataComparator::LessThanEqual) - QMailMessageKey::operator=(receptionTimeStamp(QDateTime(value.value<QDate>()).addDays(1),QMailDataComparator::LessThan)); + QMailMessageKey::operator=(receptionTimeStamp(value.value<QDate>().startOfDay().addDays(1),QMailDataComparator::LessThan)); else - QMailMessageKey::operator=(receptionTimeStamp(QDateTime(value.value<QDate>()),rc)); + QMailMessageKey::operator=(receptionTimeStamp(value.value<QDate>().startOfDay(),rc)); } }break; } diff --git a/examples/qtmail/searchview.h b/examples/qtmail/searchview.h index 7661d7f7..83aa6ed4 100644 --- a/examples/qtmail/searchview.h +++ b/examples/qtmail/searchview.h @@ -61,7 +61,7 @@ class SearchView : public QMainWindow Q_OBJECT public: - SearchView(QWidget * parent = Q_NULLPTR, Qt::WindowFlags flags = 0); + SearchView(QWidget * parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::Widget); void setVisible(bool visible); signals: diff --git a/examples/serverobserver/CMakeLists.txt b/examples/serverobserver/CMakeLists.txt new file mode 100644 index 00000000..e8b54e1a --- /dev/null +++ b/examples/serverobserver/CMakeLists.txt @@ -0,0 +1,10 @@ +set(SRC + serverobserver.h + serverobserver.cpp + main.cpp) + +add_executable(serverobserver5 ${SRC}) +target_include_directories(serverobserver5 + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(serverobserver5 + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient QmfMessageServer) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..de96526d --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,3 @@ +add_subdirectory(libraries) +add_subdirectory(plugins) +add_subdirectory(tools) diff --git a/src/libraries/CMakeLists.txt b/src/libraries/CMakeLists.txt new file mode 100644 index 00000000..be855aac --- /dev/null +++ b/src/libraries/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory(qmfclient) +add_subdirectory(qmfmessageserver) +if(BUILD_WIDGETS) + add_subdirectory(qmfwidgets) +endif() diff --git a/src/libraries/qmfclient/CMakeLists.txt b/src/libraries/qmfclient/CMakeLists.txt new file mode 100644 index 00000000..85b8c974 --- /dev/null +++ b/src/libraries/qmfclient/CMakeLists.txt @@ -0,0 +1,167 @@ +set(SRC + longstream.cpp + longstring.cpp + locks.cpp + qmailaccount.cpp + qmailaccountconfiguration.cpp + qmailaccountkey.cpp + qmailaccountlistmodel.cpp + qmailaccountsortkey.cpp + qmailaction.cpp + qmailaddress.cpp + qmailcodec.cpp + qmailcontentmanager.cpp + qmailcrypto.cpp + qmaildatacomparator.cpp + qmaildisconnected.cpp + qmailfolder.cpp + qmailfolderfwd.cpp + qmailfolderkey.cpp + qmailfoldersortkey.cpp + qmailid.cpp + qmailinstantiations.cpp + qmailkeyargument.cpp + qmailmessage.cpp + qmailmessagefwd.cpp + qmailmessagekey.cpp + qmailmessagelistmodel.cpp + qmailmessagemodelbase.cpp + qmailmessageremovalrecord.cpp + qmailmessageserver.cpp + qmailmessageset.cpp + qmailmessagesortkey.cpp + qmailmessagethreadedmodel.cpp + qmailserviceaction.cpp + qmailstore.cpp + qmailstore_p.cpp + qmailstoreimplementation_p.cpp + qmailtimestamp.cpp + qmailthread.cpp + qmailthreadkey.cpp + qmailthreadlistmodel.cpp + qmailthreadsortkey.cpp + qprivateimplementation.cpp + support/qmailnamespace.cpp + support/qmaillog.cpp + support/qlogsystem.cpp + support/qloggers.cpp + support/qmailpluginmanager.cpp) + +set(PUBLIC_HEADERS + qmailaccount.h + qmailaccountconfiguration.h + qmailaccountkey.h + qmailaccountlistmodel.h + qmailaccountsortkey.h + qmailaction.h + qmailaddress.h + qmailcodec.h + qmailcontentmanager.h + qmailcrypto.h + qmailcryptofwd.h + qmaildatacomparator.h + qmaildisconnected.h + qmailfolder.h + qmailfolderfwd.h + qmailfolderkey.h + qmailfoldersortkey.h + qmailid.h + qmailkeyargument.h + qmailmessage.h + qmailmessagefwd.h + qmailmessagekey.h + qmailmessagelistmodel.h + qmailmessagemodelbase.h + qmailmessageremovalrecord.h + qmailmessageserver.h + qmailmessageset.h + qmailmessagesortkey.h + qmailmessagethreadedmodel.h + qmailserviceaction.h + qmailsortkeyargument.h + qmailstore.h + qmailtimestamp.h + qmailthread.h + qmailthreadkey.h + qmailthreadlistmodel.h + qmailthreadsortkey.h + qmflist.h + qprivateimplementation.h + support/qmailglobal.h + support/qmaillog.h + support/qlogsystem.h + support/qloggers.h + support/qmailnamespace.h + support/qmailpluginmanager.h + support/qmailipc.h) + +set(PRIVATE_HEADERS + qprivateimplementationdef_p.h + bind_p.h + locks_p.h + mailkeyimpl_p.h + mailsortkeyimpl_p.h + qmailaccountkey_p.h + qmailaccountsortkey_p.h + qmailfolderkey_p.h + qmailfoldersortkey_p.h + qmailmessage_p.h + qmailmessagekey_p.h + qmailmessageset_p.h + qmailmessagesortkey_p.h + qmailserviceaction_p.h + qmailstore_p.h + qmailstoreimplementation_p.h + qmailthread_p.h + qmailthreadkey_p.h + qmailthreadsortkey_p.h + longstring_p.h + longstream_p.h) + +if (ICU_FOUND) + set(SRC ${SRC} + support/qcharsetdetector.cpp) + set(PRIVATE_HEADERS ${PRIVATE_HEADERS} + support/qcharsetdetector_p.h + support/qcharsetdetector.h) +endif() + +qt_add_resources(SRC qmf.qrc qmf_icons.qrc qmf_qt.qrc) + +set_source_files_properties(qmailservice.xml PROPERTIES + INCLUDE qmailserviceaction.h) +qt_add_dbus_interface(GENERATED_SOURCES qmailservice.xml qmailservice_interface) +qt_add_dbus_adaptor(GENERATED_SOURCES qmailstore.xml qmailstoreimplementation_p.h QMailStoreImplementationBase qmailstore_adaptor) + +add_library(QmfClient SHARED ${SRC} ${GENERATED_SOURCES} ${PUBLIC_HEADERS} ${PRIVATE_HEADERS}) + +target_compile_definitions(QmfClient PRIVATE QMF_INTERNAL) +target_include_directories(QmfClient PRIVATE support) +target_link_libraries(QmfClient + PRIVATE Qt6::Sql Qt6::Network Qt6::Core5Compat + PUBLIC Qt6::Core Qt6::DBus) +set_target_properties(QmfClient PROPERTIES + SOVERSION ${PROJECT_VERSION_MAJOR} + VERSION ${PROJECT_VERSION} + PUBLIC_HEADER "${PUBLIC_HEADERS}" + PRIVATE_HEADER "${PRIVATE_HEADERS}") + +if (ICU_FOUND) + target_compile_definitions(QmfClient PRIVATE HAVE_LIBICU) + target_link_libraries(QmfClient PRIVATE PkgConfig::ICU) +endif() + +if (USE_HTML_PARSER) + target_compile_definitions(QmfClient PRIVATE USE_HTML_PARSER) + target_link_libraries(QmfClient + PRIVATE Qt6::Gui) +endif() + +install(TARGETS QmfClient + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qt5/QmfClient + PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qt5/QmfClient/private) + +if (TARGET Qt6::LinguistTools) + qt_add_translations(libqtopiamail) +endif() diff --git a/src/libraries/qmfclient/qmailmessage.cpp b/src/libraries/qmfclient/qmailmessage.cpp index 1afaa18f..3fada21a 100644 --- a/src/libraries/qmfclient/qmailmessage.cpp +++ b/src/libraries/qmfclient/qmailmessage.cpp @@ -8968,3 +8968,9 @@ QDebug operator<<(QDebug dbg, const QMailMessagePart &part) dbg << "QMailMessagePart" << part.contentID() << "location:" << part.contentLocation(); return dbg; } + +QDebug operator<<(QDebug dbg, const QMailMessageHeaderField &field) +{ + dbg << "QMailMessageHeaderField" << field.toString(); + return dbg; +} diff --git a/src/libraries/qmfclient/qmailmessage.h b/src/libraries/qmfclient/qmailmessage.h index 0bea2d2d..c3e6baa8 100644 --- a/src/libraries/qmfclient/qmailmessage.h +++ b/src/libraries/qmfclient/qmailmessage.h @@ -834,6 +834,7 @@ public: }; QMF_EXPORT QDebug operator<<(QDebug dbg, const QMailMessagePart &part); +QMF_EXPORT QDebug operator<<(QDebug dbg, const QMailMessageHeaderField &field); typedef QmfList<QMailMessage> QMailMessageList; typedef QmfList<QMailMessageMetaData> QMailMessageMetaDataList; diff --git a/src/libraries/qmfclient/qmailservice.xml b/src/libraries/qmfclient/qmailservice.xml index 718b6af7..12d03e6e 100644 --- a/src/libraries/qmfclient/qmailservice.xml +++ b/src/libraries/qmfclient/qmailservice.xml @@ -266,13 +266,13 @@ </method> <method name="addMessages"> <arg name="actionId" type="t" direction="in"/> - <arg name="messages" type="a((i)t(i)(t)su(t)(t)(t)ssssss(t)ssss(t)(i)mssbbs(t))" direction="in"/> + <arg name="messages" type="a((i)t(i)(t)su(t)(t)(t)ssssss(t)ssss(t)(i)a{ss}bbs(t))" direction="in"/> <annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/> <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QMailMessageMetaDataList"/> </method> <method name="updateMessages"> <arg name="actionId" type="t" direction="in"/> - <arg name="messages" type="a((i)t(i)(t)su(t)(t)(t)ssssss(t)ssss(t)(i)mssbbs(t))" direction="in"/> + <arg name="messages" type="a((i)t(i)(t)su(t)(t)(t)ssssss(t)ssss(t)(i)a{ss}bbs(t))" direction="in"/> <annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/> <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QMailMessageMetaDataList"/> </method> diff --git a/src/libraries/qmfclient/qmailserviceaction.h b/src/libraries/qmfclient/qmailserviceaction.h index d5031196..28c9ad44 100644 --- a/src/libraries/qmfclient/qmailserviceaction.h +++ b/src/libraries/qmfclient/qmailserviceaction.h @@ -42,6 +42,7 @@ #include "qmailmessage.h" #include "qmailfolder.h" #include "qmailaction.h" +#include "qmailstore.h" #include <QString> #include <QStringList> diff --git a/src/libraries/qmfmessageserver/CMakeLists.txt b/src/libraries/qmfmessageserver/CMakeLists.txt new file mode 100644 index 00000000..4fe88f10 --- /dev/null +++ b/src/libraries/qmfmessageserver/CMakeLists.txt @@ -0,0 +1,48 @@ +set(SRC + qmailauthenticator.cpp + qmailmessagebuffer.cpp + qmailmessageclassifier.cpp + qmailmessageservice.cpp + qmailserviceconfiguration.cpp + qmailstoreaccountfilter.cpp + qmailtransport.cpp + qmailheartbeattimer_qtimer.cpp) # NB: There are multiple implementations + +set(HEADERS + qmailauthenticator.h + qmailmessagebuffer.h + qmailmessageclassifier.h + qmailmessageservice.h + qmailserviceconfiguration.h + qmailstoreaccountfilter.h + qmailtransport.h + qmailheartbeattimer.h) + +if (BUILD_MESSAGESERVER_PLUGINS) + set(SRC ${SRC} + qmailmessageserverplugin.cpp) + set(HEADERS ${HEADERS} + qmailmessageserverplugin.h) +endif() + +add_library(QmfMessageServer SHARED ${SRC} ${HEADERS}) + +if (BUILD_WIDGETS) + target_link_libraries(QmfMessageServer PUBLIC Qt6::Widgets) +else() + target_compile_definitions(QmfMessageServer PRIVATE QMF_NO_WIDGETS) +endif() + +target_compile_definitions(QmfMessageServer PRIVATE MESSAGESERVER_INTERNAL) +target_include_directories(QmfMessageServer PRIVATE ../qmfclient ../qmfclient/support) +target_link_libraries(QmfMessageServer + PRIVATE Qt6::Network + PUBLIC Qt6::Core QmfClient) +set_target_properties(QmfMessageServer PROPERTIES + SOVERSION ${PROJECT_VERSION_MAJOR} + VERSION ${PROJECT_VERSION} + PUBLIC_HEADER "${HEADERS}") + +install(TARGETS QmfMessageServer + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qt5/QmfMessageServer) diff --git a/src/libraries/qmfmessageserver/qmailmessageservice.cpp b/src/libraries/qmfmessageserver/qmailmessageservice.cpp index ac9e9077..c1404aab 100644 --- a/src/libraries/qmfmessageserver/qmailmessageservice.cpp +++ b/src/libraries/qmfmessageserver/qmailmessageservice.cpp @@ -32,7 +32,7 @@ ****************************************************************************/ #include "qmailmessageservice.h" -#include <private/longstream_p.h> +#include <longstream_p.h> #include <QAbstractSocket> #include <QCoreApplication> #include <QList> diff --git a/src/libraries/qmfwidgets/CMakeLists.txt b/src/libraries/qmfwidgets/CMakeLists.txt new file mode 100644 index 00000000..6d9ece5b --- /dev/null +++ b/src/libraries/qmfwidgets/CMakeLists.txt @@ -0,0 +1,39 @@ +set(SRC + emailfoldermodel.cpp + emailfolderview.cpp + folderdelegate.cpp + foldermodel.cpp + folderview.cpp + selectfolder.cpp + qtmailnamespace.cpp) + +set(HEADERS + emailfoldermodel.h + emailfolderview.h + folderdelegate.h + foldermodel.h + folderview.h + selectfolder.h + qtmailnamespace.h) + +qt_add_resources(SRC qmfutil.qrc) + +add_library(QmfWidgets SHARED ${SRC} ${HEADERS}) + +target_compile_definitions(QmfWidgets PRIVATE QMFUTIL_INTERNAL) +target_include_directories(QmfWidgets PRIVATE ../qmfclient ../qmfclient/support) +target_link_libraries(QmfWidgets + PUBLIC Qt6::Core Qt6::Widgets QmfClient) +set_target_properties(QmfWidgets PROPERTIES + SOVERSION ${PROJECT_VERSION_MAJOR} + VERSION ${PROJECT_VERSION} + PUBLIC_HEADER "${HEADERS}") + +install(TARGETS QmfWidgets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qt5/QmfWidgets) + +if (TARGET Qt6::LinguistTools) + qt_add_translations(libqmfutil) +endif() + diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt new file mode 100644 index 00000000..d5ee1b23 --- /dev/null +++ b/src/plugins/CMakeLists.txt @@ -0,0 +1,8 @@ +add_subdirectory(contentmanagers) +add_subdirectory(messageservices) + +find_program(GPGME_CONFIG gpgme-config) +if (GPGME_CONFIG) + execute_process(COMMAND ${GPGME_CONFIG} --libs OUTPUT_VARIABLE GPGME_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) + add_subdirectory(crypto) +endif() diff --git a/src/plugins/contentmanagers/CMakeLists.txt b/src/plugins/contentmanagers/CMakeLists.txt new file mode 100644 index 00000000..66bf04d9 --- /dev/null +++ b/src/plugins/contentmanagers/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(qmfstoragemanager) diff --git a/src/plugins/contentmanagers/qmfstoragemanager/CMakeLists.txt b/src/plugins/contentmanagers/qmfstoragemanager/CMakeLists.txt new file mode 100644 index 00000000..50be4487 --- /dev/null +++ b/src/plugins/contentmanagers/qmfstoragemanager/CMakeLists.txt @@ -0,0 +1,8 @@ +add_library(qmfstoragemanager MODULE qmfstoragemanager.h qmfstoragemanager.cpp) +target_include_directories(qmfstoragemanager + PRIVATE ../../../libraries/qmfclient ../../../libraries/qmfclient/support) +target_link_libraries(qmfstoragemanager + PRIVATE Qt6::Core QmfClient) + +install(TARGETS qmfstoragemanager + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt5/plugins/contentmanagers) diff --git a/src/plugins/crypto/CMakeLists.txt b/src/plugins/crypto/CMakeLists.txt new file mode 100644 index 00000000..4005b4a0 --- /dev/null +++ b/src/plugins/crypto/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(gpgme) +add_subdirectory(smime) diff --git a/src/plugins/crypto/common/qgpgme.h b/src/plugins/crypto/common/qgpgme.h index da781777..899f1bfc 100644 --- a/src/plugins/crypto/common/qgpgme.h +++ b/src/plugins/crypto/common/qgpgme.h @@ -50,6 +50,7 @@ class QMailCryptoGPGME: public QObject, public QMailCryptographicServiceInterface { Q_OBJECT + Q_INTERFACES(QMailCryptographicServiceInterface) public: ~QMailCryptoGPGME() {}; diff --git a/src/plugins/crypto/gpgme/CMakeLists.txt b/src/plugins/crypto/gpgme/CMakeLists.txt new file mode 100644 index 00000000..fa03b592 --- /dev/null +++ b/src/plugins/crypto/gpgme/CMakeLists.txt @@ -0,0 +1,10 @@ +add_library(gpgme MODULE + ../common/qgpgme.h ../common/qgpgme.cpp + gpgmeplugin.h gpgmeplugin.cpp) +target_include_directories(gpgme + PRIVATE ../common ../../../libraries/qmfclient ../../../libraries/qmfclient/support) +target_link_libraries(gpgme + PRIVATE Qt6::Core QmfClient ${GPGME_LIBS}) + +install(TARGETS gpgme + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt5/plugins/crypto) diff --git a/src/plugins/crypto/gpgme/gpgmeplugin.h b/src/plugins/crypto/gpgme/gpgmeplugin.h index 68d4d250..7a36ef64 100644 --- a/src/plugins/crypto/gpgme/gpgmeplugin.h +++ b/src/plugins/crypto/gpgme/gpgmeplugin.h @@ -43,7 +43,6 @@ class QMailCryptoGPG : public QMailCryptoGPGME { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QMailCryptographicServiceInterface") - Q_INTERFACES(QMailCryptographicServiceInterface) public: QMailCryptoGPG(); diff --git a/src/plugins/crypto/smime/CMakeLists.txt b/src/plugins/crypto/smime/CMakeLists.txt new file mode 100644 index 00000000..72fdf985 --- /dev/null +++ b/src/plugins/crypto/smime/CMakeLists.txt @@ -0,0 +1,10 @@ +add_library(smime MODULE + ../common/qgpgme.h ../common/qgpgme.cpp + smimeplugin.h smimeplugin.cpp) +target_include_directories(smime + PRIVATE ../common ../../../libraries/qmfclient ../../../libraries/qmfclient/support) +target_link_libraries(smime + PRIVATE Qt6::Core QmfClient ${GPGME_LIBS}) + +install(TARGETS smime + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt5/plugins/crypto) diff --git a/src/plugins/crypto/smime/smimeplugin.h b/src/plugins/crypto/smime/smimeplugin.h index 540008c4..65a92c67 100644 --- a/src/plugins/crypto/smime/smimeplugin.h +++ b/src/plugins/crypto/smime/smimeplugin.h @@ -43,7 +43,6 @@ class QMailCryptoSMIME : public QMailCryptoGPGME { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QMailCryptographicServiceInterface") - Q_INTERFACES(QMailCryptographicServiceInterface) public: QMailCryptoSMIME(); diff --git a/src/plugins/messageservices/CMakeLists.txt b/src/plugins/messageservices/CMakeLists.txt new file mode 100644 index 00000000..833b3f69 --- /dev/null +++ b/src/plugins/messageservices/CMakeLists.txt @@ -0,0 +1,3 @@ +add_subdirectory(imap) +add_subdirectory(pop) +add_subdirectory(smtp) diff --git a/src/plugins/messageservices/imap/CMakeLists.txt b/src/plugins/messageservices/imap/CMakeLists.txt new file mode 100644 index 00000000..edc7a041 --- /dev/null +++ b/src/plugins/messageservices/imap/CMakeLists.txt @@ -0,0 +1,50 @@ +set(SRC + imapclient.cpp + imapconfiguration.cpp + imapprotocol.cpp + imapservice.cpp + imapstructure.cpp + imapauthenticator.cpp + imapstrategy.cpp + integerregion.cpp + imaptransport.cpp + serviceactionqueue.cpp + idlenetworksession.cpp) + +set(HEADERS + imapclient.h + imapconfiguration.h + imapmailboxproperties.h + imapprotocol.h + imapservice.h + imapstructure.h + imapauthenticator.h + imapstrategy.h + integerregion.h + imaptransport.h + serviceactionqueue.h + idlenetworksession.h) + +if (BUILD_WIDGETS) + set(SRC ${SRC} imapsettings.cpp) + set(HEADERS ${HEADERS} imapsettings.h) + qt_add_resources(SRC imap.qrc) + qt_wrap_ui(SRC imapsettings.ui) +endif() + +add_library(imap MODULE ${SRC} ${HEADERS}) + +target_include_directories(imap + PRIVATE ../../../libraries/qmfclient ../../../libraries/qmfclient/support ../../../libraries/qmfmessageserver) +target_link_libraries(imap + PRIVATE Qt6::Core Qt6::Network QmfClient QmfMessageServer) +if (BUILD_WIDGETS) + target_link_libraries(imap PUBLIC QmfWidgets) + target_include_directories(imap + PRIVATE ../../../libraries/qmfwidgets) +else() + target_compile_definitions(imap PRIVATE QMF_NO_WIDGETS) +endif() + +install(TARGETS imap + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt5/plugins/messageservices) diff --git a/src/plugins/messageservices/imap/imapclient.cpp b/src/plugins/messageservices/imap/imapclient.cpp index 1c4918a0..34b958ca 100644 --- a/src/plugins/messageservices/imap/imapclient.cpp +++ b/src/plugins/messageservices/imap/imapclient.cpp @@ -35,7 +35,7 @@ #include "imapauthenticator.h" #include "imapconfiguration.h" #include "imapstrategy.h" -#include <private/longstream_p.h> +#include <longstream_p.h> #include <qmaillog.h> #include <qmailmessagebuffer.h> #include <qmailfolder.h> diff --git a/src/plugins/messageservices/imap/imapprotocol.cpp b/src/plugins/messageservices/imap/imapprotocol.cpp index 979cc274..3515bada 100644 --- a/src/plugins/messageservices/imap/imapprotocol.cpp +++ b/src/plugins/messageservices/imap/imapprotocol.cpp @@ -44,7 +44,6 @@ #include <QUrl> #include <QRegularExpression> #include <qmaillog.h> -#include <private/longstring_p.h> #include <qmailaccountconfiguration.h> #include <qmailmessage.h> #include <qmailmessageserver.h> diff --git a/src/plugins/messageservices/imap/imapprotocol.h b/src/plugins/messageservices/imap/imapprotocol.h index c7dc4dee..1f2c0f8c 100644 --- a/src/plugins/messageservices/imap/imapprotocol.h +++ b/src/plugins/messageservices/imap/imapprotocol.h @@ -35,7 +35,7 @@ #define IMAPPROTOCOL_H #include "imapmailboxproperties.h" -#include <private/longstream_p.h> +#include <longstream_p.h> #include <qobject.h> #include <qstring.h> #include <qstringlist.h> diff --git a/src/plugins/messageservices/imap/imapstrategy.cpp b/src/plugins/messageservices/imap/imapstrategy.cpp index 429079eb..606377a7 100644 --- a/src/plugins/messageservices/imap/imapstrategy.cpp +++ b/src/plugins/messageservices/imap/imapstrategy.cpp @@ -34,7 +34,7 @@ #include "imapstrategy.h" #include "imapclient.h" #include "imapconfiguration.h" -#include <private/longstream_p.h> +#include <longstream_p.h> #include <qobject.h> #include <qmaillog.h> #include <qmailaccount.h> diff --git a/src/plugins/messageservices/pop/CMakeLists.txt b/src/plugins/messageservices/pop/CMakeLists.txt new file mode 100644 index 00000000..9e259602 --- /dev/null +++ b/src/plugins/messageservices/pop/CMakeLists.txt @@ -0,0 +1,34 @@ +set(SRC + popclient.cpp + popconfiguration.cpp + popservice.cpp + popauthenticator.cpp) + +set(HEADERS + popclient.h + popconfiguration.h + popservice.h + popauthenticator.h) + +if (BUILD_WIDGETS) + set(SRC ${SRC} popsettings.cpp) + set(HEADERS ${HEADERS} popsettings.h) + qt_wrap_ui(SRC popsettings.ui) +endif() + +add_library(pop MODULE ${SRC} ${HEADERS}) + +target_include_directories(pop + PRIVATE ../../../libraries/qmfclient ../../../libraries/qmfclient/support ../../../libraries/qmfmessageserver) +target_link_libraries(pop + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Network QmfClient QmfMessageServer) +if (BUILD_WIDGETS) + target_link_libraries(pop PUBLIC QmfWidgets) + target_include_directories(pop + PRIVATE ../../../libraries/qmfwidgets) +else() + target_compile_definitions(pop PRIVATE QMF_NO_WIDGETS) +endif() + +install(TARGETS pop + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt5/plugins/messageservices) diff --git a/src/plugins/messageservices/pop/popclient.cpp b/src/plugins/messageservices/pop/popclient.cpp index e605a34d..54667ec8 100644 --- a/src/plugins/messageservices/pop/popclient.cpp +++ b/src/plugins/messageservices/pop/popclient.cpp @@ -36,7 +36,7 @@ #include "popconfiguration.h" #include <QFileInfo> #include <QRegExp> -#include <private/longstream_p.h> +#include <longstream_p.h> #include <qmailstore.h> #include <qmailmessagebuffer.h> #include <qmailtransport.h> diff --git a/src/plugins/messageservices/smtp/CMakeLists.txt b/src/plugins/messageservices/smtp/CMakeLists.txt new file mode 100644 index 00000000..b7a702fa --- /dev/null +++ b/src/plugins/messageservices/smtp/CMakeLists.txt @@ -0,0 +1,34 @@ +set(SRC + smtpauthenticator.cpp + smtpclient.cpp + smtpconfiguration.cpp + smtpservice.cpp) + +set(HEADERS + smtpauthenticator.h + smtpclient.h + smtpconfiguration.h + smtpservice.h) + +if (BUILD_WIDGETS) + set(SRC ${SRC} smtpsettings.cpp) + set(HEADERS ${HEADERS} smtpsettings.h) + qt_wrap_ui(SRC smtpsettings.ui) +endif() + +add_library(smtp MODULE ${SRC} ${HEADERS}) + +target_include_directories(smtp + PRIVATE ../../../libraries/qmfclient ../../../libraries/qmfclient/support ../../../libraries/qmfmessageserver) +target_link_libraries(smtp + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Network QmfClient QmfMessageServer) +if (BUILD_WIDGETS) + target_link_libraries(smtp PUBLIC QmfWidgets) + target_include_directories(smtp + PRIVATE ../../../libraries/qmfwidgets) +else() + target_compile_definitions(smtp PRIVATE QMF_NO_WIDGETS) +endif() + +install(TARGETS smtp + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt5/plugins/messageservices) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt new file mode 100644 index 00000000..8f92f3c5 --- /dev/null +++ b/src/tools/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(messageserver) diff --git a/src/tools/messageserver/CMakeLists.txt b/src/tools/messageserver/CMakeLists.txt new file mode 100644 index 00000000..8bcc802a --- /dev/null +++ b/src/tools/messageserver/CMakeLists.txt @@ -0,0 +1,44 @@ +set(SRC + messageserver.cpp + prepareaccounts.cpp + newcountnotifier.cpp + servicehandler.cpp) + +set(HEADERS + messageserver.h + servicehandler.h + newcountnotifier.h) + +qt_add_dbus_adaptor(GENERATED_SOURCES ../../libraries/qmfclient/qmailservice.xml servicehandler.h ServiceHandler qmailservice_adaptor) + +add_library(MessageServer ${SRC} ${GENERATED_SOURCES} ${HEADERS}) + +if (BUILD_WIDGETS) + target_link_libraries(MessageServer + PRIVATE Qt6::Widgets) +else() + target_compile_definitions(MessageServer PRIVATE QMF_NO_WIDGETS) +endif() +target_include_directories(MessageServer PUBLIC + ../../libraries/qmfmessageserver + ../../libraries/qmfclient + ../../libraries/qmfclient/support) +target_link_libraries(MessageServer + PRIVATE Qt6::Core5Compat Qt6::DBus + PUBLIC Qt6::Core QmfClient QmfMessageServer) + +if (USE_HTML_PARSER) + target_compile_definitions(MessageServer PRIVATE USE_HTML_PARSER) + target_link_libraries(MessageServer PRIVATE Qt6::Gui) +endif() + +add_executable(messageserver5 main.cpp) +target_link_libraries(messageserver5 + PRIVATE Qt6::Core MessageServer) + +if (TARGET Qt6::LinguistTools) + qt_add_translations(messageserver) +endif() + +install(TARGETS messageserver5 + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/tools/messageserver/servicehandler.cpp b/src/tools/messageserver/servicehandler.cpp index 93ebace0..eefdf216 100644 --- a/src/tools/messageserver/servicehandler.cpp +++ b/src/tools/messageserver/servicehandler.cpp @@ -33,7 +33,7 @@ #include "servicehandler.h" -#include <private/longstream_p.h> +#include <longstream_p.h> #include <qmflist.h> #include <qmailmessageserver.h> #include <qmailserviceconfiguration.h> @@ -2884,6 +2884,11 @@ void ServiceHandler::protocolResponse(const QString &response, const QVariant &d // end concurrent actions +void ServiceHandler::protocolRequest(quint64 action, const QMailAccountId &accountId, const QString &request, const QDBusVariant &data) +{ + protocolRequest(action, accountId, request, data.variant()); +} + void ServiceHandler::protocolRequest(quint64 action, const QMailAccountId &accountId, const QString &request, const QVariant &data) { QSet<QMailMessageService*> sources(sourceServiceSet(accountId)); diff --git a/src/tools/messageserver/servicehandler.h b/src/tools/messageserver/servicehandler.h index 8ea398f4..5bfe48af 100644 --- a/src/tools/messageserver/servicehandler.h +++ b/src/tools/messageserver/servicehandler.h @@ -46,6 +46,7 @@ #include <QString> #include <QStringList> #include <QPointer> +#include <QDBusVariant> class QMailServiceConfiguration; @@ -98,6 +99,7 @@ public slots: void shutdown(); void listActions(); void protocolRequest(quint64 action, const QMailAccountId &accountId, const QString &request, const QVariant &data); + void protocolRequest(quint64 action, const QMailAccountId &accountId, const QString &request, const QDBusVariant &data); signals: void actionStarted(QMailActionData action); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..476c068e --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,32 @@ +add_subdirectory(tst_locks) +add_subdirectory(tst_longstream) +add_subdirectory(tst_longstring) +add_subdirectory(tst_python_email) +add_subdirectory(tst_qlogsystem) +add_subdirectory(tst_qmail_listmodels) +add_subdirectory(tst_qmail_sortkeys) +add_subdirectory(tst_qmailaddress) +add_subdirectory(tst_qmailcodec) +add_subdirectory(tst_qmaildisconnected) +add_subdirectory(tst_qmaillog) +add_subdirectory(tst_qmailmessage) +add_subdirectory(tst_qmailmessagebody) +add_subdirectory(tst_qmailmessageheader) +add_subdirectory(tst_qmailmessagepart) +add_subdirectory(tst_qmailmessageset) +add_subdirectory(tst_qmailnamespace) +add_subdirectory(tst_qmailserviceaction) +add_subdirectory(tst_qmailstorageaction) +add_subdirectory(tst_qmailstore) +add_subdirectory(tst_qmailstorekeys) +add_subdirectory(tst_qmailthread) +add_subdirectory(tst_qmflist) +add_subdirectory(tst_qprivateimplementation) +add_subdirectory(tst_smtp) +add_subdirectory(tst_storagemanager) + +find_program(GPGME_CONFIG gpgme-config) +if (GPGME_CONFIG) + execute_process(COMMAND ${GPGME_CONFIG} --libs OUTPUT_VARIABLE GPGME_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) + add_subdirectory(tst_crypto) +endif() diff --git a/tests/tst_crypto/CMakeLists.txt b/tests/tst_crypto/CMakeLists.txt new file mode 100644 index 00000000..d052d5a3 --- /dev/null +++ b/tests/tst_crypto/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_crypto tst_crypto.cpp) +target_include_directories(tst_crypto + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_crypto + PRIVATE Qt6::Core Qt6::Test QmfClient ${GPGME_LIBS}) + +install(TARGETS tst_crypto + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_locks/CMakeLists.txt b/tests/tst_locks/CMakeLists.txt new file mode 100644 index 00000000..9a1223f9 --- /dev/null +++ b/tests/tst_locks/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_locks tst_locks.cpp) +target_include_directories(tst_locks + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_locks + PRIVATE Qt6::Core Qt6::Test QmfClient) + +install(TARGETS tst_locks + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_locks/tst_locks.cpp b/tests/tst_locks/tst_locks.cpp index 339aeb9c..8d5364cd 100644 --- a/tests/tst_locks/tst_locks.cpp +++ b/tests/tst_locks/tst_locks.cpp @@ -34,7 +34,7 @@ #include <QObject> #include <QTest> #include <qmailaddress.h> -#include <private/locks_p.h> +#include <locks_p.h> #include "qmailaccountkey.h" #include <ctype.h> diff --git a/tests/tst_longstream/CMakeLists.txt b/tests/tst_longstream/CMakeLists.txt new file mode 100644 index 00000000..54492bd0 --- /dev/null +++ b/tests/tst_longstream/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_longstream tst_longstream.cpp) +target_include_directories(tst_longstream + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_longstream + PRIVATE Qt6::Core Qt6::Test QmfClient) + +install(TARGETS tst_longstream + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_longstream/tst_longstream.cpp b/tests/tst_longstream/tst_longstream.cpp index 26d042f7..4184691e 100644 --- a/tests/tst_longstream/tst_longstream.cpp +++ b/tests/tst_longstream/tst_longstream.cpp @@ -33,7 +33,7 @@ #include <QObject> #include <QTest> -#include <private/longstream_p.h> +#include <longstream_p.h> #include <ctype.h> #include <QDir> #include <QRegularExpression> diff --git a/tests/tst_longstring/CMakeLists.txt b/tests/tst_longstring/CMakeLists.txt new file mode 100644 index 00000000..fcf58e64 --- /dev/null +++ b/tests/tst_longstring/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_longstring tst_longstring.cpp) +target_include_directories(tst_longstring + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_longstring + PRIVATE Qt6::Core Qt6::Test QmfClient) + +install(TARGETS tst_longstring + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_longstring/tst_longstring.cpp b/tests/tst_longstring/tst_longstring.cpp index e18523b3..76c60f78 100644 --- a/tests/tst_longstring/tst_longstring.cpp +++ b/tests/tst_longstring/tst_longstring.cpp @@ -34,7 +34,7 @@ #include <QObject> #include <QTest> #include <qmailaddress.h> -#include <private/longstring_p.h> +#include <longstring_p.h> #include <ctype.h> diff --git a/tests/tst_python_email/CMakeLists.txt b/tests/tst_python_email/CMakeLists.txt new file mode 100644 index 00000000..9938172b --- /dev/null +++ b/tests/tst_python_email/CMakeLists.txt @@ -0,0 +1,10 @@ +add_executable(tst_python_email tst_python_email.cpp) +target_include_directories(tst_python_email + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_python_email + PRIVATE Qt6::Core Qt6::Test QmfClient) + +install(TARGETS tst_python_email + RUNTIME DESTINATION /opt/tests/qmf) + +install(DIRECTORY testdata DESTINATION /opt/tests/qmf) diff --git a/tests/tst_python_email/tst_python_email.cpp b/tests/tst_python_email/tst_python_email.cpp index 1eb8e570..224a7895 100644 --- a/tests/tst_python_email/tst_python_email.cpp +++ b/tests/tst_python_email/tst_python_email.cpp @@ -34,7 +34,7 @@ #include <QObject> #include <QTest> #include <qmailmessage.h> -#include <private/longstring_p.h> +#include <longstring_p.h> #include <qmailnamespace.h> #include <ctype.h> diff --git a/tests/tst_qlogsystem/CMakeLists.txt b/tests/tst_qlogsystem/CMakeLists.txt new file mode 100644 index 00000000..801512c9 --- /dev/null +++ b/tests/tst_qlogsystem/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qlogsystem tst_qlogsystem.cpp) +target_include_directories(tst_qlogsystem + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qlogsystem + PRIVATE Qt6::Core Qt6::Test QmfClient) + +install(TARGETS tst_qlogsystem + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmail_listmodels/CMakeLists.txt b/tests/tst_qmail_listmodels/CMakeLists.txt new file mode 100644 index 00000000..2b1bffe2 --- /dev/null +++ b/tests/tst_qmail_listmodels/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmail_listmodels tst_qmail_listmodels.cpp) +target_include_directories(tst_qmail_listmodels + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmail_listmodels + PRIVATE Qt6::Core Qt6::Test QmfClient) + +install(TARGETS tst_qmail_listmodels + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmail_sortkeys/CMakeLists.txt b/tests/tst_qmail_sortkeys/CMakeLists.txt new file mode 100644 index 00000000..4cbfbbde --- /dev/null +++ b/tests/tst_qmail_sortkeys/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmail_sortkeys tst_qmail_sortkeys.cpp) +target_include_directories(tst_qmail_sortkeys + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmail_sortkeys + PRIVATE Qt6::Core Qt6::Test QmfClient) + +install(TARGETS tst_qmail_sortkeys + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailaddress/CMakeLists.txt b/tests/tst_qmailaddress/CMakeLists.txt new file mode 100644 index 00000000..d49d4668 --- /dev/null +++ b/tests/tst_qmailaddress/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailaddress tst_qmailaddress.cpp) +target_include_directories(tst_qmailaddress + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailaddress + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmailaddress + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailcodec/CMakeLists.txt b/tests/tst_qmailcodec/CMakeLists.txt new file mode 100644 index 00000000..7f699b93 --- /dev/null +++ b/tests/tst_qmailcodec/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailcodec tst_qmailcodec.cpp) +target_include_directories(tst_qmailcodec + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailcodec + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmailcodec + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmaildisconnected/CMakeLists.txt b/tests/tst_qmaildisconnected/CMakeLists.txt new file mode 100644 index 00000000..59aff014 --- /dev/null +++ b/tests/tst_qmaildisconnected/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmaildisconnected tst_qmaildisconnected.cpp) +target_include_directories(tst_qmaildisconnected + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmaildisconnected + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmaildisconnected + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmaillog/CMakeLists.txt b/tests/tst_qmaillog/CMakeLists.txt new file mode 100644 index 00000000..50f68cf2 --- /dev/null +++ b/tests/tst_qmaillog/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmaillog tst_qmaillog.cpp) +target_include_directories(tst_qmaillog + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmaillog + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmaillog + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailmessage/CMakeLists.txt b/tests/tst_qmailmessage/CMakeLists.txt new file mode 100644 index 00000000..aa8c941b --- /dev/null +++ b/tests/tst_qmailmessage/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailmessage tst_qmailmessage.cpp) +target_include_directories(tst_qmailmessage + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailmessage + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmailmessage + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailmessagebody/CMakeLists.txt b/tests/tst_qmailmessagebody/CMakeLists.txt new file mode 100644 index 00000000..6bb72979 --- /dev/null +++ b/tests/tst_qmailmessagebody/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailmessagebody tst_qmailmessagebody.cpp) +target_include_directories(tst_qmailmessagebody + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailmessagebody + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmailmessagebody + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailmessageheader/CMakeLists.txt b/tests/tst_qmailmessageheader/CMakeLists.txt new file mode 100644 index 00000000..b68e7d3a --- /dev/null +++ b/tests/tst_qmailmessageheader/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailmessageheader tst_qmailmessageheader.cpp) +target_include_directories(tst_qmailmessageheader + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailmessageheader + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmailmessageheader + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailmessagepart/CMakeLists.txt b/tests/tst_qmailmessagepart/CMakeLists.txt new file mode 100644 index 00000000..f0ac816a --- /dev/null +++ b/tests/tst_qmailmessagepart/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailmessagepart tst_qmailmessagepart.cpp) +target_include_directories(tst_qmailmessagepart + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailmessagepart + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmailmessagepart + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailmessageset/CMakeLists.txt b/tests/tst_qmailmessageset/CMakeLists.txt new file mode 100644 index 00000000..25be88e6 --- /dev/null +++ b/tests/tst_qmailmessageset/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailmessageset tst_qmailmessageset.cpp) +target_include_directories(tst_qmailmessageset + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailmessageset + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmailmessageset + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailmessageset/tst_qmailmessageset.cpp b/tests/tst_qmailmessageset/tst_qmailmessageset.cpp index b3bccba9..fe040695 100644 --- a/tests/tst_qmailmessageset/tst_qmailmessageset.cpp +++ b/tests/tst_qmailmessageset/tst_qmailmessageset.cpp @@ -35,7 +35,7 @@ #include <QTest> #include <ctype.h> #include "qmailmessageset.h" -#include <private/qmailmessageset_p.h> +#include <qmailmessageset_p.h> #include "qmailstore.h" /* diff --git a/tests/tst_qmailnamespace/CMakeLists.txt b/tests/tst_qmailnamespace/CMakeLists.txt new file mode 100644 index 00000000..2c708135 --- /dev/null +++ b/tests/tst_qmailnamespace/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailnamespace tst_qmailnamespace.cpp) +target_include_directories(tst_qmailnamespace + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailnamespace + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmailnamespace + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailserviceaction/CMakeLists.txt b/tests/tst_qmailserviceaction/CMakeLists.txt new file mode 100644 index 00000000..b63a8a2c --- /dev/null +++ b/tests/tst_qmailserviceaction/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailserviceaction tst_qmailserviceaction.cpp) +target_include_directories(tst_qmailserviceaction + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailserviceaction + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmailserviceaction + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailserviceaction/tst_qmailserviceaction.cpp b/tests/tst_qmailserviceaction/tst_qmailserviceaction.cpp index 7b59924e..a0ae627b 100644 --- a/tests/tst_qmailserviceaction/tst_qmailserviceaction.cpp +++ b/tests/tst_qmailserviceaction/tst_qmailserviceaction.cpp @@ -36,7 +36,7 @@ #include <QTest> #include <QSignalSpy> #include <qmailserviceaction.h> -#include <private/qmailserviceaction_p.h> +#include <qmailserviceaction_p.h> #include <qmailaccount.h> diff --git a/tests/tst_qmailstorageaction/CMakeLists.txt b/tests/tst_qmailstorageaction/CMakeLists.txt new file mode 100644 index 00000000..049b58c3 --- /dev/null +++ b/tests/tst_qmailstorageaction/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailstorageaction tst_qmailstorageaction.cpp) +target_include_directories(tst_qmailstorageaction + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailstorageaction + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmailstorageaction + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailstorageaction/tst_qmailstorageaction.cpp b/tests/tst_qmailstorageaction/tst_qmailstorageaction.cpp index 72cd1570..81562147 100644 --- a/tests/tst_qmailstorageaction/tst_qmailstorageaction.cpp +++ b/tests/tst_qmailstorageaction/tst_qmailstorageaction.cpp @@ -34,7 +34,7 @@ #include <QObject> #include <QTest> #include <qmailserviceaction.h> -#include <private/qmailserviceaction_p.h> +#include <qmailserviceaction_p.h> #include <qmailaccount.h> #include <qmaildisconnected.h> #include <qmailnamespace.h> diff --git a/tests/tst_qmailstore/CMakeLists.txt b/tests/tst_qmailstore/CMakeLists.txt new file mode 100644 index 00000000..83846f63 --- /dev/null +++ b/tests/tst_qmailstore/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailstore tst_qmailstore.cpp) +target_include_directories(tst_qmailstore + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailstore + PRIVATE Qt6::Core Qt6::Sql Qt6::Test QmfClient) + +install(TARGETS tst_qmailstore + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailstore/tst_qmailstore.cpp b/tests/tst_qmailstore/tst_qmailstore.cpp index 61635b8c..c1c43c09 100644 --- a/tests/tst_qmailstore/tst_qmailstore.cpp +++ b/tests/tst_qmailstore/tst_qmailstore.cpp @@ -38,7 +38,7 @@ #include <qmailstore.h> #include <QSettings> #include <qmailnamespace.h> -#include <private/qmailstoreimplementation_p.h> +#include <qmailstoreimplementation_p.h> //TESTED_CLASS=QMailStore //TESTED_FILES=src/libraries/qtopiamail/qmailstore.cpp diff --git a/tests/tst_qmailstorekeys/CMakeLists.txt b/tests/tst_qmailstorekeys/CMakeLists.txt new file mode 100644 index 00000000..25347fbf --- /dev/null +++ b/tests/tst_qmailstorekeys/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailstorekeys tst_qmailstorekeys.cpp) +target_include_directories(tst_qmailstorekeys + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailstorekeys + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmailstorekeys + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmailstorekeys/tst_qmailstorekeys.cpp b/tests/tst_qmailstorekeys/tst_qmailstorekeys.cpp index c17ad816..e7adfb07 100644 --- a/tests/tst_qmailstorekeys/tst_qmailstorekeys.cpp +++ b/tests/tst_qmailstorekeys/tst_qmailstorekeys.cpp @@ -38,7 +38,7 @@ #include <qmailstore.h> #include <QSettings> #include <qmailnamespace.h> -#include <private/locks_p.h> +#include <locks_p.h> class tst_QMailStoreKeys : public QObject { diff --git a/tests/tst_qmailthread/CMakeLists.txt b/tests/tst_qmailthread/CMakeLists.txt new file mode 100644 index 00000000..e576baad --- /dev/null +++ b/tests/tst_qmailthread/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmailthread tst_qmailthread.cpp) +target_include_directories(tst_qmailthread + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmailthread + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmailthread + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qmflist/CMakeLists.txt b/tests/tst_qmflist/CMakeLists.txt new file mode 100644 index 00000000..6122fe65 --- /dev/null +++ b/tests/tst_qmflist/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qmflist tst_qmflist.cpp) +target_include_directories(tst_qmflist + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qmflist + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qmflist + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qprivateimplementation/CMakeLists.txt b/tests/tst_qprivateimplementation/CMakeLists.txt new file mode 100644 index 00000000..faaf25e7 --- /dev/null +++ b/tests/tst_qprivateimplementation/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_qprivateimplementation tst_qprivateimplementation.cpp) +target_include_directories(tst_qprivateimplementation + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_qprivateimplementation + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_qprivateimplementation + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_qprivateimplementation/tst_qprivateimplementation.cpp b/tests/tst_qprivateimplementation/tst_qprivateimplementation.cpp index 06f72a53..4a96d78f 100644 --- a/tests/tst_qprivateimplementation/tst_qprivateimplementation.cpp +++ b/tests/tst_qprivateimplementation/tst_qprivateimplementation.cpp @@ -33,7 +33,7 @@ // We're effectively part of the QMF library for this test: #define QMF_INTERNAL -#include "private/qprivateimplementationdef_p.h" +#include <qprivateimplementationdef_p.h> #include <QObject> #include <QString> diff --git a/tests/tst_smtp/CMakeLists.txt b/tests/tst_smtp/CMakeLists.txt new file mode 100644 index 00000000..f44ad66e --- /dev/null +++ b/tests/tst_smtp/CMakeLists.txt @@ -0,0 +1,20 @@ +set(SMTP_SOURCES + ../../src/plugins/messageservices/smtp/smtpauthenticator.h + ../../src/plugins/messageservices/smtp/smtpclient.h + ../../src/plugins/messageservices/smtp/smtpconfiguration.h + ../../src/plugins/messageservices/smtp/smtpclient.cpp + ../../src/plugins/messageservices/smtp/smtpauthenticator.cpp + ../../src/plugins/messageservices/smtp/smtpconfiguration.cpp) + +add_executable(tst_smtp tst_smtp.cpp ${SMTP_SOURCES}) +target_include_directories(tst_smtp + PRIVATE + ../../src/libraries/qmfmessageserver + ../../src/libraries/qmfclient + ../../src/libraries/qmfclient/support + ../../src/plugins/messageservices/smtp) +target_link_libraries(tst_smtp + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Network Qt6::Test QmfClient QmfMessageServer) + +install(TARGETS tst_smtp + RUNTIME DESTINATION /opt/tests/qmf) diff --git a/tests/tst_storagemanager/CMakeLists.txt b/tests/tst_storagemanager/CMakeLists.txt new file mode 100644 index 00000000..ea25cb70 --- /dev/null +++ b/tests/tst_storagemanager/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(tst_storagemanager tst_storagemanager.cpp) +target_include_directories(tst_storagemanager + PRIVATE ../../src/libraries/qmfclient ../../src/libraries/qmfclient/support) +target_link_libraries(tst_storagemanager + PRIVATE Qt6::Core Qt6::Core5Compat Qt6::Test QmfClient) + +install(TARGETS tst_storagemanager + RUNTIME DESTINATION /opt/tests/qmf) |
