Skip to content

Commit

Permalink
Revert "Fixing deprecated calls" (incompatible with older libusb)
Browse files Browse the repository at this point in the history
This reverts commit 49757bd.
  • Loading branch information
fpoussin committed Aug 6, 2019
1 parent 49757bd commit a96a698
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/usb/qusbdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ QUsbDevice::IdList QUsbDevice::devices()
libusb_context *ctx;

libusb_init(&ctx);
libusb_set_option(ctx, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_NONE);
libusb_set_debug(ctx, LIBUSB_LOG_LEVEL_NONE);
cnt = libusb_get_device_list(ctx, &devs); // get the list of devices
if (cnt < 0) {
qCritical("libusb_get_device_list Error");
Expand Down Expand Up @@ -365,9 +365,9 @@ void QUsbDevice::setLogLevel(LogLevel level)
Q_D(QUsbDevice);
m_log_level = level;
if (level >= logDebugAll)
libusb_set_option(d->m_ctx, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_DEBUG);
libusb_set_debug(d->m_ctx, LIBUSB_LOG_LEVEL_DEBUG);
else
libusb_set_option(d->m_ctx, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_NONE);
libusb_set_debug(d->m_ctx, LIBUSB_LOG_LEVEL_NONE);
}

/*!
Expand Down
6 changes: 3 additions & 3 deletions src/usb/qusbinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ QUsbInfo::QUsbInfo(QObject *parent)
return;
}

libusb_set_option(d->m_ctx, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_WARNING);
libusb_set_debug(d->m_ctx, LIBUSB_LOG_LEVEL_WARNING);

// Populate list once
m_system_list = QUsbDevice::devices();
Expand Down Expand Up @@ -292,9 +292,9 @@ void QUsbInfo::setLogLevel(QUsbDevice::LogLevel level)
Q_D(QUsbInfo);
m_log_level = level;
if (m_log_level >= QUsbDevice::logDebug)
libusb_set_option(d->m_ctx, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_DEBUG);
libusb_set_debug(d->m_ctx, LIBUSB_LOG_LEVEL_DEBUG);
else
libusb_set_option(d->m_ctx, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_WARNING);
libusb_set_debug(d->m_ctx, LIBUSB_LOG_LEVEL_WARNING);
}

/*!
Expand Down

0 comments on commit a96a698

Please sign in to comment.