mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
a181020b19
on iOS it is practically impossible to copy the App log to e.g. a mail! in iOS 11 the log file is stored within the subsurface container and you first need to copy (actually using the clipboard) out from there to the "normal" document shared space, before it can be used. At least iOS users (and I believe Android users) are not really used to work with files, so the process is not easy to document in an understandable way. The alternative is to provide a button, which simply puts the log on the general clipboard, allowing it to be pasted in a multitud of applications. Signed-off-by: Jan Iversen <jani@apache.org>
31 lines
795 B
C++
31 lines
795 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef MESSAGEHANDLERMODEL_H
|
|
#define MESSAGEHANDLERMODEL_H
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
|
|
class MessageHandlerModel : public QAbstractListModel {
|
|
Q_OBJECT
|
|
public:
|
|
static MessageHandlerModel *self();
|
|
enum MsgTypes {Message = Qt::UserRole + 1, Severity};
|
|
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
|
QVariant data(const QModelIndex& idx, int role) const override;
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
void addLog(QtMsgType type, const QString& message);
|
|
const QString logAsString();
|
|
|
|
/* call this to clear the debug data */
|
|
Q_INVOKABLE void reset();
|
|
|
|
private:
|
|
MessageHandlerModel(QObject *parent = 0);
|
|
struct MessageData {
|
|
QString message;
|
|
QtMsgType type;
|
|
};
|
|
QVector<MessageData> m_data;
|
|
};
|
|
|
|
#endif
|