MCPcopy Create free account
hub / github.com/Zalafina/QKeyMapper / syncDisabledMouseList

Method syncDisabledMouseList

QKeyMapper/interception_worker.cpp:954–989  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

952}
953
954void Interception_Worker::syncDisabledMouseList()
955{
956 for (int i = 0; i < MouseDeviceList.size(); ++i) {
957 InputDevice& inputDevice = MouseDeviceList[i];
958 QString hardwareid = inputDevice.deviceinfo.hardwareid;
959
960 // Check if hardwareid is empty
961 if (!hardwareid.isEmpty()) {
962 QString disabledDevice = inputDevice.deviceinfo.devicedesc + JOIN_DEVICE + hardwareid;
963
964 // Check if disabledMouseList contains disabledDevice
965 if (disabledMouseList.contains(disabledDevice)) {
966 if (inputDevice.disabled != true) {
967 inputDevice.disabled = true;
968#ifdef DEBUG_LOGOUT_ON
969 qDebug().nospace() << "[syncDisabledMouseList][Changed]" << " MouseDeviceList[" << i << "] disabled set TRUE";
970#endif
971 }
972 } else {
973 if (inputDevice.disabled != false) {
974 inputDevice.disabled = false;
975#ifdef DEBUG_LOGOUT_ON
976 qDebug().nospace() << "[syncDisabledMouseList][Changed]" << " MouseDeviceList[" << i << "] disabled set FALSE";
977#endif
978 }
979 }
980 }
981 }
982
983#ifdef DEBUG_LOGOUT_ON
984 /* Output All MouseDeviceList disabled status */
985 for (int i = 0; i < MouseDeviceList.size(); ++i) {
986 qDebug().nospace() << "[syncDisabledMouseList] MouseDeviceList[" << i << "] disabled: " << MouseDeviceList.at(i).disabled;
987 }
988#endif
989}
990
991void Interception_Worker::saveDisabledKeyboardList()
992{

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.80
isEmptyMethod · 0.80
containsMethod · 0.80

Tested by

no test coverage detected