mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
fix autoscroll to current date meeting #LINQT-1886
This commit is contained in:
parent
d742fa9ea0
commit
1ddfae8802
5 changed files with 18 additions and 19 deletions
|
|
@ -58,8 +58,8 @@ ConferenceInfoList::~ConferenceInfoList() {
|
|||
void ConferenceInfoList::setSelf(QSharedPointer<ConferenceInfoList> me) {
|
||||
mCoreModelConnection = SafeConnection<ConferenceInfoList, CoreModel>::create(me, CoreModel::getInstance());
|
||||
|
||||
mCoreModelConnection->makeConnectToCore(&ConferenceInfoList::lUpdate, [this](bool isInitialization) {
|
||||
mCoreModelConnection->invokeToModel([this, isInitialization]() {
|
||||
mCoreModelConnection->makeConnectToCore(&ConferenceInfoList::lUpdate, [this]() {
|
||||
mCoreModelConnection->invokeToModel([this]() {
|
||||
QList<QSharedPointer<ConferenceInfoCore>> *items = new QList<QSharedPointer<ConferenceInfoCore>>();
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
auto defaultAccount = CoreModel::getInstance()->getCore()->getDefaultAccount();
|
||||
|
|
@ -82,16 +82,13 @@ void ConferenceInfoList::setSelf(QSharedPointer<ConferenceInfoList> me) {
|
|||
items->push_back(confInfoCore);
|
||||
}
|
||||
}
|
||||
mCoreModelConnection->invokeToCore([this, items, isInitialization]() {
|
||||
mCoreModelConnection->invokeToCore([this, items]() {
|
||||
mustBeInMainThread(getClassName());
|
||||
for (auto &item : *items) {
|
||||
connectItem(item);
|
||||
}
|
||||
resetData(*items);
|
||||
delete items;
|
||||
if (isInitialization) {
|
||||
emit initialized();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -118,7 +115,7 @@ void ConferenceInfoList::setSelf(QSharedPointer<ConferenceInfoList> me) {
|
|||
if (mCurrentAccountCore)
|
||||
connect(mCurrentAccountCore.get(), &AccountCore::registrationStateChanged, this,
|
||||
[this] { emit lUpdate(); });
|
||||
emit lUpdate(true);
|
||||
emit lUpdate();
|
||||
});
|
||||
});
|
||||
mCoreModelConnection->invokeToModel([this] {
|
||||
|
|
@ -131,7 +128,7 @@ void ConferenceInfoList::setSelf(QSharedPointer<ConferenceInfoList> me) {
|
|||
[this] { emit lUpdate(); });
|
||||
});
|
||||
});
|
||||
emit lUpdate(true);
|
||||
emit lUpdate();
|
||||
}
|
||||
|
||||
void ConferenceInfoList::setAccountConnected(bool connected) {
|
||||
|
|
|
|||
|
|
@ -61,8 +61,7 @@ public:
|
|||
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
signals:
|
||||
void lUpdate(bool isInitialization = false);
|
||||
void initialized();
|
||||
void lUpdate();
|
||||
void addCurrentDateChanged();
|
||||
void haveCurrentDateChanged();
|
||||
void currentDateIndexChanged(int index);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ ConferenceInfoProxy::ConferenceInfoProxy(QObject *parent) : LimitProxy(parent) {
|
|||
if (isSignalConnected(conferenceInfoUpdatedSignal)) emit conferenceInfoUpdated(new ConferenceInfoGui(data));
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
connect(mList.get(), &ConferenceInfoList::initialized, this, &ConferenceInfoProxy::initialized);
|
||||
connect(mList.get(), &ConferenceInfoList::accountConnectedChanged, this,
|
||||
&ConferenceInfoProxy::accountConnectedChanged);
|
||||
}
|
||||
|
|
@ -105,6 +104,14 @@ void ConferenceInfoProxy::clear() {
|
|||
mList->clearData();
|
||||
}
|
||||
|
||||
ConferenceInfoGui *ConferenceInfoProxy::getCurrentDateConfInfo() {
|
||||
if (mList) {
|
||||
auto confInfo = mList->getCurrentDateConfInfo();
|
||||
return confInfo ? new ConferenceInfoGui(confInfo) : nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int ConferenceInfoProxy::loadUntil(ConferenceInfoGui *confInfo) {
|
||||
return loadUntil(confInfo ? confInfo->mCore : nullptr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,10 +47,10 @@ public:
|
|||
bool getAccountConnected() const;
|
||||
|
||||
Q_INVOKABLE void clear();
|
||||
Q_INVOKABLE ConferenceInfoGui *getCurrentDateConfInfo();
|
||||
Q_INVOKABLE int loadUntil(ConferenceInfoGui *confInfo);
|
||||
int loadUntil(QSharedPointer<ConferenceInfoCore> data);
|
||||
signals:
|
||||
void initialized();
|
||||
void haveCurrentDateChanged();
|
||||
void conferenceInfoCreated(ConferenceInfoGui *confInfo);
|
||||
void conferenceInfoUpdated(ConferenceInfoGui *confInfo);
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ ListView {
|
|||
|
||||
//----------------------------------------------------------------
|
||||
function moveToCurrentItem(){
|
||||
if( mainItem.currentIndex >= 0)
|
||||
Utils.updatePosition(mainItem, mainItem)
|
||||
if( mainItem.currentIndex >= 0)
|
||||
mainItem.positionViewAtIndex(mainItem.currentIndex, ListView.Contain)
|
||||
}
|
||||
onCurrentItemChanged: {
|
||||
moveToCurrentItem()
|
||||
|
|
@ -97,13 +97,13 @@ ListView {
|
|||
}
|
||||
onModelReset: {
|
||||
mainItem.loading = !confInfoProxy.accountConnected
|
||||
selectData(getCurrentDateConfInfo())
|
||||
}
|
||||
onAccountConnectedChanged: (connected) => {
|
||||
mainItem.loading = !connected
|
||||
}
|
||||
function selectData(confInfoGui){
|
||||
mainItem.currentIndex = loadUntil(confInfoGui)
|
||||
mainItem.positionViewAtIndex(mainItem.currentIndex, ListView.Contain)
|
||||
}
|
||||
onConferenceInfoCreated: (confInfoGui) => {
|
||||
selectData(confInfoGui)
|
||||
|
|
@ -111,10 +111,6 @@ ListView {
|
|||
onConferenceInfoUpdated: (confInfoGui) => {
|
||||
selectData(confInfoGui)
|
||||
}
|
||||
onInitialized: {
|
||||
// Move to currentDate
|
||||
selectData(null)
|
||||
}
|
||||
}
|
||||
|
||||
BusyIndicator {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue