- update: formatting code using astyle; some manual code nicenings

Conflicts:
	src/gui/update.cpp
	src/gui/update.h

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-12-06 05:18:19 +01:00
committed by Thilo Graf
parent 863dac9275
commit 389772e1a8
2 changed files with 323 additions and 250 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -25,12 +25,11 @@
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the along with this program; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*/ */
#ifndef __update__ #ifndef __update__
#define __update__ #define __update__
@@ -47,30 +46,29 @@
class CFlashUpdate : public CProgressWindow class CFlashUpdate : public CProgressWindow
{ {
private: private:
std::string filename; std::string filename;
std::string file_md5; std::string file_md5;
std::string sysfs; std::string sysfs;
char fileType; char fileType;
bool gotImage; bool gotImage;
int width; int width;
bool notify; bool notify;
std::string newVersion;
int menu_ret;
int softupdate_mode;
// void update_php(std::string &url, const char* type); std::string newVersion;
bool selectHttpImage(void); int menu_ret;
bool getUpdateImage(const std::string & version); int softupdate_mode;
bool checkVersion4Update();
public:
CFlashUpdate();
int exec( CMenuTarget* parent, const std::string & actionKey );
bool checkOnlineVersion();
void enableNotify(bool enable) { notify = enable; }
void update_php(std::string &url, const char *type);
bool selectHttpImage(void);
bool getUpdateImage(const std::string &version);
bool checkVersion4Update();
public:
CFlashUpdate();
int exec(CMenuTarget *parent, const std::string &actionKey);
bool checkOnlineVersion();
void enableNotify(bool enable) { notify = enable; }
}; };
class CFlashExpert : public CProgressWindow class CFlashExpert : public CProgressWindow
@@ -79,13 +77,13 @@ class CFlashExpert : public CProgressWindow
int selectedMTD; int selectedMTD;
int width; int width;
int showMTDSelector(const std::string & actionkey); int showMTDSelector(const std::string &actionkey);
int showFileSelector(const std::string & actionkey); int showFileSelector(const std::string &actionkey);
bool checkSize(int mtd, std::string &backupFile); bool checkSize(int mtd, std::string &backupFile);
#ifdef BOXMODEL_CST_HD2 #ifdef BOXMODEL_CST_HD2
bool readDevtableFile(std::string &devtableFile, CMkfsJFFS2::v_devtable_t &v_devtable); bool readDevtableFile(std::string &devtableFile, CMkfsJFFS2::v_devtable_t &v_devtable);
void readmtdJFFS2(std::string &filename, std::string title="", std::string path="/", bool makeDevTable=true); void readmtdJFFS2(std::string &filename, std::string title = "", std::string path = "/", bool makeDevTable = true);
#endif #endif
public: public:
@@ -95,11 +93,10 @@ class CFlashExpert : public CProgressWindow
int createimage_other; int createimage_other;
#endif #endif
CFlashExpert(); CFlashExpert();
static CFlashExpert* getInstance(); static CFlashExpert *getInstance();
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget *parent, const std::string &actionKey);
void writemtd(const std::string & filename, int mtdNumber); void writemtd(const std::string &filename, int mtdNumber);
void readmtd(int readmtd); void readmtd(int readmtd);
}; };
#ifdef BOXMODEL_CST_HD2 #ifdef BOXMODEL_CST_HD2
@@ -113,9 +110,9 @@ class CFlashExpertSetup : public CMenuTarget
public: public:
CFlashExpertSetup(); CFlashExpertSetup();
// ~CFlashExpertSetup(); //~CFlashExpertSetup();
int exec(CMenuTarget* parent, const std::string &actionKey); int exec(CMenuTarget *parent, const std::string &actionKey);
}; };
#endif // BOXMODEL_CST_HD2 #endif // BOXMODEL_CST_HD2