Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43987c94 authored by Daniel Zheng's avatar Daniel Zheng
Browse files

Fixed parameter styling and minor error in tasks

Test: tested compilation
Change-Id: Ieb949243da1284dec3bad2caa895a59465858adc
parent aa70f4c7
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -21,8 +21,8 @@

using namespace std::string_literals;

FlashTask::FlashTask(const std::string& _slot, const std::string& _pname)
    : pname_(_pname), fname_(find_item(_pname)), slot_(_slot) {
FlashTask::FlashTask(const std::string& slot, const std::string& pname)
    : pname_(pname), fname_(find_item(pname)), slot_(slot) {
    if (fname_.empty()) die("cannot determine image filename for '%s'", pname_.c_str());
}
FlashTask::FlashTask(const std::string& _slot, const std::string& _pname, const std::string& _fname)
@@ -44,9 +44,9 @@ void FlashTask::Run() {
    do_for_partitions(pname_, slot_, flash, true);
}

RebootTask::RebootTask(FlashingPlan* _fp) : fp_(_fp){};
RebootTask::RebootTask(FlashingPlan* _fp, const std::string& _reboot_target)
    : reboot_target_(_reboot_target), fp_(_fp){};
RebootTask::RebootTask(FlashingPlan* fp) : fp_(fp){};
RebootTask::RebootTask(FlashingPlan* fp, const std::string& reboot_target)
    : reboot_target_(reboot_target), fp_(fp){};

void RebootTask::Run() {
    if ((reboot_target_ == "userspace" || reboot_target_ == "fastboot")) {
+8 −10
Original line number Diff line number Diff line
@@ -32,11 +32,10 @@ class Task {

class FlashTask : public Task {
  public:
    FlashTask(const std::string& _slot, const std::string& _pname);
    FlashTask(const std::string& _slot, const std::string& _pname, const std::string& _fname);
    FlashTask(const std::string& slot, const std::string& pname);
    FlashTask(const std::string& slot, const std::string& pname, const std::string& fname);

    void Run() override;
    ~FlashTask() {}

  private:
    const std::string pname_;
@@ -46,14 +45,13 @@ class FlashTask : public Task {

class RebootTask : public Task {
  public:
    RebootTask(FlashingPlan* _fp);
    RebootTask(FlashingPlan* _fp, const std::string& _reboot_target);
    RebootTask(FlashingPlan* fp);
    RebootTask(FlashingPlan* fp, const std::string& reboot_target);
    void Run() override;
    ~RebootTask() {}

  private:
    const std::string reboot_target_ = "";
    FlashingPlan* fp_;
    const FlashingPlan* fp_;
};

class FlashSuperLayoutTask : public Task {
@@ -77,7 +75,7 @@ class UpdateSuperTask : public Task {
    void Run() override;

  private:
    FlashingPlan* fp_;
    const FlashingPlan* fp_;
};

class ResizeTask : public Task {
@@ -87,7 +85,7 @@ class ResizeTask : public Task {
    void Run() override;

  private:
    FlashingPlan* fp_;
    const FlashingPlan* fp_;
    const std::string pname_;
    const std::string size_;
    const std::string slot_;
@@ -99,6 +97,6 @@ class DeleteTask : public Task {
    void Run() override;

  private:
    FlashingPlan* fp_;
    const FlashingPlan* fp_;
    const std::string pname_;
};