mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-21 18:22:29 +01:00
Change to use qt based integers
This commit is contained in:
parent
7bcbcb60e2
commit
aaa7159b29
@ -11,18 +11,18 @@
|
||||
#include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
#define DWORDLONG unsigned long long
|
||||
#define DWORDLONG quint64
|
||||
|
||||
class RAM : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(float usage READ usage NOTIFY usageChanged)
|
||||
Q_PROPERTY(unsigned long long usedPhysicalMemory READ usedPhysicalMemory NOTIFY usedPhysicalMemoryChanged)
|
||||
Q_PROPERTY(unsigned long long totalPhysicalMemory READ totalPhysicalMemory NOTIFY totalPhysicalMemoryChanged)
|
||||
Q_PROPERTY(unsigned long long usedVirtualMemory READ usedVirtualMemory NOTIFY usedVirtualMemoryChanged)
|
||||
Q_PROPERTY(unsigned long long totalVirtualMemory READ totalVirtualMemory NOTIFY totalVirtualMemoryChanged)
|
||||
Q_PROPERTY(unsigned long long usedPagingMemory READ usedPagingMemory NOTIFY usedPagingMemoryChanged)
|
||||
Q_PROPERTY(unsigned long long totalPagingMemory READ totalPagingMemory NOTIFY totalPagingMemoryChanged)
|
||||
Q_PROPERTY(quint64 usedPhysicalMemory READ usedPhysicalMemory NOTIFY usedPhysicalMemoryChanged)
|
||||
Q_PROPERTY(quint64 totalPhysicalMemory READ totalPhysicalMemory NOTIFY totalPhysicalMemoryChanged)
|
||||
Q_PROPERTY(quint64 usedVirtualMemory READ usedVirtualMemory NOTIFY usedVirtualMemoryChanged)
|
||||
Q_PROPERTY(quint64 totalVirtualMemory READ totalVirtualMemory NOTIFY totalVirtualMemoryChanged)
|
||||
Q_PROPERTY(quint64 usedPagingMemory READ usedPagingMemory NOTIFY usedPagingMemoryChanged)
|
||||
Q_PROPERTY(quint64 totalPagingMemory READ totalPagingMemory NOTIFY totalPagingMemoryChanged)
|
||||
QML_ELEMENT
|
||||
|
||||
public:
|
||||
|
@ -148,7 +148,7 @@ void WidgetWindow::setWidgetSize(const int with, const int height)
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
void WidgetWindow::setWindowBlur(unsigned int style)
|
||||
void WidgetWindow::setWindowBlur(quint64 style)
|
||||
{
|
||||
|
||||
const HINSTANCE hModule = LoadLibrary(TEXT("user32.dll"));
|
||||
|
@ -91,7 +91,7 @@ public slots:
|
||||
QPointF cursorPos() { return QCursor::pos(); }
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
void setWindowBlur(unsigned int style = 3);
|
||||
void setWindowBlur(quint64 style = 3);
|
||||
#endif
|
||||
|
||||
void setPosition(QPoint position)
|
||||
|
@ -141,11 +141,6 @@ QVariantMap InstalledListModel::get(QString folderName)
|
||||
return map;
|
||||
}
|
||||
|
||||
int InstalledListModel::getAmountItemLoaded()
|
||||
{
|
||||
return m_screenPlayFiles.count();
|
||||
}
|
||||
|
||||
void InstalledListModel::reset()
|
||||
{
|
||||
beginResetModel();
|
||||
|
@ -77,7 +77,6 @@ public slots:
|
||||
m_absoluteStoragePath = absoluteStoragePath;
|
||||
emit absoluteStoragePathChanged(m_absoluteStoragePath);
|
||||
}
|
||||
int getAmountItemLoaded();
|
||||
void reset();
|
||||
|
||||
signals:
|
||||
|
@ -33,8 +33,8 @@ struct SteamItemUpdate {
|
||||
}
|
||||
QString absoluteStoragePath;
|
||||
UGCUpdateHandle_t steamUGCUpdateHandle = 0;
|
||||
unsigned long long itemProcessed = 0;
|
||||
unsigned long long bytesTotal = 0;
|
||||
quint64 itemProcessed = 0;
|
||||
quint64 bytesTotal = 0;
|
||||
};
|
||||
|
||||
class SteamWorkshop : public QObject {
|
||||
@ -43,9 +43,9 @@ class SteamWorkshop : public QObject {
|
||||
|
||||
Q_PROPERTY(bool online READ online WRITE setOnline NOTIFY onlineChanged)
|
||||
Q_PROPERTY(bool queryActive READ queryActive WRITE setQueryActive NOTIFY queryActiveChanged)
|
||||
Q_PROPERTY(unsigned long long itemProcessed READ itemProcessed WRITE setItemProcessed NOTIFY itemProcessedChanged)
|
||||
Q_PROPERTY(unsigned long long bytesTotal READ bytesTotal WRITE setBytesTotal NOTIFY bytesTotalChanged)
|
||||
Q_PROPERTY(unsigned int appID READ appID)
|
||||
Q_PROPERTY(quint64 itemProcessed READ itemProcessed WRITE setItemProcessed NOTIFY itemProcessedChanged)
|
||||
Q_PROPERTY(quint64 bytesTotal READ bytesTotal WRITE setBytesTotal NOTIFY bytesTotalChanged)
|
||||
Q_PROPERTY(quint64 appID READ appID)
|
||||
Q_PROPERTY(SteamWorkshopListModel* workshopListModel READ workshopListModel WRITE setWorkshopListModel NOTIFY workshopListModelChanged)
|
||||
Q_PROPERTY(SteamWorkshopListModel* workshopProfileListModel READ workshopProfileListModel WRITE setWorkshopProfileListModel NOTIFY workshopProfileListModelChanged)
|
||||
Q_PROPERTY(UploadListModel* uploadListModel READ uploadListModel NOTIFY uploadListModelChanged)
|
||||
@ -64,9 +64,9 @@ public:
|
||||
|
||||
bool online() const { return m_online; }
|
||||
bool queryActive() const { return m_queryActive; }
|
||||
unsigned long long itemProcessed() const { return m_itemProcessed; }
|
||||
unsigned int appID() const { return m_appID; }
|
||||
unsigned long long bytesTotal() const { return m_bytesTotal; }
|
||||
quint64 itemProcessed() const { return m_itemProcessed; }
|
||||
quint64 appID() const { return m_appID; }
|
||||
quint64 bytesTotal() const { return m_bytesTotal; }
|
||||
UploadListModel* uploadListModel() const { return m_uploadListModel.get(); }
|
||||
SteamAccount* steamAccount() const { return m_steamAccount.get(); }
|
||||
SteamWorkshopListModel* workshopListModel() const { return m_workshopListModel.get(); }
|
||||
@ -103,7 +103,7 @@ public slots:
|
||||
return m_queryActive;
|
||||
}
|
||||
|
||||
void setItemProcessed(unsigned long long itemProcessed)
|
||||
void setItemProcessed(quint64 itemProcessed)
|
||||
{
|
||||
if (m_itemProcessed == itemProcessed)
|
||||
return;
|
||||
@ -112,7 +112,7 @@ public slots:
|
||||
emit itemProcessedChanged(m_itemProcessed);
|
||||
}
|
||||
|
||||
void setBytesTotal(unsigned long long bytesTotal)
|
||||
void setBytesTotal(quint64 bytesTotal)
|
||||
{
|
||||
if (m_bytesTotal == bytesTotal)
|
||||
return;
|
||||
@ -237,9 +237,9 @@ private:
|
||||
|
||||
bool m_steamErrorRestart = false;
|
||||
bool m_steamErrorAPIInit = false;
|
||||
unsigned long long m_itemProcessed = 0;
|
||||
unsigned long long m_bytesTotal = 0;
|
||||
const unsigned int m_appID = 672870;
|
||||
quint64 m_itemProcessed = 0;
|
||||
quint64 m_bytesTotal = 0;
|
||||
const quint64 m_appID = 672870;
|
||||
bool m_online = false;
|
||||
bool m_queryActive = false;
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <QStringList>
|
||||
namespace ScreenPlayWorkshop {
|
||||
|
||||
SteamWorkshopItem::SteamWorkshopItem(const QString& name, const QUrl& absolutePath, const unsigned int appID)
|
||||
SteamWorkshopItem::SteamWorkshopItem(const QString& name, const QUrl& absolutePath, const quint64 appID)
|
||||
: QObject()
|
||||
, m_name { name }
|
||||
, m_absolutePath { absolutePath }
|
||||
@ -22,8 +22,8 @@ void SteamWorkshopItem::createWorkshopItem()
|
||||
|
||||
void SteamWorkshopItem::checkUploadProgress()
|
||||
{
|
||||
unsigned long long _itemProcessed = 0;
|
||||
unsigned long long _bytesTotoal = 0;
|
||||
quint64 _itemProcessed = 0;
|
||||
quint64 _bytesTotoal = 0;
|
||||
EItemUpdateStatus status = SteamUGC()->GetItemUpdateProgress(m_UGCUpdateHandle, &_itemProcessed, &_bytesTotoal);
|
||||
|
||||
qInfo() << absolutePath() << absolutePreviewImagePath() << name() << uploadProgress() << "% - " << _itemProcessed << _bytesTotoal << status;
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
SteamWorkshopItem(
|
||||
const QString& name,
|
||||
const QUrl& absolutePath,
|
||||
const unsigned int appID);
|
||||
const quint64 appID);
|
||||
|
||||
QString name() const { return m_name; }
|
||||
QUrl absolutePath() const { return m_absolutePath; }
|
||||
@ -133,7 +133,7 @@ private:
|
||||
QString m_name;
|
||||
QUrl m_absolutePath;
|
||||
QUrl m_absolutePreviewImagePath;
|
||||
unsigned int m_appID { 0 };
|
||||
quint64 m_appID { 0 };
|
||||
const int m_updateTimerInterval { 500 };
|
||||
int m_uploadProgress { 0 }; // 0 - 100
|
||||
ScreenPlayWorkshopSteamEnums::EResult m_status { ScreenPlayWorkshopSteamEnums::EResult::K_EResultNone };
|
||||
|
@ -66,7 +66,7 @@ public slots:
|
||||
{
|
||||
return m_workshopItemList.empty() ? QVariant {} : m_workshopItemList.at(0).m_publishedFileID;
|
||||
}
|
||||
unsigned int getBannerAmountSubscriber()
|
||||
quint64 getBannerAmountSubscriber()
|
||||
{
|
||||
return m_workshopItemList.empty() ? int {} : m_workshopItemList.at(0).m_subscriptionCount;
|
||||
}
|
||||
@ -95,7 +95,7 @@ private:
|
||||
UGCQueryHandle_t m_UGCSearchHandle = 0;
|
||||
QVector<WorkshopItem> m_workshopItemList;
|
||||
|
||||
const unsigned int m_appID = 0;
|
||||
const quint64 m_appID = 0;
|
||||
int m_pages = 1;
|
||||
int m_currentPage = 1;
|
||||
};
|
||||
|
@ -95,7 +95,7 @@ public slots:
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void append(const QString& name, const QString& path, const unsigned int appID)
|
||||
void append(const QString& name, const QString& path, const quint64 appID)
|
||||
{
|
||||
auto item = std::make_unique<SteamWorkshopItem>(name, path, appID);
|
||||
QObject::connect(item.get(), &SteamWorkshopItem::userNeedsToAcceptWorkshopLegalAgreement, this, &UploadListModel::userNeedsToAcceptWorkshopLegalAgreement);
|
||||
|
Loading…
Reference in New Issue
Block a user