Browse Source

qt: rename Network*Models::parsingPending to loading

pull/162/head
Prince Gupta 3 years ago
committed by Jean-Baptiste Kempf
parent
commit
2ab429c8cb
  1. 8
      modules/gui/qt/network/networkmediamodel.cpp
  2. 8
      modules/gui/qt/network/networkmediamodel.hpp
  3. 12
      modules/gui/qt/network/qml/BrowseTreeDisplay.qml
  4. 2
      modules/gui/qt/network/qml/ServicesManage.qml
  5. 10
      modules/gui/qt/network/servicesdiscoverymodel.cpp
  6. 8
      modules/gui/qt/network/servicesdiscoverymodel.hpp

8
modules/gui/qt/network/networkmediamodel.cpp

@ -449,8 +449,8 @@ bool NetworkMediaModel::initializeMediaSources()
m_preparseSem.acquire();
vlc_media_tree_Preparse( tree, libvlc, m_treeItem.media.get(), this );
m_parsingPending = true;
emit parsingPendingChanged(m_parsingPending);
m_loading = true;
emit loadingChanged(m_loading);
m_listener = std::move( l );
@ -548,8 +548,8 @@ void NetworkMediaModel::ListenerCb::onItemPreparseEnded(MediaTreePtr, input_item
if (p_node != model->m_treeItem.media)
return;
model->m_parsingPending = false;
model->emit parsingPendingChanged(false);
model->m_loading = false;
model->emit loadingChanged(false);
});
}

8
modules/gui/qt/network/networkmediamodel.hpp

@ -141,7 +141,7 @@ public:
Q_PROPERTY(ItemType type READ getType NOTIFY typeChanged)
Q_PROPERTY(bool indexed READ isIndexed WRITE setIndexed NOTIFY isIndexedChanged)
Q_PROPERTY(bool canBeIndexed READ canBeIndexed NOTIFY canBeIndexedChanged)
Q_PROPERTY(bool parsingPending READ getParsingPending NOTIFY parsingPendingChanged)
Q_PROPERTY(bool loading READ isLoading NOTIFY loadingChanged)
Q_PROPERTY(int count READ getCount NOTIFY countChanged)
explicit NetworkMediaModel(QObject* parent = nullptr);
@ -167,7 +167,7 @@ public:
inline ItemType getType() const { return m_type; }
inline bool isIndexed() const { return m_indexed; }
inline bool canBeIndexed() const { return m_canBeIndexed; }
inline bool getParsingPending() const { return m_parsingPending; }
inline bool isLoading() const { return m_loading; }
int getCount() const;
Q_INVOKABLE QMap<QString, QVariant> getDataAt(int idx);
@ -188,7 +188,7 @@ signals:
void typeChanged();
void isIndexedChanged();
void canBeIndexedChanged();
void parsingPendingChanged(bool);
void loadingChanged(bool);
void countChanged();
void ctxChanged();
@ -237,7 +237,7 @@ private:
ItemType m_type = ItemType::TYPE_UNKNOWN;
bool m_indexed = false;
bool m_canBeIndexed = false;
bool m_parsingPending = false;
bool m_loading = false;
QSemaphore m_preparseSem;
std::vector<Item> m_items;

12
modules/gui/qt/network/qml/BrowseTreeDisplay.qml

@ -39,8 +39,8 @@ MainInterface.MainViewLoader {
readonly property bool isViewMultiView: true
// 'parsingPending' property is not available with NetworkDevicesModel
readonly property bool parsing: Helpers.get(providerModel, "parsingPending", false)
// 'loading' property is not available with NetworkDevicesModel
readonly property bool loading: Helpers.get(providerModel, "loading", false)
property var sortModel: [
{ text: I18n.qtr("Alphabetic"), criteria: "name"},
@ -68,7 +68,7 @@ MainInterface.MainViewLoader {
// override the default currentComponent assignment from MainViewLoader
// because we need to show empty label when model is parsing
currentComponent: {
if (filterModel.count == 0 || root.parsing)
if (filterModel.count == 0 || root.loading)
return emptyLabelComponent
else if (MainCtx.gridView)
return gridComponent
@ -349,7 +349,7 @@ MainInterface.MainViewLoader {
Widgets.EmptyLabelButton {
id: emptyLabel
visible: !root.parsing
visible: !root.loading
// FIXME: find better cover
cover: VLCStyle.noArtVideoCover
@ -384,7 +384,7 @@ MainInterface.MainViewLoader {
}
Item {
visible: root.parsing
visible: root.loading
Layout.fillHeight: true
Layout.fillWidth: true
@ -392,7 +392,7 @@ MainInterface.MainViewLoader {
Widgets.BusyIndicatorExt {
id: busyIndicator
runningDelayed: root.parsing
runningDelayed: root.loading
anchors.centerIn: parent
z: 1
}

2
modules/gui/qt/network/qml/ServicesManage.qml

@ -143,7 +143,7 @@ Widgets.KeyNavigableListView {
}
Widgets.BusyIndicatorExt {
runningDelayed: discoveryModel.parsingPending
runningDelayed: discoveryModel.loading
anchors.centerIn: parent
color: servicesView.colorContext.fg.primary
z: 1

10
modules/gui/qt/network/servicesdiscoverymodel.cpp

@ -154,8 +154,8 @@ void ServicesDiscoveryModel::initializeManager()
m_manager = addons_manager_New( VLC_OBJECT( m_ctx->getIntf() ), &owner );
assert( m_manager );
m_parsingPending = true;
emit parsingPendingChanged();
m_loading = true;
emit loadingChanged();
addons_manager_LoadCatalog( m_manager );
addons_manager_Gather( m_manager, "repo://" );
}
@ -215,9 +215,9 @@ void ServicesDiscoveryModel::addonChanged( ServicesDiscoveryModel::AddonPtr addo
void ServicesDiscoveryModel::discoveryEnded()
{
assert( m_parsingPending );
m_parsingPending = false;
emit parsingPendingChanged();
assert( m_loading );
m_loading = false;
emit loadingChanged();
}
ServicesDiscoveryModel::Item::Item( ServicesDiscoveryModel::AddonPtr addon )

8
modules/gui/qt/network/servicesdiscoverymodel.hpp

@ -40,7 +40,7 @@ class ServicesDiscoveryModel : public QAbstractListModel
public:
Q_PROPERTY(MainCtx* ctx READ getCtx WRITE setCtx NOTIFY ctxChanged FINAL)
Q_PROPERTY(bool parsingPending READ getParsingPending NOTIFY parsingPendingChanged FINAL)
Q_PROPERTY(bool loading READ isLoading NOTIFY loadingChanged FINAL)
Q_PROPERTY(int count READ getCount NOTIFY countChanged FINAL)
enum State // equivalent to addon_state_t
@ -74,7 +74,7 @@ public:
void setCtx(MainCtx* ctx);
inline MainCtx* getCtx() const { return m_ctx; }
inline bool getParsingPending() const { return m_parsingPending; }
inline bool isLoading() const { return m_loading; }
int getCount() const;
Q_INVOKABLE QMap<QString, QVariant> getDataAt(int idx);
@ -82,7 +82,7 @@ public:
Q_INVOKABLE void removeService(int idx);
signals:
void parsingPendingChanged();
void loadingChanged();
void countChanged();
void ctxChanged();
@ -116,7 +116,7 @@ private:
std::vector<Item> m_items;
MainCtx* m_ctx = nullptr;
addons_manager_t* m_manager = nullptr;
bool m_parsingPending = false;
bool m_loading = false;
};
#endif // MLServicesDiscoveryModel_HPP

Loading…
Cancel
Save