#ifndef PLASMA_LLIUREX_ONEDRIVE_WIDGET_UTILS_H #define PLASMA_LLIUREX_ONEDRIVE_WIDGET_UTILS_H #include #include #include #include class QTimer; class LliurexOneDriveWidgetUtils : public QObject { Q_OBJECT public: LliurexOneDriveWidgetUtils(QObject *parent = nullptr); QString getUserHome(); QVariantList getSpacesInfo(QString onedriveConfig); QList checkLocalFolder(QString spaceFolderPath); QStringList readStatusToken(QString spaceConfigPath); bool checkIfSpaceSyncIsRunning(QString spaceConfigPath); QString getGlobalStatus(); QString checkLocalFreeSpace(); QList getFiles(QStringList info,QString spaceLocalFolder); void restoreSyncListFile(QString spaceConfigPath); QString getLogFileSize(QString logFilePath); QJsonArray onedriveConfig; QFile localFolderEmptyToken; QFile localFolderRemovedToken; QFile spaceStatusToken; QFile spaceRunToken; QFile freeSpaceWarningToken; QFile freeSpaceErrorToken; int totalSpaces; QList spacesStatusCode; QList spacesStatusErrorCode; bool isLocalFolderWarning=false; bool areSpacesSyncRunning=false; int MICROSOFT_API_ERROR=-1; int UNABLE_CONNECT_MICROSOFT_ERROR=-2; int ZERO_SPACE_AVAILABLE_ERROR=-4; int UNAUTHORIZED_ERROR=-7; int SERVICE_UNAVAILABLE=-9; int FORBIDDEN_USER=-14; int ALL_SYNCHRONIZE_MSG=0; int OUT_OF_SYNC_MSG=2; int WITH_OUT_CONFIG=1; int INFORMATION_NOT_AVAILABLE=3; int UPLOADING_PENDING_CHANGES=4; QList warningCode={UPLOADING_PENDING_CHANGES,OUT_OF_SYNC_MSG}; QList errorCode={MICROSOFT_API_ERROR,UNABLE_CONNECT_MICROSOFT_ERROR,ZERO_SPACE_AVAILABLE_ERROR,UNAUTHORIZED_ERROR,SERVICE_UNAVAILABLE,FORBIDDEN_USER}; QFile logFile; private: QString formatFreeSpace(QString freeSpace); QString formatFileDate(QString fileDate); QFile syncList; QFile syncListHash; }; #endif // PLASMA_LLIUREX_UP_INDICATOR_UTILS_H