diff --git a/CMakeLists.txt b/CMakeLists.txt index 645636d..4096dd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ project(CLIFp # Get helper scripts include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FetchOBCMake.cmake) -fetch_ob_cmake("19d33b5bb1752b50767f78ca3e17796868354ac3") +fetch_ob_cmake("ed633b61c87f34757c5c26da32563543665940b7") # Initialize project according to standard rules include(OB/Project) @@ -77,7 +77,7 @@ endif() include(OB/FetchQx) ob_fetch_qx( - REF "44a5b020784044d130765cddc0d3514bb01180c1" + REF "62f9e486d8a850123d9a4d834509282ad15e3382" COMPONENTS ${CLIFP_QX_COMPONENTS} ) @@ -111,8 +111,10 @@ string(TOLOWER "${BACKEND_ALIAS_NAME}" BACKEND_ALIAS_NAME_LC) set(FRONTEND_FRAMEWORK_TARGET_NAME ${PROJECT_NAMESPACE_LC}_frontend_framework) set(FRONTEND_FRAMEWORK_ALIAS_NAME FrontendFramework) add_subdirectory(lib) -set(APP_GUI_TARGET_NAME ${PROJECT_NAMESPACE_LC}_${PROJECT_NAMESPACE_LC}) -set(APP_GUI_ALIAS_NAME ${PROJECT_NAMESPACE}) +set(APP_GUI_TARGET_NAME ${PROJECT_NAMESPACE_LC}_frontend_gui) +set(APP_GUI_ALIAS_NAME FrontendGui) +set(APP_CONSOLE_TARGET_NAME ${PROJECT_NAMESPACE_LC}_frontend_console) +set(APP_CONSOLE_ALIAS_NAME FrontendConsole) add_subdirectory(app) #--------------------Package Config----------------------- @@ -122,6 +124,7 @@ ob_standard_project_package_config( CONFIG STANDARD TARGET_CONFIGS TARGET "${PROJECT_NAMESPACE}::${APP_GUI_ALIAS_NAME}" COMPONENT "${APP_GUI_ALIAS_NAME}" DEFAULT + TARGET "${PROJECT_NAMESPACE}::${APP_CONSOLE_ALIAS_NAME}" COMPONENT "${APP_CONSOLE_ALIAS_NAME}" ) #================= Install ========================== diff --git a/app/console/CMakeLists.txt b/app/console/CMakeLists.txt index e69de29..41d99f7 100644 --- a/app/console/CMakeLists.txt +++ b/app/console/CMakeLists.txt @@ -0,0 +1,29 @@ +#================= Common Build ========================= + +set(PRETTY_NAME "${PROJECT_NAME}-C") + +# Add via ob standard executable +include(OB/Executable) +ob_add_standard_executable(${APP_CONSOLE_TARGET_NAME} + ALIAS "${APP_CONSOLE_ALIAS_NAME}" + OUTPUT_NAME "${PRETTY_NAME}" + SOURCE + frontend/console.h + frontend/console.cpp + frontend/input.h + frontend/input.cpp + frontend/progressprinter.h + frontend/progressprinter.cpp + main.cpp + LINKS + PRIVATE + CLIFp::FrontendFramework + magic_enum::magic_enum + CONFIG STANDARD +) + +# Add exe details on Windows +if(CMAKE_SYSTEM_NAME STREQUAL Windows) + include(FrontendFramework) + set_clip_exe_details(${APP_CONSOLE_TARGET_NAME} ${PRETTY_NAME}) +endif() diff --git a/app/console/res/app/CLIFp.ico b/app/console/res/app/CLIFp.ico deleted file mode 100644 index 0e3d89e..0000000 Binary files a/app/console/res/app/CLIFp.ico and /dev/null differ diff --git a/app/console/src/frontend/console.cpp b/app/console/src/frontend/console.cpp new file mode 100644 index 0000000..8a44e1d --- /dev/null +++ b/app/console/src/frontend/console.cpp @@ -0,0 +1,224 @@ +// Unit Include +#include "console.h" + +// Qt Includes +#include +#include +#include + +// Qx Includes +#include +#include + +// Magic enum +#include "magic_enum.hpp" + +#define ENUM_NAME(eenum) QString(magic_enum::enum_name(eenum).data()) + +/* NOTE: Unlike the GUI frontend, this one blocks fully when the user is prompted for input because + * the standard cin read methods block and of course don't spin the event loop internally like + * QMessageBox, QFileDialog, etc. do. Technically, this isn't a problem because whenever the driver + * thread prompts for input it also blocks, but if that ever changes then console input will have + * to be handled asynchronously using a technique like this: https://github.com/juangburgos/QConsoleListener + */ + +//=============================================================================================================== +// FrontendConsole +//=============================================================================================================== + +//-Constructor------------------------------------------------------------------------------------------------------- +//Public: +FrontendConsole::FrontendConsole(QGuiApplication* app) : + FrontendFramework(app) +{ + // We don't make windows in this frontend, but just to be safe + app->setQuitOnLastWindowClosed(false); +} + +//-Class Functions-------------------------------------------------------------------------------------------------------- +//Private: + +//-Instance Functions------------------------------------------------------------------------------------------------------ +//Private: +void FrontendConsole::handleDirective(const DMessage& d) +{ + /* TODO: Probably should add a heading like "Notice)" or something. + * + * TODO: Look into escape codes (console support per platform varies) + * to replicate bold/italic/underlined. + * + * Also, might want to replace the html tags with some kind of more + * complex message object or just some other way to better communicate + * the message in a frontend agnostic matter, so we could even have something + * like Underlined Text for GUI and: + * + * Underlined Text + * --------------- + * + * for console. + */ + + // Replace possible HTML tags/entities with something more sensible for console + QString txt = Qx::String::mapArg(d.text, { + {u""_s, u""_s}, + {u""_s, u""_s}, + {u""_s, u"*"_s}, + {u""_s, u"*"_s}, + {u""_s, u"`"_s}, + {u""_s, u"`"_s}, + {u"
"_s, u"\n"_s}, + {u"<"_s, u"<"_s}, + {u">"_s, u">"_s}, + {u" "_s, u" "_s}, + }); + print(txt); +} + +void FrontendConsole::handleDirective(const DError& d) { print(d.error, Stream::Error);} + +void FrontendConsole::handleDirective(const DProcedureStart& d) +{ + print(d.label); + mProgressPrinter.start(d.label); +} + +void FrontendConsole::handleDirective(const DProcedureStop& d) +{ + Q_UNUSED(d); + mProgressPrinter.finish(); +} + +void FrontendConsole::handleDirective(const DProcedureProgress& d) { mProgressPrinter.setValue(d.current); } +void FrontendConsole::handleDirective(const DProcedureScale& d) { mProgressPrinter.setMaximum(d.max); } +void FrontendConsole::handleDirective(const DStatusUpdate& d) { print(d.heading + u"] "_s + d.message);} + +// Sync directive handlers +void FrontendConsole::handleDirective(const DBlockingMessage& d) +{ + // TODO: Probably should add a heading like "Notice)" or something + print(d.text); +} + +// Request directive handlers +void FrontendConsole::handleDirective(const DBlockingError& d, DBlockingError::Choice* response) +{ + Q_ASSERT(d.choices != DBlockingError::Choice::NoChoice); + bool validDef = d.choices.testFlag(d.defaultChoice); + + // Print Error + print(d.error, Stream::Error); + print(); + + // Print Prompt + print(validDef ? INSTR_CHOICE_SEL : INSTR_CHOICE_SEL_NO_DEF); + + // Print Choices + QList choices; + for(auto c : magic_enum::enum_values()) + { + if(!d.choices.testFlag(c)) + continue; + + choices.append(c); + QString cStr = TEMPL_OPTION.arg(choices.count()).arg(ENUM_NAME(c)); + if(validDef && c == d.defaultChoice) + cStr += '*'; + print(cStr); + } + + // Get selection + auto sel = prompt([c = choices.count()](int i){ return i > 0 && i <= c; }); + *response = sel ? choices[*sel - 1] : d.defaultChoice; +} + +void FrontendConsole::handleDirective(const DSaveFilename& d, QString* response) +{ + // Print Prompt + QString cap = d.caption + (!d.extFilterDesc.isEmpty() ? u" ("_s + d.extFilterDesc + u")"_s : QString()); + QString inst = INSTR_FILE_ENTER.arg(Qx::String::join(d.extFilter, u" "_s, u"*."_s)); + print(cap); + print(inst); + + // Get selection + auto path = prompt([ef = d.extFilter](const QString& i){ + QFileInfo fi(i); + return ef.contains(fi.suffix()); + }); + *response = path ? *path : QString(); +} + +void FrontendConsole::handleDirective(const DExistingDir& d, QString* response) +{ + // Print Prompt + print(d.caption); + print(INSTR_DIR_ENTER_EXIST); + + // Get selection + auto path = prompt([](const QString& i){ + QDir dir(i); + return dir.exists(); + }); + *response = path ? *path: QString(); +} + +void FrontendConsole::handleDirective(const DItemSelection& d, QString* response) +{ + Q_ASSERT(!d.items.isEmpty()); + + // Print Prompt + print(d.caption); + print(d.label); + print(INSTR_ITEM_SEL); + + // Print Choices + for(auto i = 0; const QString& itm : d.items) + print(TEMPL_OPTION.arg(++i).arg(itm)); + + // Get selection + auto sel = prompt([c = d.items.count()](int i){ return i > 0 && i <= c; }); + *response = sel ? d.items[*sel - 1] : d.items.first(); +} + +void FrontendConsole::handleDirective(const DYesOrNo& d, bool* response) +{ + // Print Prompt + print(d.question); + print(INSTR_YES_OR_NO); + + // Get selection + static QSet yes{u"yes"_s, u"y"_s}; + static QSet no{u"no"_s, u"n"_s}; + auto answer = prompt([](const QString& i){ + QString lc = i.toLower(); + return yes.contains(lc) || no.contains(lc); + }); + *response = answer && yes.contains(answer->toLower()); +} + +template + requires Qx::defines_left_shift_for +void FrontendConsole::print(const P& p, Stream s) +{ + auto& cs = s == Stream::Out ? Qx::cout : Qx::cerr; + + mProgressPrinter.checkAndResetEndlCtrl(); + cs << p << Qt::endl; +} + +template + requires Input::Validator +std::optional FrontendConsole::prompt(V v) +{ + forever + { + QString str = Qx::cin.readLine(); + if(str.isEmpty()) + return std::nullopt; + + R convIn; + if(Input::to(str, convIn) && v(convIn)) + return convIn; + + print(INSTR_TRY_AGAIN); + } +} diff --git a/app/console/src/frontend/console.h b/app/console/src/frontend/console.h new file mode 100644 index 0000000..2d275b2 --- /dev/null +++ b/app/console/src/frontend/console.h @@ -0,0 +1,71 @@ +#ifndef CONSOLE_H +#define CONSOLE_H + +// Qx Includes +#include + +// Project Includes +#include "frontend/framework.h" +#include "frontend/progressprinter.h" +#include "input.h" + +class FrontendConsole final : public FrontendFramework +{ +//-Class Enums-------------------------------------------------------------------------------------------------------- +private: + enum class Stream { Out, Error }; + +//-Class Variables-------------------------------------------------------------------------------------------------------- +private: + // Instructions + static inline const QString INSTR_TRY_AGAIN = u"Invalid response, try again..."_s; + static inline const QString INSTR_CHOICE_SEL = u"Select Action (or ENTER for *):"_s; + static inline const QString INSTR_CHOICE_SEL_NO_DEF = u"Select Action:"_s; + static inline const QString INSTR_FILE_ENTER = u"File Path (or ENTER to cancel):"_s; + static inline const QString INSTR_DIR_ENTER_EXIST = u"Existing Directory (or ENTER to cancel):"_s; + static inline const QString INSTR_YES_OR_NO = u"Yes or No/ENTER:"_s; + static inline const QString INSTR_ITEM_SEL = u"Select Item (or ENTER for 1):"_s; + + // Templates + static inline const QString TEMPL_OPTION = u"%1) %2"_s; + +//-Instance Variables---------------------------------------------------------------------------------------------- +private: + ProgressPrinter mProgressPrinter; + +//-Constructor------------------------------------------------------------------------------------------------------- +public: + explicit FrontendConsole(QGuiApplication* app); + +//-Instance Functions------------------------------------------------------------------------------------------------------ +private: + // Async directive handlers + void handleDirective(const DMessage& d) override; + void handleDirective(const DError& d) override; + void handleDirective(const DProcedureStart& d) override; + void handleDirective(const DProcedureStop& d) override; + void handleDirective(const DProcedureProgress& d) override; + void handleDirective(const DProcedureScale& d) override; + void handleDirective(const DStatusUpdate& d) override; + + // Sync directive handlers + void handleDirective(const DBlockingMessage& d) override; + + // Request directive handlers + void handleDirective(const DBlockingError& d, DBlockingError::Choice* response) override; + void handleDirective(const DSaveFilename& d, QString* response) override; + void handleDirective(const DExistingDir& d, QString* response) override; + void handleDirective(const DItemSelection& d, QString* response) override; + void handleDirective(const DYesOrNo& d, bool* response) override; + + // Derived + template + requires Qx::defines_left_shift_for + void print(const P& p = QString(), Stream s = Stream::Out); + + template + requires Input::Validator + std::optional prompt(V v); +}; + +#endif // CONSOLE_H diff --git a/app/console/src/frontend/input.cpp b/app/console/src/frontend/input.cpp new file mode 100644 index 0000000..b6f26fc --- /dev/null +++ b/app/console/src/frontend/input.cpp @@ -0,0 +1,28 @@ +// Unit Include +#include "input.h" + +namespace +{ + +template +bool numericConversion(const QString& s, MF&& mf, T& out) +{ + bool ok; + if constexpr(std::integral) + out = std::invoke(std::forward(mf), s, &ok, 10); + else + out = std::invoke(std::forward(mf), s, &ok); + return ok; +} + +} + +namespace Input +{ + +//-Functions------------------------------------------------------------------------------------------------------ +bool to(const QString& in, QString& out) { out = in; return true; } +bool to(const QString& in, int& out) { return numericConversion(in, &QString::toInt, out); } +bool to(const QString& in, double& out) { return numericConversion(in, &QString::toDouble, out); } + +} diff --git a/app/console/src/frontend/input.h b/app/console/src/frontend/input.h new file mode 100644 index 0000000..62f5903 --- /dev/null +++ b/app/console/src/frontend/input.h @@ -0,0 +1,36 @@ +#ifndef INPUT_H +#define INPUT_H + +// Qt Includes +#include + +/* Technically we could use QVariant or QTextStream::operator>>() to facilitate + * parsing an entire line as a given type, but both of those methods have + * caveats that IMO make this explicit, albeit annoying, conversion setup + * better. + * + * QVariant/QMetaType - Cannot check that QString can be converted to T at compile + * time, so a runtime assert would be needed, a failure of which might not be discovered + * for a while. + * + * Qx::cin >> - will accept things like "123 non-number-text" and stops once a space is hit + * so that case would have to be checked for and in all cases we'd have to manually read + * until '\n' is hit + */ + +namespace Input +{ + +bool to(const QString& in, QString& out); +bool to(const QString& in, int& out); +bool to(const QString& in, double& out); + +template +concept Validator = std::predicate; + +template +concept Type = requires(T t){ to({}, t); }; + +} + +#endif // INPUT_H diff --git a/app/console/src/frontend/progressprinter.cpp b/app/console/src/frontend/progressprinter.cpp new file mode 100644 index 0000000..9d2adeb --- /dev/null +++ b/app/console/src/frontend/progressprinter.cpp @@ -0,0 +1,97 @@ +// Unit Include +#include "progressprinter.h" + +using namespace Qt::StringLiterals; + +//=============================================================================================================== +// ProgressPrinter +//=============================================================================================================== + +//-Constructor------------------------------------------------------------------------------------------------------- +//Public: +ProgressPrinter::ProgressPrinter() { reset(); } + +//-Instance Functions------------------------------------------------------------------------------------------------------ +//Private: +void ProgressPrinter::rescale() +{ + // Check for busy state special case + if(mCurrent == 0 && mMax == 0) + { + Qx::cout << u"..."_s << Qt::endl; + return; + } + + qint64 scaled = (100.0 * mCurrent)/mMax; + if(scaled != mScaled) + { + mScaled = scaled; + print(); + } +} + +void ProgressPrinter::print() +{ + Qx::cout << '\r' << mScaled << Qt::flush; + mHoldsEndlCtrl = true; +} + +void ProgressPrinter::reset() +{ + mCurrent = 0; + mMax = 100; + mScaled = -1; + mProcedure = {}; + mActive = false; + mHoldsEndlCtrl = false; +} + +//Public: +void ProgressPrinter::start(const QString& procedure) +{ + mProcedure = procedure; + mActive = true; +} + +void ProgressPrinter::finish() +{ + if(!mActive) + return; + + // Maybe have DProcedureStart pass a short name that's unused in GUI (or used as window label) + // so that here can we can print "Short Name: Done" in case there's other messages printed between + checkAndResetEndlCtrl(); + Qx::cout << u"Done"_s << Qt::endl; + reset(); +} + +void ProgressPrinter::setValue(qint64 value) +{ + if(!mActive || mCurrent == value || value > mMax) + return; + mCurrent = value; + rescale(); +} + +void ProgressPrinter::setMaximum(qint64 max) +{ + if(mMax == max) + return; + mMax = max; + if(mCurrent > mMax) + mCurrent = mMax; + + if(mActive) + rescale(); +} + +bool ProgressPrinter::isActive() const { return mActive; } +bool ProgressPrinter::checkAndResetEndlCtrl() +{ + if(!mHoldsEndlCtrl) + return false; + + Qx::cout << Qt::endl; + mHoldsEndlCtrl = false; + return true; +} diff --git a/app/console/src/frontend/progressprinter.h b/app/console/src/frontend/progressprinter.h new file mode 100644 index 0000000..316d597 --- /dev/null +++ b/app/console/src/frontend/progressprinter.h @@ -0,0 +1,43 @@ +#ifndef PROGRESSPRINTER_H +#define PROGRESSPRINTER_H + +// Qt Includes +#include +#include + +// Qx Includes +#include + +class ProgressPrinter +{ +//-Instance Variables---------------------------------------------------------------------------------------------- +private: + qint64 mCurrent; + qint64 mMax; + qint64 mScaled; + + QString mProcedure; // NOTE: Unused + bool mActive; + bool mHoldsEndlCtrl; + +//-Constructor------------------------------------------------------------------------------------------------------- +public: + ProgressPrinter(); + +//-Instance Functions------------------------------------------------------------------------------------------------------ +private: + void rescale(); + void print(); + void reset(); + +public: + void start(const QString& procedure); + void finish(); + + void setValue(qint64 value); + void setMaximum(qint64 max); + bool isActive() const; + bool checkAndResetEndlCtrl(); +}; + +#endif // PROGRESSPRINTER_H diff --git a/app/console/src/main.cpp b/app/console/src/main.cpp new file mode 100644 index 0000000..0ba2e58 --- /dev/null +++ b/app/console/src/main.cpp @@ -0,0 +1,13 @@ +// Qt Includes +#include // Seems odd, but that's just what we need for this + +// Project Includes +#include "frontend/console.h" + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + FrontendConsole frontend(&app); + return frontend.exec(); +} + diff --git a/app/gui/CMakeLists.txt b/app/gui/CMakeLists.txt index d420beb..b39dfd4 100644 --- a/app/gui/CMakeLists.txt +++ b/app/gui/CMakeLists.txt @@ -1,10 +1,12 @@ #================= Common Build ========================= +set(PRETTY_NAME "${PROJECT_NAME}") + # Add via ob standard executable include(OB/Executable) ob_add_standard_executable(${APP_GUI_TARGET_NAME} - NAMESPACE "${PROJECT_NAMESPACE}" ALIAS "${APP_GUI_ALIAS_NAME}" + OUTPUT_NAME "${PROJECT_NAME}" SOURCE frontend/gui.h frontend/gui.cpp @@ -23,5 +25,5 @@ ob_add_standard_executable(${APP_GUI_TARGET_NAME} # Add exe details on Windows if(CMAKE_SYSTEM_NAME STREQUAL Windows) include(FrontendFramework) - set_clip_exe_details(${APP_GUI_TARGET_NAME} ${APP_GUI_ALIAS_NAME}) + set_clip_exe_details(${APP_GUI_TARGET_NAME} ${PRETTY_NAME}) endif() diff --git a/app/gui/src/frontend/gui.cpp b/app/gui/src/frontend/gui.cpp index d620886..a6e94f6 100644 --- a/app/gui/src/frontend/gui.cpp +++ b/app/gui/src/frontend/gui.cpp @@ -9,6 +9,7 @@ // Qx Includes #include +#include // Magic enum #include "magic_enum_utility.hpp" @@ -130,7 +131,8 @@ void FrontendGui::handleDirective(const DBlockingError& d, DBlockingError::Choic void FrontendGui::handleDirective(const DSaveFilename& d, QString* response) { - *response = QFileDialog::getSaveFileName(nullptr, d.caption, d.dir, d.filter, d.selectedFilter); + QString filter = d.extFilterDesc + u" ("_s + Qx::String::join(d.extFilter, u" "_s, u"*."_s) + u")"_s; + *response = QFileDialog::getSaveFileName(nullptr, d.caption, d.dir, filter); } void FrontendGui::handleDirective(const DExistingDir& d, QString* response) diff --git a/app/gui/src/frontend/gui.h b/app/gui/src/frontend/gui.h index fb66221..531c87d 100644 --- a/app/gui/src/frontend/gui.h +++ b/app/gui/src/frontend/gui.h @@ -40,16 +40,16 @@ class FrontendGui final : public FrontendFramework explicit FrontendGui(QApplication* app); //-Class Functions-------------------------------------------------------------------------------------------------------- -//Private: -static QMessageBox::StandardButtons choicesToButtons(DBlockingError::Choices cs); +private: + static QMessageBox::StandardButtons choicesToButtons(DBlockingError::Choices cs); -template - requires Qx::any_of -static QMessageBox* prepareMessageBox(const MessageT& dMsg); + template + requires Qx::any_of + static QMessageBox* prepareMessageBox(const MessageT& dMsg); -static bool windowsAreOpen(); + static bool windowsAreOpen(); -static QIcon& trayExitIconFromResources(); + static QIcon& trayExitIconFromResources(); //-Instance Functions------------------------------------------------------------------------------------------------------ private: diff --git a/lib/backend/include/kernel/directive.h b/lib/backend/include/kernel/directive.h index 255058a..568408f 100644 --- a/lib/backend/include/kernel/directive.h +++ b/lib/backend/include/kernel/directive.h @@ -1,9 +1,6 @@ #ifndef DIRECTIVE_H #define DIRECTIVE_H -// Shared Library Support -#include "clifp_backend_export.h" - // Qt Includes #include @@ -59,12 +56,12 @@ struct DProcedureStop {}; struct DProcedureProgress { - quint64 current; + qint64 current; }; struct DProcedureScale { - quint64 max; + qint64 max; }; struct DClipboardUpdate @@ -128,8 +125,8 @@ struct DSaveFilename { QString caption; QString dir; - QString filter; - QString* selectedFilter = nullptr; + QStringList extFilter; + QString extFilterDesc; using response_type = QString; }; diff --git a/lib/backend/src/kernel/core.h b/lib/backend/src/kernel/core.h index f49af92..e16c866 100644 --- a/lib/backend/src/kernel/core.h +++ b/lib/backend/src/kernel/core.h @@ -170,7 +170,7 @@ class Core : public QObject, public Directorate // Help template static inline const QString HELP_TEMPL = u"Usage:
" - PROJECT_SHORT_NAME "<global options> command <command options>
" + PROJECT_SHORT_NAME " <global options> command <command options>
" "
" "Global Options:%1
" "
" diff --git a/lib/backend/src/task/t-download.cpp b/lib/backend/src/task/t-download.cpp index f5aae9f..444f3e1 100644 --- a/lib/backend/src/task/t-download.cpp +++ b/lib/backend/src/task/t-download.cpp @@ -72,10 +72,10 @@ TDownload::TDownload(Core& core) : logEvent(LOG_EVENT_DOWNLOAD_AUTH.arg(prompt)); }); - connect(&mDownloadManager, &Qx::AsyncDownloadManager::downloadTotalChanged, this, [this](quint64 total){ + connect(&mDownloadManager, &Qx::AsyncDownloadManager::downloadTotalChanged, this, [this](qint64 total){ postDirective(total); }); - connect(&mDownloadManager, &Qx::AsyncDownloadManager::downloadProgress, this, [this](quint64 bytes){ + connect(&mDownloadManager, &Qx::AsyncDownloadManager::downloadProgress, this, [this](qint64 bytes){ postDirective(bytes); }); connect(&mDownloadManager, &Qx::AsyncDownloadManager::finished, this, &TDownload::postDownload); diff --git a/lib/backend/src/task/t-mount.cpp b/lib/backend/src/task/t-mount.cpp index e99a2ad..afced88 100644 --- a/lib/backend/src/task/t-mount.cpp +++ b/lib/backend/src/task/t-mount.cpp @@ -69,8 +69,8 @@ void TMount::perform() postDirective(label); // Update state - postDirective(0u); - postDirective(0u); // Cause busy state + postDirective(0); + postDirective(0); // Cause busy state //-Setup Mounter(s)------------------------------------ @@ -172,7 +172,7 @@ void TMount::postMount(Qx::Error errorStatus) { mMounting = false; - // Reset mounter pointers ('this' will delete them due to parenting so there's no leak) + // Reset mounter pointers ('this' will delete them due to parenting so there's no leak) mMounterProxy = nullptr; mMounterQmp = nullptr; mMounterRouter = nullptr;