diff options
| author | Pekka Vuorela <pvuorela@iki.fi> | 2025-10-15 17:08:24 +0300 |
|---|---|---|
| committer | Pekka Vuorela <pvuorela@iki.fi> | 2025-10-15 21:04:55 +0300 |
| commit | 018eff9c33b7732eb53ce9f8dc4acb3de503677d (patch) | |
| tree | 748e5c4a72f75822dbf7d6f266f4cae2e1a2ba63 /examples | |
| parent | 945aec721c243f8e3bc1e5e8be6088bc1a3e3720 (diff) | |
Remove QMail::messageServerPath() and messageSettingsPath()
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>
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/qtmail/emailclient.cpp | 50 | ||||
| -rw-r--r-- | examples/qtmail/emailclient.h | 4 |
2 files changed, 5 insertions, 49 deletions
diff --git a/examples/qtmail/emailclient.cpp b/examples/qtmail/emailclient.cpp index f817957e..383fa27e 100644 --- a/examples/qtmail/emailclient.cpp +++ b/examples/qtmail/emailclient.cpp @@ -464,7 +464,6 @@ EmailClient::EmailClient(QWidget *parent, Qt::WindowFlags f) autoGetMail(false), initialAction(None), preSearchWidgetId(-1), - m_messageServerProcess(0), m_contextMenu(0), m_transmitAction(0), m_retrievalAction(0), @@ -489,10 +488,8 @@ EmailClient::EmailClient(QWidget *parent, Qt::WindowFlags f) EmailClient::~EmailClient() { clearNewMessageStatus(messageListView()->key()); - waitForMessageServer(); } - void EmailClient::openFiles() { delayedInit(); @@ -553,39 +550,10 @@ void EmailClient::resumeInterruptedComposition() bool EmailClient::startMessageServer() { - qCDebug(lcMessaging) << "Starting messageserver child process..."; - if (m_messageServerProcess) delete m_messageServerProcess; - m_messageServerProcess = new QProcess(this); - connect(m_messageServerProcess,SIGNAL(error(QProcess::ProcessError)), - this,SLOT(messageServerProcessError(QProcess::ProcessError))); - -#ifdef Q_OS_WIN - static const QString binary(QString("/messageserver5%1.exe").arg(debugSuffix)); -#else - static const QString binary(QString("/messageserver5%1").arg(debugSuffix)); -#endif - - m_messageServerProcess->start(QMail::messageServerPath() + binary); - return m_messageServerProcess->waitForStarted(); -} - -bool EmailClient::waitForMessageServer() -{ - if (m_messageServerProcess) - { - qCDebug(lcMessaging) << "Shutting down messageserver child process.."; - bool result = m_messageServerProcess->waitForFinished(); - delete m_messageServerProcess; m_messageServerProcess = 0; - return result; - } - return true; -} - -void EmailClient::messageServerProcessError(QProcess::ProcessError e) -{ - QString errorMsg = tr("The Message server child process encountered an error (%1). Qtmail will now exit.").arg(static_cast<int>(e)); - QMessageBox::critical(this, tr("Message Server"), errorMsg); - qFatal(errorMsg.toLatin1(), ""); + // TODO: old implementation removed + // should qmfclient API have some method to request starting the message server? + qCWarning(lcMessaging) << "Starting messageserver by app not supported at the moment"; + return false; } void EmailClient::connectServiceAction(QMailServiceAction* action) @@ -2339,15 +2307,7 @@ void EmailClient::quit() } } - if (m_messageServerProcess) - { - //we started the messageserver, direct it to shut down - //before we quit ourselves - QMailMessageServer server; - server.shutdown(); - QTimer::singleShot(0,qApp,SLOT(quit())); - } - else QApplication::quit(); + QApplication::quit(); } void EmailClient::closeEvent(QCloseEvent *e) diff --git a/examples/qtmail/emailclient.h b/examples/qtmail/emailclient.h index 12107351..8425ef64 100644 --- a/examples/qtmail/emailclient.h +++ b/examples/qtmail/emailclient.h @@ -44,7 +44,6 @@ #include <QSystemTrayIcon> #include <QTime> #include <QTimer> -#include <QProcess> class EmailFolderModel; class EmailFolderView; @@ -279,8 +278,6 @@ private slots: void threadMessages(); void resumeInterruptedComposition(); bool startMessageServer(); - bool waitForMessageServer(); - void messageServerProcessError(QProcess::ProcessError); void createFolder(); void deleteFolder(); @@ -432,7 +429,6 @@ private: QMailMessageId lastDraftId; - QProcess* m_messageServerProcess; QSet<QMailMessageId> flagMessageIds; QMenu* m_contextMenu; QToolBar* m_toolBar; |
