diff options
| author | Andrew Branson <andrew.branson@jolla.com> | 2026-04-03 22:55:30 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@jolla.com> | 2026-04-04 11:55:25 +0200 |
| commit | a35c9fa159173388d88ef77e1d31f53488aad094 (patch) | |
| tree | e4691b5bbf054ca13e35d98d9df653bf9cdc0054 /transferengine-plugins/mastodontransferplugin/mastodonapi.h | |
| parent | 5f999f7a4712c4a4d1c89054b544064cfd4b769e (diff) | |
Generalize for all fediverse accounts
Diffstat (limited to 'transferengine-plugins/mastodontransferplugin/mastodonapi.h')
| -rw-r--r-- | transferengine-plugins/mastodontransferplugin/mastodonapi.h | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/transferengine-plugins/mastodontransferplugin/mastodonapi.h b/transferengine-plugins/mastodontransferplugin/mastodonapi.h deleted file mode 100644 index df4c87a..0000000 --- a/transferengine-plugins/mastodontransferplugin/mastodonapi.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2013 - 2026 Jolla Ltd. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef MASTODONAPI_H -#define MASTODONAPI_H - -#include <QtCore/QMap> -#include <QtCore/QObject> - -#include <QtNetwork/QNetworkAccessManager> -#include <QtNetwork/QNetworkReply> - -class MastodonApi : public QObject -{ - Q_OBJECT - -public: - enum API_CALL { - NONE, - UPLOAD_MEDIA, - POST_STATUS - }; - - explicit MastodonApi(QNetworkAccessManager *qnam, QObject *parent = 0); - ~MastodonApi(); - - bool uploadImage(const QString &filePath, - const QString &statusText, - const QString &mimeType, - const QString &apiHost, - const QString &accessToken); - bool postStatus(const QString &statusText, - const QString &apiHost, - const QString &accessToken); - - void cancelUpload(); - -Q_SIGNALS: - void transferProgressUpdated(qreal progress); - void transferFinished(); - void transferError(); - void transferCanceled(); - void credentialsExpired(); - -private Q_SLOTS: - void replyError(QNetworkReply::NetworkError error); - void finished(); - void uploadProgress(qint64 received, qint64 total); - -private: - bool postStatusInternal(const QString &mediaId); - void finishTransfer(QNetworkReply::NetworkError error, int httpCode, const QByteArray &data); - - QMap<QNetworkReply*, API_CALL> m_replies; - bool m_cancelRequested; - QNetworkAccessManager *m_qnam; - QString m_accessToken; - QString m_apiHost; - QString m_statusText; -}; - -#endif // MASTODONAPI_H |
