From f42e9e1ecbcf8b8f7e82b773943b955402b3322c Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Fri, 25 Jun 2021 18:26:53 +0300 Subject: [PATCH] UI: Services: Fix list loading. --- src/ui/form/opt/pages/servicespage.cpp | 4 +++- src/ui/serviceinfo/serviceinfomanager.cpp | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ui/form/opt/pages/servicespage.cpp b/src/ui/form/opt/pages/servicespage.cpp index 6517323a..8cc2d31b 100644 --- a/src/ui/form/opt/pages/servicespage.cpp +++ b/src/ui/form/opt/pages/servicespage.cpp @@ -20,6 +20,8 @@ ServicesPage::ServicesPage(OptionsController *ctrl, QWidget *parent) : OptBasePage(ctrl, parent), m_serviceListModel(new ServiceListModel(this)) { setupUi(); + + serviceListModel()->initialize(); } ServiceInfoManager *ServicesPage::serviceInfoManager() const @@ -132,7 +134,7 @@ void ServicesPage::setupTableServiceListHeader() header->setSectionResizeMode(1, QHeaderView::Stretch); header->setSectionResizeMode(2, QHeaderView::Interactive); - header->resizeSection(0, 100); + header->resizeSection(0, 250); header->resizeSection(1, 350); header->resizeSection(2, 90); } diff --git a/src/ui/serviceinfo/serviceinfomanager.cpp b/src/ui/serviceinfo/serviceinfomanager.cpp index 8d03c8f1..5129fa71 100644 --- a/src/ui/serviceinfo/serviceinfomanager.cpp +++ b/src/ui/serviceinfo/serviceinfomanager.cpp @@ -16,8 +16,9 @@ QVector getServiceInfoList(SC_HANDLE mngr) DWORD resumePoint = 0; while (EnumServicesStatusExW(mngr, SC_ENUM_PROCESS_INFO, SERVICE_WIN32, SERVICE_STATE_ALL, - (LPBYTE) buffer, sizeof(buffer), &bytesRemaining, &serviceCount, &resumePoint, - nullptr)) { + (LPBYTE) buffer, sizeof(buffer), &bytesRemaining, &serviceCount, &resumePoint, + nullptr) + || GetLastError() == ERROR_MORE_DATA) { int infoIndex = infoList.size(); infoList.resize(infoIndex + serviceCount);