Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ssu dependency #13

Merged
merged 2 commits into from Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 16 additions & 8 deletions mts/common/mtptypes.h
Expand Up @@ -218,7 +218,7 @@ Q_DECLARE_METATYPE(MTPEventCode);
typedef quint16 MTPContainerType;


#define MTP_HEADER_SIZE (2*sizeof(quint32) + 2*sizeof(quint16) )
#define MTP_HEADER_SIZE (2*sizeof(quint32) + 2*sizeof(quint16))
#define MTP_STORAGE_INFO_SIZE ((2 * sizeof(quint64)) +\
(1 * sizeof(quint32)) +\
(2 * sizeof(quint8)) +\
Expand Down Expand Up @@ -709,7 +709,7 @@ struct MtpInt128 {
}

// Constructor taking upper and lower 8 bytes.
MtpInt128( quint64 lower, quint64 upper = 0 )
MtpInt128(quint64 lower, quint64 upper = 0)
{
for (qint32 i = 0; i < 8; i++) {
val[i] = lower & 0xFF;
Expand All @@ -721,6 +721,14 @@ struct MtpInt128 {
}
}

// copy constructor
MtpInt128(const MtpInt128 &other)
{
for (qint32 i = 0; i < 16; i++) {
val[i] = other.val[i];
}
}

// Increment operator
MtpInt128 &operator++()
{
Expand All @@ -731,15 +739,15 @@ struct MtpInt128 {

// If the lower 8 bytes overflowed
// due to this increment, increment the upper 8 bytes.
if ( !*lower ) {
if (!*lower) {
++*upper;
}

return *this;
}

// Compares two MtpInt128's
int compare( const MtpInt128 &rhs ) const
int compare(const MtpInt128 &rhs) const
{
int diff = 0;
for (qint32 i = 15; ((i >= 0) && (0 == diff)) ; i--) {
Expand All @@ -748,9 +756,9 @@ struct MtpInt128 {
return diff;
}

bool operator==( const MtpInt128 &rhs ) const
bool operator==(const MtpInt128 &rhs) const
{
return (0 == compare(rhs)) ? true : false;
return 0 == compare(rhs);
}

bool operator<(const MtpInt128 &rhs) const
Expand All @@ -764,7 +772,7 @@ struct MtpInt128 {
}

// Assignment operator
MtpInt128 &operator=( const MtpInt128 &rhs )
MtpInt128 &operator=(const MtpInt128 &rhs)
{
for (qint32 i = 0; i < 16; i++) {
val[i] = rhs.val[i];
Expand Down Expand Up @@ -874,7 +882,7 @@ struct MTPObjectInfo {
{
bool differs = false;
#define CMP(memb) do {\
if( this->memb != that->memb ) { \
if (this->memb != that->memb) { \
MTP_LOG_TRACE(#memb":" << this->memb << "->" << that->memb);\
differs = true;\
}\
Expand Down
15 changes: 4 additions & 11 deletions mts/platform/deviceinfo/deviceinfoprovider.cpp
Expand Up @@ -30,25 +30,21 @@
*
*/

#include "deviceinfoprovider.h"
#include <QTimer>
#include <ssudeviceinfo.h>
#include <batterystatus.h>
#include <deviceinfo.h>

#include "trace.h"
#include "deviceinfoprovider.h"

using namespace meegomtp1dot0;

/**********************************************
* DeviceInfoProvider::DeviceInfoProvider
*********************************************/
DeviceInfoProvider::DeviceInfoProvider()
: m_batteryStatus(new BatteryStatus(this))
{
DeviceInfo deviceInfo;
SsuDeviceInfo ssuDeviceInfo;
DeviceInfo deviceInfo(true);

m_serialNo = ssuDeviceInfo.deviceUid();
m_serialNo = deviceInfo.deviceUid();
m_deviceVersion = deviceInfo.osVersion();
m_manufacturer = deviceInfo.manufacturer();
m_model = deviceInfo.prettyName();
Expand All @@ -63,9 +59,6 @@ DeviceInfoProvider::DeviceInfoProvider()
}
}

/**********************************************
* DeviceInfoProvider::~DeviceInfoProvider
*********************************************/
DeviceInfoProvider::~DeviceInfoProvider()
{
}
Expand Down
3 changes: 0 additions & 3 deletions mts/platform/deviceinfo/deviceinfoprovider.h
Expand Up @@ -52,10 +52,7 @@ class DeviceInfoProvider : public MtpDeviceInfo
friend class DeviceInfoProvider_Test;
#endif
public:
/// Constructor.
DeviceInfoProvider();

/// Destructor.
~DeviceInfoProvider();

private:
Expand Down
1 change: 0 additions & 1 deletion rpm/buteo-mtp-qt5.spec
Expand Up @@ -16,7 +16,6 @@ BuildRequires: pkgconfig(mount)
BuildRequires: pkgconfig(mlite5)
# for the thumbnailer unit test
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: ssu-devel >= 0.37.9
BuildRequires: pkgconfig(systemsettings) >= 0.6.0
BuildRequires: pkgconfig(nemodbus) >= 2.1.16
Requires: mtp-vendor-configuration
Expand Down