Formatting
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace Managers
|
namespace Managers
|
||||||
{
|
{
|
||||||
|
|
||||||
class ActionManager
|
class ActionManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -38,6 +39,7 @@ namespace Managers
|
|||||||
char **params;
|
char **params;
|
||||||
int paramCount;
|
int paramCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
namespace Managers
|
namespace Managers
|
||||||
{
|
{
|
||||||
|
|
||||||
class CommitManager
|
class CommitManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -44,6 +45,7 @@ namespace Managers
|
|||||||
|
|
||||||
Models::IcarusAction icaAction;
|
Models::IcarusAction icaAction;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
namespace Managers
|
namespace Managers
|
||||||
{
|
{
|
||||||
|
|
||||||
class FileManager
|
class FileManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -24,6 +25,7 @@ namespace Managers
|
|||||||
bool fileRead;
|
bool fileRead;
|
||||||
int fileBufferLength;
|
int fileBufferLength;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
namespace Managers
|
namespace Managers
|
||||||
{
|
{
|
||||||
|
|
||||||
class TokenManager
|
class TokenManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -18,6 +19,7 @@ namespace Managers
|
|||||||
Models::API api;
|
Models::API api;
|
||||||
Models::User user;
|
Models::User user;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
namespace Managers
|
namespace Managers
|
||||||
{
|
{
|
||||||
|
|
||||||
class UserManager
|
class UserManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -21,6 +22,7 @@ namespace Managers
|
|||||||
Models::User user;
|
Models::User user;
|
||||||
Models::IcarusAction icaAction;
|
Models::IcarusAction icaAction;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,12 +5,15 @@
|
|||||||
|
|
||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
struct API
|
|
||||||
|
class API
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
std::string url;
|
std::string url;
|
||||||
std::string endpoint;
|
std::string endpoint;
|
||||||
std::string version;
|
std::string version;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,11 +5,13 @@
|
|||||||
|
|
||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
|
|
||||||
struct Flags
|
struct Flags
|
||||||
{
|
{
|
||||||
std::string flag;
|
std::string flag;
|
||||||
std::string value;
|
std::string value;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -8,11 +8,13 @@
|
|||||||
|
|
||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
|
|
||||||
struct IcarusAction
|
struct IcarusAction
|
||||||
{
|
{
|
||||||
std::string action;
|
std::string action;
|
||||||
std::vector<Flags> flags;
|
std::vector<Flags> flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
|
|
||||||
struct Song
|
struct Song
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
@@ -19,6 +20,7 @@ namespace Models
|
|||||||
std::string data;
|
std::string data;
|
||||||
std::string songPath;
|
std::string songPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,12 +5,14 @@
|
|||||||
|
|
||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
|
|
||||||
struct Token
|
struct Token
|
||||||
{
|
{
|
||||||
std::string accessToken;
|
std::string accessToken;
|
||||||
std::string tokenType;
|
std::string tokenType;
|
||||||
int expiration;
|
int expiration;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,11 +6,13 @@
|
|||||||
|
|
||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
|
|
||||||
struct UploadForm
|
struct UploadForm
|
||||||
{
|
{
|
||||||
std::string url;
|
std::string url;
|
||||||
std::string filePath;
|
std::string filePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,11 +5,13 @@
|
|||||||
|
|
||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
|
|
||||||
struct User
|
struct User
|
||||||
{
|
{
|
||||||
std::string username;
|
std::string username;
|
||||||
std::string password;
|
std::string password;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
namespace Parsers
|
namespace Parsers
|
||||||
{
|
{
|
||||||
|
|
||||||
class APIParser
|
class APIParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -18,6 +19,7 @@ namespace Parsers
|
|||||||
Models::API api;
|
Models::API api;
|
||||||
Models::IcarusAction icaAct;
|
Models::IcarusAction icaAct;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
namespace Syncers
|
namespace Syncers
|
||||||
{
|
{
|
||||||
|
|
||||||
class Delete : SyncerBase
|
class Delete : SyncerBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -18,6 +19,7 @@ namespace Syncers
|
|||||||
private:
|
private:
|
||||||
std::string retrieveUrl(Models::Song);
|
std::string retrieveUrl(Models::Song);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
namespace Syncers
|
namespace Syncers
|
||||||
{
|
{
|
||||||
|
|
||||||
class Download : SyncerBase
|
class Download : SyncerBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -26,6 +27,7 @@ namespace Syncers
|
|||||||
std::string downloadFilePath;
|
std::string downloadFilePath;
|
||||||
void saveSong(Models::Song&);
|
void saveSong(Models::Song&);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
namespace Syncers
|
namespace Syncers
|
||||||
{
|
{
|
||||||
|
|
||||||
class RetrieveRecords: public SyncerBase
|
class RetrieveRecords: public SyncerBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -21,6 +22,7 @@ namespace Syncers
|
|||||||
Models::API api;
|
Models::API api;
|
||||||
Models::Token token;
|
Models::Token token;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
namespace Syncers
|
namespace Syncers
|
||||||
{
|
{
|
||||||
|
|
||||||
class SyncerBase
|
class SyncerBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@@ -22,6 +23,7 @@ namespace Syncers
|
|||||||
NOTFOUND = 404
|
NOTFOUND = 404
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace fs = std::filesystem;
|
|||||||
|
|
||||||
namespace Syncers
|
namespace Syncers
|
||||||
{
|
{
|
||||||
|
|
||||||
class Upload
|
class Upload
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -43,6 +44,7 @@ namespace Syncers
|
|||||||
void printSongDetails(std::vector<Models::Song>&);
|
void printSongDetails(std::vector<Models::Song>&);
|
||||||
void printJsonData(const nlohmann::json&);
|
void printJsonData(const nlohmann::json&);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
namespace UI
|
namespace UI
|
||||||
{
|
{
|
||||||
|
|
||||||
class AboutWindow: public QDialog, public CommonWindow
|
class AboutWindow: public QDialog, public CommonWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -29,6 +30,7 @@ namespace UI
|
|||||||
private slots:
|
private slots:
|
||||||
void closeWindow();
|
void closeWindow();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
#include<QPushButton>
|
#include<QPushButton>
|
||||||
|
|
||||||
|
|
||||||
|
namespace UI
|
||||||
|
{
|
||||||
|
|
||||||
class CommonWindow
|
class CommonWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -24,4 +27,7 @@ protected:
|
|||||||
std::unique_ptr<QVBoxLayout> subLayoutTwoQt;
|
std::unique_ptr<QVBoxLayout> subLayoutTwoQt;
|
||||||
int windowHeight, windowWidth;
|
int windowHeight, windowWidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
namespace UI
|
namespace UI
|
||||||
{
|
{
|
||||||
|
|
||||||
class MainWindow: public QMainWindow, public CommonWindow
|
class MainWindow: public QMainWindow, public CommonWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -77,6 +78,7 @@ namespace UI
|
|||||||
void displaySoftwareInformation();
|
void displaySoftwareInformation();
|
||||||
void setCurrentIndex(int);
|
void setCurrentIndex(int);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
namespace Utilities
|
namespace Utilities
|
||||||
{
|
{
|
||||||
|
|
||||||
class Conversions
|
class Conversions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -17,6 +18,7 @@ namespace Utilities
|
|||||||
void printValue(T);
|
void printValue(T);
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -16,16 +16,17 @@ using Models::IcarusAction;
|
|||||||
|
|
||||||
namespace Managers
|
namespace Managers
|
||||||
{
|
{
|
||||||
#pragma
|
|
||||||
|
#pragma region Constructors
|
||||||
ActionManager::ActionManager(char **param, int paramCount) :
|
ActionManager::ActionManager(char **param, int paramCount) :
|
||||||
params(std::move(param)), paramCount(paramCount)
|
params(std::move(param)), paramCount(paramCount)
|
||||||
{
|
{
|
||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
#pragma Constructors
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
#pragma
|
#pragma region Functions
|
||||||
IcarusAction ActionManager::retrieveIcarusAction() const
|
IcarusAction ActionManager::retrieveIcarusAction() const
|
||||||
{
|
{
|
||||||
IcarusAction icarusAction;
|
IcarusAction icarusAction;
|
||||||
@@ -83,7 +84,7 @@ namespace Managers
|
|||||||
if (flag.size() > 3 || isNumber(flag))
|
if (flag.size() > 3 || isNumber(flag))
|
||||||
{
|
{
|
||||||
flg.value = flag;
|
flg.value = flag;
|
||||||
//cout<<"flag value "<<flg.value<<endl;
|
|
||||||
flags.push_back(flg);
|
flags.push_back(flg);
|
||||||
flg = Flags{};
|
flg = Flags{};
|
||||||
continue;
|
continue;
|
||||||
@@ -95,7 +96,6 @@ namespace Managers
|
|||||||
return !flag.compare(val);
|
return !flag.compare(val);
|
||||||
}))
|
}))
|
||||||
{
|
{
|
||||||
//cout<<"flag "<<flag<<endl;
|
|
||||||
flg.flag = flag;
|
flg.flag = flag;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -119,7 +119,7 @@ namespace Managers
|
|||||||
return parsed;
|
return parsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma
|
#pragma region Testing
|
||||||
void ActionManager::printAction() noexcept
|
void ActionManager::printAction() noexcept
|
||||||
{
|
{
|
||||||
if (action.empty())
|
if (action.empty())
|
||||||
@@ -140,6 +140,7 @@ namespace Managers
|
|||||||
cout<<"value "<<flag.value<<endl;
|
cout<<"value "<<flag.value<<endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pragma Testing
|
#pragma endregion
|
||||||
#pragma Functions
|
#pragma endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,13 +33,14 @@ using Syncers::Upload;
|
|||||||
|
|
||||||
namespace Managers
|
namespace Managers
|
||||||
{
|
{
|
||||||
#pragma
|
|
||||||
|
#pragma region Constructors
|
||||||
CommitManager::CommitManager(IcarusAction& icaAct) : icaAction(std::move(icaAct))
|
CommitManager::CommitManager(IcarusAction& icaAct) : icaAction(std::move(icaAct))
|
||||||
{ }
|
{ }
|
||||||
#pragma Constructors
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
#pragma
|
#pragma region Functions
|
||||||
void CommitManager::commitAction()
|
void CommitManager::commitAction()
|
||||||
{
|
{
|
||||||
auto action = icaAction.action;
|
auto action = icaAction.action;
|
||||||
@@ -225,5 +226,6 @@ namespace Managers
|
|||||||
upld.uploadSongsFromDirectory(token, songDirectory, noConfirm, recursiveDirectory);
|
upld.uploadSongsFromDirectory(token, songDirectory, noConfirm, recursiveDirectory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pragma Functions
|
#pragma endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,14 +11,18 @@ using std::string;
|
|||||||
|
|
||||||
namespace Managers
|
namespace Managers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#pragma region Constructors
|
||||||
FileManager::FileManager() {}
|
FileManager::FileManager() {}
|
||||||
FileManager::FileManager(string filePath)
|
FileManager::FileManager(string filePath)
|
||||||
{
|
{
|
||||||
this->filePath = filePath;
|
this->filePath = filePath;
|
||||||
readFile();
|
readFile();
|
||||||
}
|
}
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
|
#pragma region Functions
|
||||||
void FileManager::saveFile(string newFilePath)
|
void FileManager::saveFile(string newFilePath)
|
||||||
{
|
{
|
||||||
if (!fileRead)
|
if (!fileRead)
|
||||||
@@ -63,4 +67,7 @@ namespace Managers
|
|||||||
}
|
}
|
||||||
|
|
||||||
int FileManager::retrieveFileBufferLength() const { return fileBufferLength; }
|
int FileManager::retrieveFileBufferLength() const { return fileBufferLength; }
|
||||||
|
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ using Models::User;
|
|||||||
|
|
||||||
namespace Managers
|
namespace Managers
|
||||||
{
|
{
|
||||||
#pragma
|
|
||||||
|
#pragma region Constructors
|
||||||
TokenManager::TokenManager(const User& user)
|
TokenManager::TokenManager(const User& user)
|
||||||
{
|
{
|
||||||
this->user = user;
|
this->user = user;
|
||||||
@@ -29,10 +30,10 @@ namespace Managers
|
|||||||
this->api.endpoint = "api/" + api.version
|
this->api.endpoint = "api/" + api.version
|
||||||
+ "/login";
|
+ "/login";
|
||||||
}
|
}
|
||||||
#pragma Constructors
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
#pragma
|
#pragma region Functions
|
||||||
Token TokenManager::requestToken()
|
Token TokenManager::requestToken()
|
||||||
{
|
{
|
||||||
Token token{};
|
Token token{};
|
||||||
@@ -56,5 +57,6 @@ namespace Managers
|
|||||||
|
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
#pragma Functions
|
#pragma endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ using Models::User;
|
|||||||
|
|
||||||
namespace Managers
|
namespace Managers
|
||||||
{
|
{
|
||||||
#pragma
|
|
||||||
|
#pragma region Constructors
|
||||||
UserManager::UserManager(User user)
|
UserManager::UserManager(User user)
|
||||||
{
|
{
|
||||||
this->user = user;
|
this->user = user;
|
||||||
@@ -23,10 +24,10 @@ namespace Managers
|
|||||||
this->user = User{};
|
this->user = User{};
|
||||||
parseUserFromActions();
|
parseUserFromActions();
|
||||||
}
|
}
|
||||||
#pragma Constructors
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
#pragma
|
#pragma region Functions
|
||||||
User UserManager::retrieveUser() const
|
User UserManager::retrieveUser() const
|
||||||
{
|
{
|
||||||
return user;
|
return user;
|
||||||
@@ -49,5 +50,6 @@ namespace Managers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pragma Functions
|
#pragma endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ using Models::IcarusAction;
|
|||||||
|
|
||||||
namespace Parsers
|
namespace Parsers
|
||||||
{
|
{
|
||||||
#pragma
|
|
||||||
|
#pragma region Constructors
|
||||||
APIParser::APIParser(IcarusAction icaAct) : icaAct(icaAct)
|
APIParser::APIParser(IcarusAction icaAct) : icaAct(icaAct)
|
||||||
{
|
{
|
||||||
api = API{};
|
api = API{};
|
||||||
@@ -19,7 +20,7 @@ namespace Parsers
|
|||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
#pragma
|
#pragma region Functions
|
||||||
API APIParser::retrieveAPI() const
|
API APIParser::retrieveAPI() const
|
||||||
{
|
{
|
||||||
return api;
|
return api;
|
||||||
@@ -48,5 +49,6 @@ namespace Parsers
|
|||||||
// on version 1
|
// on version 1
|
||||||
api.version = "v1";
|
api.version = "v1";
|
||||||
}
|
}
|
||||||
#pragma functions
|
#pragma endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,16 +16,17 @@ using Models::Token;
|
|||||||
|
|
||||||
namespace Syncers
|
namespace Syncers
|
||||||
{
|
{
|
||||||
#pragma
|
|
||||||
|
#pragma region Constructors
|
||||||
Delete::Delete(API api)
|
Delete::Delete(API api)
|
||||||
{
|
{
|
||||||
this->api = api;
|
this->api = api;
|
||||||
this->api.endpoint = "song/data";
|
this->api.endpoint = "song/data";
|
||||||
}
|
}
|
||||||
#pragma Constructors
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
#pragma
|
#pragma region Functions
|
||||||
void Delete::deleteSong(const Token token, Song song)
|
void Delete::deleteSong(const Token token, Song song)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -58,5 +59,6 @@ namespace Syncers
|
|||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
#pragma Functions
|
#pragma endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ using Models::Token;
|
|||||||
|
|
||||||
namespace Syncers
|
namespace Syncers
|
||||||
{
|
{
|
||||||
#pragma
|
|
||||||
|
#pragma region Constructors
|
||||||
Download::Download() { }
|
Download::Download() { }
|
||||||
Download::Download(API api)
|
Download::Download(API api)
|
||||||
{
|
{
|
||||||
@@ -29,10 +30,10 @@ namespace Syncers
|
|||||||
{
|
{
|
||||||
downloadFilePath = filePath;
|
downloadFilePath = filePath;
|
||||||
}
|
}
|
||||||
#pragma Constructors
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
#pragma
|
#pragma region Functions
|
||||||
void Download::downloadSong(const Token token, Song song)
|
void Download::downloadSong(const Token token, Song song)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -87,5 +88,6 @@ namespace Syncers
|
|||||||
saveSong.write(data, bufferLength);
|
saveSong.write(data, bufferLength);
|
||||||
saveSong.close();
|
saveSong.close();
|
||||||
}
|
}
|
||||||
#pragma Functions
|
#pragma endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,13 @@ using Utilities::Conversions;
|
|||||||
namespace Syncers
|
namespace Syncers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#pragma region Constructors
|
||||||
RetrieveRecords::RetrieveRecords() { }
|
RetrieveRecords::RetrieveRecords() { }
|
||||||
RetrieveRecords::RetrieveRecords(API api, Token token)
|
RetrieveRecords::RetrieveRecords(API api, Token token)
|
||||||
: token(token), api(api) { }
|
: token(token), api(api) { }
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
#pragma region Functions
|
||||||
void RetrieveRecords::retrieve(CommitManager::RetrieveTypes type)
|
void RetrieveRecords::retrieve(CommitManager::RetrieveTypes type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
@@ -59,4 +62,6 @@ namespace Syncers
|
|||||||
writeData<<songData.dump(4);
|
writeData<<songData.dump(4);
|
||||||
writeData.close();
|
writeData.close();
|
||||||
}
|
}
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,13 +24,17 @@ using namespace cpr;
|
|||||||
|
|
||||||
namespace Syncers
|
namespace Syncers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#pragma region Constructors
|
||||||
Upload::Upload() { }
|
Upload::Upload() { }
|
||||||
Upload::Upload(API api) : api(api)
|
Upload::Upload(API api) : api(api)
|
||||||
{
|
{
|
||||||
this->api.endpoint = "song/data";
|
this->api.endpoint = "song/data";
|
||||||
}
|
}
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
|
#pragma region Functions
|
||||||
Song Upload::uploadSong(const Models::Token& token, Song& song)
|
Song Upload::uploadSong(const Models::Token& token, Song& song)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -170,7 +174,7 @@ namespace Syncers
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#pragma
|
#pragma region Testing
|
||||||
void Upload::printSongDetails()
|
void Upload::printSongDetails()
|
||||||
{
|
{
|
||||||
cout<<"Song details: "<<endl;
|
cout<<"Song details: "<<endl;
|
||||||
@@ -211,6 +215,7 @@ namespace Syncers
|
|||||||
|
|
||||||
cout<<endl<<endl;;
|
cout<<endl<<endl;;
|
||||||
}
|
}
|
||||||
#pragma Testing
|
#pragma endregion
|
||||||
#pragma Functions
|
#pragma endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,15 @@ using std::unique_ptr;
|
|||||||
|
|
||||||
namespace UI
|
namespace UI
|
||||||
{
|
{
|
||||||
|
#pragma region Constructors
|
||||||
AboutWindow::AboutWindow(QWidget* parent): QDialog(parent)
|
AboutWindow::AboutWindow(QWidget* parent): QDialog(parent)
|
||||||
{
|
{
|
||||||
setupWindow();
|
setupWindow();
|
||||||
}
|
}
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
|
#pragma region Functions
|
||||||
void AboutWindow::setupWindow()
|
void AboutWindow::setupWindow()
|
||||||
{
|
{
|
||||||
windowWidth = 250;
|
windowWidth = 250;
|
||||||
@@ -44,4 +47,6 @@ namespace UI
|
|||||||
{
|
{
|
||||||
this->hide();
|
this->hide();
|
||||||
}
|
}
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,13 +17,17 @@ using Syncers::Upload;
|
|||||||
|
|
||||||
namespace UI
|
namespace UI
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#pragma region Constructors
|
||||||
MainWindow::MainWindow()
|
MainWindow::MainWindow()
|
||||||
{
|
{
|
||||||
setupMainWindow();
|
setupMainWindow();
|
||||||
aboutWindow = unique_ptr<AboutWindow>{new AboutWindow};
|
aboutWindow = unique_ptr<AboutWindow>{new AboutWindow};
|
||||||
}
|
}
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
|
#pragma region Functions
|
||||||
void MainWindow::configureDownloadSection()
|
void MainWindow::configureDownloadSection()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -171,4 +175,6 @@ namespace UI
|
|||||||
|
|
||||||
uploadSongQt->setEnabled(true);
|
uploadSongQt->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using std::unique_ptr;
|
|||||||
|
|
||||||
namespace Utilities
|
namespace Utilities
|
||||||
{
|
{
|
||||||
|
|
||||||
Conversions::Conversions()
|
Conversions::Conversions()
|
||||||
{
|
{
|
||||||
initializeValues();
|
initializeValues();
|
||||||
@@ -21,4 +22,5 @@ namespace Utilities
|
|||||||
std::cout<<"going to print value"<<std::endl;
|
std::cout<<"going to print value"<<std::endl;
|
||||||
std::cout<<val<<std::endl;
|
std::cout<<val<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user