mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-17 03:45:56 +01:00
Build fixes for mingw-w64
This commit is contained in:
parent
7d65d425e0
commit
79318cc4e1
@ -16,13 +16,15 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "analyzerbase.h"
|
||||
#include "engines/enginebase.h"
|
||||
|
||||
#include <cmath> //interpolate()
|
||||
|
||||
#include <QEvent> //event()
|
||||
#include <QPainter>
|
||||
#include <QPaintEvent>
|
||||
#include <QtDebug>
|
||||
|
||||
#include "engines/enginebase.h"
|
||||
|
||||
// INSTRUCTIONS Base2D
|
||||
// 1. do anything that depends on height() in init(), Base2D will call it before you are shown
|
||||
|
@ -143,14 +143,6 @@ void WmdmLister::ShutDown() {
|
||||
metaObject()->invokeMethod(this, "ReallyShutdown", Qt::BlockingQueuedConnection);
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
qint64 GetSpaceValue(F f) {
|
||||
DWORD low, high;
|
||||
f(&low, &high);
|
||||
|
||||
return (qint64)high << 32 | (qint64)low;
|
||||
}
|
||||
|
||||
WmdmLister::DeviceInfo WmdmLister::ReadDeviceInfo(IWMDMDevice2* device) {
|
||||
qLog(Debug) << "Reading device info";
|
||||
|
||||
@ -424,13 +416,28 @@ void WmdmLister::DoUpdateDriveFreeSpace(const QString& id) {
|
||||
emit DeviceChanged(id);
|
||||
}
|
||||
|
||||
namespace {
|
||||
qint64 GetSpaceValue(
|
||||
IWMDMStorageGlobals* globals,
|
||||
LONG (IWMDMStorageGlobals::*f)(DWORD*,DWORD*)) {
|
||||
DWORD low, high;
|
||||
((globals)->*(f))(&low, &high);
|
||||
|
||||
return (qint64)high << 32 | (qint64)low;
|
||||
}
|
||||
}
|
||||
|
||||
void WmdmLister::UpdateFreeSpace(DeviceInfo* info) {
|
||||
IWMDMStorageGlobals* globals;
|
||||
info->storage_->GetStorageGlobals(&globals);
|
||||
|
||||
info->total_bytes_ = GetSpaceValue(boost::bind(&IWMDMStorageGlobals::GetTotalSize, globals, _1, _2));
|
||||
info->free_bytes_ = GetSpaceValue(boost::bind(&IWMDMStorageGlobals::GetTotalFree, globals, _1, _2));
|
||||
info->free_bytes_ -= GetSpaceValue(boost::bind(&IWMDMStorageGlobals::GetTotalBad, globals, _1, _2));
|
||||
DWORD low, high;
|
||||
|
||||
globals->GetTotalSize(&low, &high);
|
||||
info->total_bytes_ = (qint64)high << 32 | (qint64)low;
|
||||
|
||||
globals->GetTotalFree(&low, &high);
|
||||
info->free_bytes_ = (qint64)high << 32 | (qint64)low;
|
||||
|
||||
globals->Release();
|
||||
}
|
||||
|
@ -22,14 +22,17 @@
|
||||
#ifndef AMAROK_ENGINEBASE_H
|
||||
#define AMAROK_ENGINEBASE_H
|
||||
|
||||
#include <QUrl>
|
||||
#include <QObject>
|
||||
#include <QList>
|
||||
|
||||
#include <cstdint>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
|
||||
#include "engine_fwd.h"
|
||||
|
||||
namespace Engine {
|
||||
|
Loading…
Reference in New Issue
Block a user