Skip to content

Commit

Permalink
[libcommhistory] Use commhistory specific tmp directory for outgoing …
Browse files Browse the repository at this point in the history
…MMS. JB#52525
  • Loading branch information
rainemak committed Dec 17, 2020
1 parent 88f398a commit f0c349b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion declarative/src/mmshelper.cpp
Expand Up @@ -74,7 +74,16 @@ class MmsHelper::TempDir : public QObject {
Q_OBJECT

public:
TempDir() { m_tempDir.setAutoRemove(true); }
TempDir(QObject *parent = nullptr)
: QObject(parent)
, m_tempDir(TempDir::basePath() + "/mms")
{
}

static QString basePath() {
return QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/commhistory-tmp");
}

bool isValid() const { return m_tempDir.isValid(); }
QString path() const { return m_tempDir.path(); }

Expand Down Expand Up @@ -197,6 +206,8 @@ bool MmsHelper::sendMessage(const QStringList &to, const QStringList &cc, const
bool MmsHelper::sendMessage(const QString &imsi, const QStringList &to, const QStringList &cc,
const QStringList &bcc, const QString &subject, const QVariantList &parts)
{
QDir dir;
dir.mkpath(TempDir::basePath());
TempDir *tempDir = new TempDir;
QDBusPendingCallWatcher *call = sendMessage(*tempDir, imsi, to, cc, bcc, subject, parts);
if (call) {
Expand Down

0 comments on commit f0c349b

Please sign in to comment.