Skip to content

Commit a75c88b

Browse files
committed
chore: Remove unused code linked with USE_NEW_REFRESH
1 parent 611832c commit a75c88b

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

src/inputdaemon.cpp

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
#include <QTime>
3636
#include <QTimer>
3737

38-
#define USE_NEW_REFRESH
39-
4038
InputDaemon::InputDaemon(QMap<SDL_JoystickID, InputDevice *> *joysticks, AntiMicroSettings *settings, bool graphical,
4139
QObject *parent)
4240
: QObject(parent)
@@ -180,7 +178,6 @@ void InputDaemon::refreshJoysticks()
180178

181179
for (int i = 0; i < SDL_NumJoysticks(); i++)
182180
{
183-
#ifdef USE_NEW_REFRESH
184181
int index = i;
185182

186183
// Check if device is considered a Game Controller at the start.
@@ -251,38 +248,6 @@ void InputDaemon::refreshJoysticks()
251248
if (joystick != nullptr)
252249
emit deviceAdded(joystick);
253250
}
254-
255-
#else
256-
SDL_Joystick *joystick = SDL_JoystickOpen(i);
257-
if (joystick != nullptr)
258-
{
259-
QString temp = QString();
260-
SDL_JoystickGUID tempGUID = SDL_JoystickGetGUID(joystick);
261-
char guidString[65] = {'0'};
262-
SDL_JoystickGetGUIDString(tempGUID, guidString, sizeof(guidString));
263-
temp = QString(guidString);
264-
265-
bool disableGameController = m_settings->value(QString("%1Disable").arg(temp), false).toBool();
266-
267-
if (SDL_IsGameController(i) && !disableGameController)
268-
{
269-
SDL_GameController *controller = SDL_GameControllerOpen(i);
270-
GameController *damncontroller = new GameController(controller, i, m_settings, this);
271-
connect(damncontroller, &GameController::requestWait, eventWorker, &SDLEventReader::haltServices);
272-
SDL_Joystick *sdlStick = SDL_GameControllerGetJoystick(controller);
273-
SDL_JoystickID joystickID = SDL_JoystickInstanceID(sdlStick);
274-
m_joysticks->insert(joystickID, damncontroller);
275-
trackcontrollers.insert(joystickID, damncontroller);
276-
} else
277-
{
278-
Joystick *curJoystick = new Joystick(joystick, i, m_settings, this);
279-
connect(curJoystick, &Joystick::requestWait, eventWorker, &SDLEventReader::haltServices);
280-
SDL_JoystickID joystickID = SDL_JoystickInstanceID(joystick);
281-
m_joysticks->insert(joystickID, curJoystick);
282-
trackjoysticks.insert(joystickID, curJoystick);
283-
}
284-
}
285-
#endif
286251
}
287252

288253
m_settings->endGroup();

0 commit comments

Comments
 (0)