diff --git a/.vscode/settings.json b/.vscode/settings.json index 29add1d4c..6aa882bff 100755 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,6 +19,12 @@ "editor.formatOnType": true, "editor.formatOnSave": true, }, + "[cpp]": { + "editor.defaultFormatter": "xaver.clang-format", + "editor.formatOnPaste": true, + "editor.formatOnType": true, + "editor.formatOnSave": true, + }, "qttools.injectNatvisFile": false, "cmake.debugConfig": { "visualizerFile": "${workspaceFolder}/.vscode/qt5.natvis.xml", diff --git a/src/gamecontroller/gamecontroller.cpp b/src/gamecontroller/gamecontroller.cpp index 27cebf8de..9106bc6a3 100644 --- a/src/gamecontroller/gamecontroller.cpp +++ b/src/gamecontroller/gamecontroller.cpp @@ -25,7 +25,6 @@ #include "globalvariables.h" #include "joybuttontypes/joycontrolstickbutton.h" #include "joycontrolstick.h" -//#include "logger.h" #include @@ -185,12 +184,7 @@ void GameController::closeSDLDevice() int GameController::getNumberRawButtons() { return SDL_CONTROLLER_BUTTON_MAX; } -int GameController::getNumberRawAxes() -{ - qDebug() << "Controller has " << SDL_CONTROLLER_AXIS_MAX << " raw axes"; - - return SDL_CONTROLLER_AXIS_MAX; -} +int GameController::getNumberRawAxes() { return SDL_CONTROLLER_AXIS_MAX; } /** * @brief Queries the data rate of the given sensor from SDL. diff --git a/src/gui/gamecontrollermappingdialog.cpp b/src/gui/gamecontrollermappingdialog.cpp index 124ac0990..826a6d3a0 100644 --- a/src/gui/gamecontrollermappingdialog.cpp +++ b/src/gui/gamecontrollermappingdialog.cpp @@ -345,7 +345,6 @@ void GameControllerMappingDialog::populateGameControllerBindings(GameController { if (controller != nullptr) { - qDebug() << "Controller has " << controller->getNumberButtons() << " buttons"; for (int i = 0; i < controller->getNumberButtons(); i++) { @@ -365,8 +364,6 @@ void GameControllerMappingDialog::populateGameControllerBindings(GameController } } - qDebug() << "Controller has " << controller->getNumberAxes() << " axes"; - for (int i = 0; i < controller->getNumberAxes(); i++) { int associatedRow = axisPlacement.value(static_cast(i)); diff --git a/src/inputdevice.cpp b/src/inputdevice.cpp index d674ddc84..d01ee2f7a 100644 --- a/src/inputdevice.cpp +++ b/src/inputdevice.cpp @@ -1320,8 +1320,10 @@ QString InputDevice::getDescription() QString gameControllerStatus = isGameController() ? QString("Yes") : QString("No"); full_desc = full_desc + " " + QString("Game Controller: %1").arg(gameControllerStatus) + "\n " + - QString("# of Axes: %1").arg(getNumberRawAxes()) + "\n " + - QString("# of Buttons: %1").arg(getNumberRawButtons()) + "\n " + + QString("# of RawAxes: %1").arg(getNumberRawAxes()) + "\n " + + QString("# of Axes: %1").arg(getNumberAxes()) + "\n " + + QString("# of RawButtons: %1").arg(getNumberRawButtons()) + "\n " + + QString("# of Buttons: %1").arg(getNumberButtons()) + "\n " + QString("# of Hats: %1").arg(getNumberHats()) + "\n " + QString("Accelerometer: %1").arg(hasSensor(ACCELEROMETER)) + "\n " + QString("Gyroscope: %1").arg(hasSensor(GYROSCOPE)) + "\n"; diff --git a/src/main.cpp b/src/main.cpp index e61aff90b..04679b72b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -174,9 +174,13 @@ static void deleteInputDevices(QMap *joysticks) */ void importLegacySettingsIfExist() { - qDebug() << "Importing settings"; const QFileInfo config(PadderCommon::configFilePath()); const bool configExists = config.exists() && config.isFile(); + if (configExists) + { + DEBUG() << "Found settings file: " << PadderCommon::configFilePath(); + return; + } // 'antimicroX' const QFileInfo legacyConfig(PadderCommon::configLegacyFilePath()); const bool legacyConfigExists = legacyConfig.exists() && legacyConfig.isFile(); @@ -195,7 +199,7 @@ void importLegacySettingsIfExist() #endif QDir(PadderCommon::configPath()).mkpath(PadderCommon::configPath()); const bool copySuccess = QFile::copy(fileToCopy.canonicalFilePath(), PadderCommon::configFilePath()); - qDebug() << "Legacy settings found"; + DEBUG() << "Legacy settings found"; const QString successMessage = QObject::tr("Your original settings (previously stored in %1) have been copied to\n%2\n If you want you can " "delete the original directory or leave it as it is.") @@ -209,12 +213,12 @@ void importLegacySettingsIfExist() QMessageBox msgBox; if (copySuccess) { - qDebug() << "Legacy settings copied"; + DEBUG() << "Legacy settings copied"; msgBox.setText(successMessage); } else { - qWarning() << "Problem with importing settings from: " << fileToCopy.canonicalFilePath() - << " to: " << PadderCommon::configFilePath(); + WARN() << "Problem with importing settings from: " << fileToCopy.canonicalFilePath() + << " to: " << PadderCommon::configFilePath(); msgBox.setText(errorMessage); } msgBox.exec(); @@ -230,7 +234,7 @@ int main(int argc, char *argv[]) QCoreApplication::setApplicationVersion(PadderCommon::programVersion); QTextStream outstream(stdout); - Logger *appLogger = Logger::createInstance(&outstream, Logger::LogLevel::LOG_WARNING); + Logger *appLogger = Logger::createInstance(&outstream, Logger::LogLevel::LOG_DEBUG); qRegisterMetaType(); qRegisterMetaType();