log values while configuring mouse, checking mouse presence or reading mouse name v_0 v0.5
authorFrantišek Kučera <franta-hg@frantovo.cz>
Tue, 09 Jun 2020 16:47:11 +0200
branchv_0
changeset 31 3cbac1956f05
parent 30 148bda718c93
child 32 09d20a946a01
log values while configuring mouse, checking mouse presence or reading mouse name
cadMousePro-daemon/src/Daemon.h
--- a/cadMousePro-daemon/src/Daemon.h	Tue Jun 09 16:29:12 2020 +0200
+++ b/cadMousePro-daemon/src/Daemon.h	Tue Jun 09 16:47:11 2020 +0200
@@ -47,11 +47,13 @@
 
 	Q_PROPERTY(bool devicePresent READ devicePresent)
 	bool devicePresent() {
-		std::wcout << L"checking mouse presence" << std::endl;
+		std::wcout << L"checking mouse presence: ";
 		try {
 			getMouse();
+			std::wcout << L"present" << std::endl;
 			return true;
 		} catch (const HIDException& e) {
+			std::wcout << std::endl;
 			logException(e);
 			return false;
 		}
@@ -59,17 +61,26 @@
 
 	Q_PROPERTY(QString deviceName READ deviceName)
 	QString deviceName() {
-		std::wcout << L"reading mouse name" << std::endl;
+		std::wcout << L"reading mouse name: ";
 		try {
-			return QString::fromStdWString(getMouse().getProductName());
+			auto productName = getMouse().getProductName();
+			std::wcout << productName << std::endl;
+			return QString::fromStdWString(productName);
 		} catch (HIDException& e) {
+			std::wcout << std::endl;
 			logException(e);
 			return QString();
 		}
 	}
 
 	void configure(bool liftOffDetection, bool smartScrolling, bool remapWheelPress, bool remapGestureButton, int frequency) {
-		std::wcout << L"configuring mouse" << std::endl;
+		std::wcout << L"configuring mouse:"
+				<< L" liftOffDetection=" << liftOffDetection
+				<< L" smartScrolling=" << smartScrolling
+				<< L" remapWheelPress=" << remapWheelPress
+				<< L" remapGestureButton=" << remapGestureButton
+				<< L" frequency=" << frequency
+				<< std::endl;
 		try {
 			CadMouseConfig config;
 			config.setLiftOffDetection(liftOffDetection);