fixed new endpoints not appering if UI open + no roles / deque
This commit is contained in:
parent
a3d00be3fe
commit
0a301fb9bf
4 changed files with 19 additions and 7 deletions
|
|
@ -204,9 +204,16 @@ HRESULT EndpointSituationCallback::OnDefaultDeviceChanged(EDataFlow flow, ERole
|
|||
}
|
||||
std::wstring wstringEndpointId = pwstrDeviceId;
|
||||
log_wdebugcpp(L"we got za defol 4 " + wstringEndpointId);
|
||||
//APTTYPE aptType;
|
||||
//APTTYPEQUALIFIER aptQualifier;
|
||||
//CoGetApartmentType(
|
||||
// &aptType,
|
||||
// &aptQualifier
|
||||
// );
|
||||
//std::thread roleChangeThread(&OverseerHandler::roleBucketEntryCallback, this,
|
||||
// nRole, wstringEndpointId);
|
||||
//roleChangeThread.detach();
|
||||
osh->roleBucketEntryCallback(nRole, wstringEndpointId);
|
||||
//osh->changeFrontDefaultsCallback(nRole, wstringEndpointId);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <locale>
|
||||
#include <map>
|
||||
#include <thread>
|
||||
#include <deque>
|
||||
|
||||
#include "debug.h"
|
||||
//#include "settings.h"
|
||||
|
|
|
|||
|
|
@ -792,7 +792,9 @@ void MainWindow::removeEndpointWidget(CustomWidgetEvent<uint64_t>* ev){
|
|||
void MainWindow::addEndpointWidget(CustomWidgetEvent<EndpointHandler*>* ev){
|
||||
EndpointWidget* epw = new EndpointWidget(ev->payload, containerWidget, this->ews.size());
|
||||
//epw->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
//this->widgetLayout->addWidget(epw);
|
||||
epw->setParent(this);
|
||||
if(this->widgetLayout)
|
||||
this->widgetLayout->addWidget(epw);
|
||||
ews.push_back(epw);
|
||||
return;
|
||||
}
|
||||
|
|
@ -984,7 +986,9 @@ HeaderWidget::HeaderWidget(QWidget *parent) : QWidget(parent) {
|
|||
void MainWindow::createLayout(QGridLayout *newLayout) {
|
||||
log_debugcpp("createLayout");
|
||||
widgetLayout->removeItem(lastRowSpacer);
|
||||
delete this->widgetLayout;
|
||||
QGridLayout *tempStore = this->widgetLayout;
|
||||
this->widgetLayout = 0;
|
||||
delete tempStore;
|
||||
containerWidget->setLayout(newLayout);
|
||||
this->widgetLayout = newLayout;
|
||||
|
||||
|
|
@ -1191,9 +1195,8 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event) {
|
|||
}
|
||||
|
||||
void MainWindow::flushRoleChanges() {
|
||||
//TODO: bucket list deque
|
||||
std::pair<Roles, std::wstring> change = roleBucketList.front();
|
||||
roleBucketList.erase(roleBucketList.begin());
|
||||
roleBucketList.pop_front();
|
||||
|
||||
EndpointWidget *newDef = nullptr, *oldDef = nullptr;
|
||||
for (uint64_t i = 0; i < ews.size(); i++) {
|
||||
|
|
|
|||
|
|
@ -208,7 +208,8 @@ private:
|
|||
void changeFrontDefaults(Roles role, EndpointWidget* newDef, EndpointWidget* oldDef);
|
||||
|
||||
std::vector<EndpointWidget*> ews;
|
||||
std::vector<std::pair<Roles, std::wstring>> roleBucketList;
|
||||
std::deque<std::pair<Roles, std::wstring>> roleBucketList;
|
||||
std::mutex roleBucketMutex;
|
||||
QWidget *containerWidget;
|
||||
QGridLayout *widgetLayout;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue