Itinerary Component

Move the itinerary model representation to it's own component and instantiate from MessageComponentModel. This starts to lay some groundwork for previewing other files.
This commit is contained in:
James Graham
2024-03-16 09:28:30 +00:00
parent 81a79105d7
commit 5ff199cc3e
9 changed files with 161 additions and 120 deletions

View File

@@ -3,6 +3,7 @@
#include "itinerarymodel.h"
#include <QJsonDocument>
#include <QProcess>
#include "config-neochat.h"
@@ -16,20 +17,6 @@ ItineraryModel::ItineraryModel(QObject *parent)
{
}
void ItineraryModel::setConnection(NeoChatConnection *connection)
{
if (m_connection == connection) {
return;
}
m_connection = connection;
Q_EMIT connectionChanged();
}
NeoChatConnection *ItineraryModel::connection() const
{
return m_connection;
}
QVariant ItineraryModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid()) {
@@ -133,11 +120,7 @@ QString ItineraryModel::path() const
void ItineraryModel::setPath(const QString &path)
{
if (path == m_path) {
return;
}
m_path = path;
Q_EMIT pathChanged();
loadData();
}