Marble
AbstractDataPluginModel.cpp
53 AbstractDataPluginModelPrivate(const QString &name, const MarbleModel *marbleModel, AbstractDataPluginModel *parent);
106AbstractDataPluginModelPrivate::AbstractDataPluginModelPrivate(const QString &name, const MarbleModel *marbleModel, AbstractDataPluginModel *parent)
119 , m_storagePolicy(MarbleDirs::localPath() + QLatin1StringView("/cache/") + m_name + QLatin1Char('/'))
163static bool lessThanByPointer(const AbstractDataPluginItem *item1, const AbstractDataPluginItem *item2)
242AbstractDataPluginModel::AbstractDataPluginModel(const QString &name, const MarbleModel *marbleModel, QObject *parent)
249 connect(&d->m_downloadManager, SIGNAL(downloadComplete(QString, QString)), this, SLOT(processFinishedJob(QString, QString)));
254 connect(&d->m_downloadTimer, SIGNAL(timeout()), this, SLOT(handleChangedViewport()), Qt::QueuedConnection);
268QList<AbstractDataPluginItem *> AbstractDataPluginModel::items(const ViewportParams *viewport, qint32 number)
273 Q_ASSERT(!d->m_displayedItems.contains(nullptr) && "Null item in m_displayedItems. Please report a bug to marble-devel@kde.org");
274 Q_ASSERT(!d->m_itemSet.contains(nullptr) && "Null item in m_itemSet. Please report a bug to marble-devel@kde.org");
362void AbstractDataPluginModel::downloadItem(const QUrl &url, const QString &type, AbstractDataPluginItem *item)
412 QList<AbstractDataPluginItem *>::iterator i = std::lower_bound(d->m_itemSet.begin(), d->m_itemSet.end(), item, lessThanByPointer);
416 connect(item, &AbstractDataPluginItem::stickyChanged, this, &AbstractDataPluginModel::scheduleItemSort);
419 connect(item, &AbstractDataPluginItem::favoriteChanged, this, &AbstractDataPluginModel::favoriteItemChanged);
515QString AbstractDataPluginModelPrivate::generateFilepath(const QString &id, const QString &type) const
517 return MarbleDirs::localPath() + QLatin1StringView("/cache/") + m_name + QLatin1Char('/') + generateFilename(id, type);
552 && (fabs(d->m_downloadedBox.east() - d->m_lastBox.east()) * boxComparisonFactor > d->m_lastBox.width()
553 || fabs(d->m_downloadedBox.south() - d->m_lastBox.south()) * boxComparisonFactor > d->m_lastBox.height()
554 || fabs(d->m_downloadedBox.north() - d->m_lastBox.north()) * boxComparisonFactor > d->m_lastBox.height()
555 || fabs(d->m_downloadedBox.west() - d->m_lastBox.west()) * boxComparisonFactor > d->m_lastBox.width())) {
573void AbstractDataPluginModel::processFinishedJob(const QString &relativeUrlString, const QString &id)
This file contains the headers for MarbleModel.
This file contains the headers for ViewportParams.
An abstract data model (not based on QAbstractModel) for a AbstractDataPlugin.
Definition AbstractDataPluginModel.h:40
virtual void getItem(const QString &id)
Retrieve data for a specific item.
Definition AbstractDataPluginModel.cpp:439
QList< AbstractDataPluginItem * > whichItemAt(const QPoint &curpos)
Get all items that contain the given point Returns a list of all items that contain the point curpos.
Definition AbstractDataPluginModel.cpp:343
void setItemSettings(const QHash< QString, QVariant > &itemSettings)
Sets the settings for all items.
Definition AbstractDataPluginModel.cpp:536
QList< AbstractDataPluginItem * > items(const ViewportParams *viewport, qint32 number=10)
Get the items on the viewport Returns the currently downloaded images in the viewport.
Definition AbstractDataPluginModel.cpp:268
bool itemExists(const QString &id) const
Testing the existence of the item id in the list.
Definition AbstractDataPluginModel.cpp:531
void downloadItem(const QUrl &url, const QString &type, AbstractDataPluginItem *item)
Downloads the file from url.
Definition AbstractDataPluginModel.cpp:362
void addItemsToList(const QList< AbstractDataPluginItem * > &items)
Adds the items to the list of initialized items.
Definition AbstractDataPluginModel.cpp:390
virtual void parseFile(const QByteArray &file)
Parse the file and generate items.
Definition AbstractDataPluginModel.cpp:357
void addItemToList(AbstractDataPluginItem *item)
Convenience method to add one item to the list.
Definition AbstractDataPluginModel.cpp:385
void downloadDescriptionFile(const QUrl &url)
Download the description file from the url.
Definition AbstractDataPluginModel.cpp:374
AbstractDataPluginItem * findItem(const QString &id) const
Finds the item with id in the list.
Definition AbstractDataPluginModel.cpp:520
A class that defines a 3D bounding box for geographic data.
Definition GeoDataLatLonAltBox.h:40
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition MarbleModel.h:84
A public class that controls what is visible in the viewport of a Marble map.
Definition ViewportParams.h:41
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
QString name(StandardAction id)
KGuiItem clear()
Binds a QML item to a specific geodetic location in screen coordinates.
Definition AbstractDataPlugin.cpp:23
@ DownloadBrowse
Browsing mode, normal operation of Marble, like a web browser.
Definition MarbleGlobal.h:154
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const=0
virtual QModelIndex parent(const QModelIndex &index) const const=0
const char * constData() const const
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
iterator begin()
const_iterator constBegin() const const
const_iterator constEnd() const const
iterator end()
qsizetype length() const const
void removeAt(qsizetype i)
bool removeOne(const AT &t)
qsizetype size() const const
bool isValid() const const
int row() const const
QObject(QObject *parent)
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void destroyed(QObject *obj)
QString fromUtf8(QByteArrayView str)
QString & insert(qsizetype position, QChar ch)
QString number(double n, char format, int precision)
QByteArray toLatin1() const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
QString join(QChar separator) const const
QueuedConnection
DisplayRole
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:52:08 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:52:08 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.