diff --git a/src/gui/AboutDialog.cxx b/src/gui/AboutDialog.cxx index 7a4488b7a..75d759118 100644 --- a/src/gui/AboutDialog.cxx +++ b/src/gui/AboutDialog.cxx @@ -302,9 +302,9 @@ void AboutDialog::handleCommand(CommandSender* sender, int cmd, int data, int id const string AboutDialog::getUrl(const string& str) const { bool isUrl = false; - int start = 0, len = 0; + size_t start = 0, len = 0; - for(int i = 0; i < str.size(); ++i) + for(size_t i = 0; i < str.size(); ++i) { string remainder = str.substr(i); char ch = str[i]; diff --git a/src/gui/LauncherDialog.hxx b/src/gui/LauncherDialog.hxx index 767157b27..139ff2c19 100644 --- a/src/gui/LauncherDialog.hxx +++ b/src/gui/LauncherDialog.hxx @@ -182,7 +182,7 @@ class LauncherDialog : public Dialog ButtonWidget* myOptionsButton{nullptr}; ButtonWidget* myQuitButton{nullptr}; - StaticTextWidget* myRomLink{nullptr}; +// FIXME - NOT USED StaticTextWidget* myRomLink{nullptr}; RomInfoWidget* myRomInfoWidget{nullptr}; std::unordered_map myMD5List; diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 20168b95a..2ace0896d 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -518,17 +518,15 @@ void StaticTextWidget::setLink(size_t start, int len, bool underline) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool StaticTextWidget::setUrl(const string& url, const string& label) { - size_t start = string::npos; - int len = 0; - const string text = label != EmptyString ? label : url; - + size_t start = string::npos, len = 0; + const string& text = label != EmptyString ? label : url; if(text != EmptyString) { // determine position of label if((start = BSPF::findIgnoreCase(_label, text)) != string::npos) { - len = int(text.size()); + len = text.size(); _url = url; } } @@ -546,20 +544,20 @@ bool StaticTextWidget::setUrl(const string& url, const string& label) if(start != string::npos) { // find end of URL - for(int i = int(start); i < _label.size(); ++i) + for(size_t i = start; i < _label.size(); ++i) { char ch = _label[i]; if(ch == ' ' || ch == ')' || ch == '>') { - len = i - int(start); + len = i - start; _url = _label.substr(start, len); break; } } if(!len) { - len = int(_label.size() - start); + len = _label.size() - start; _url = _label.substr(start); } } @@ -567,7 +565,7 @@ bool StaticTextWidget::setUrl(const string& url, const string& label) if(len) { - setLink(start, len, true); + setLink(start, int(len), true); setCmd(kOpenUrlCmd); return true; } @@ -619,9 +617,9 @@ ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const string& label, int cmd, bool repeat) : StaticTextWidget(boss, font, x, y, w, h, label, TextAlign::Center), - _cmd{cmd}, _repeat{repeat} { + _cmd = cmd; _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG; _bgcolor = kBtnColor; _bgcolorhi = kBtnColorHi; diff --git a/src/gui/Widget.hxx b/src/gui/Widget.hxx index f21ef91cd..8497c2f89 100644 --- a/src/gui/Widget.hxx +++ b/src/gui/Widget.hxx @@ -220,7 +220,7 @@ class StaticTextWidget : public Widget, public CommandSender void setLink(size_t start = string::npos, int len = 0, bool underline = false); bool setUrl(const string& url = EmptyString, const string& label = EmptyString); - const string& getUrl() const { return _url; }; + const string& getUrl() const { return _url; } protected: void handleMouseEntered() override; @@ -284,7 +284,6 @@ class ButtonWidget : public StaticTextWidget void drawWidget(bool hilite) override; protected: - int _cmd{0}; bool _repeat{false}; // button repeats bool _useBitmap{false}; const uInt32* _bitmap{nullptr};