Skip to content

Commit

Permalink
Bug Fixed: a bug was introduced when refactoring and making the
Browse files Browse the repository at this point in the history
inspect() method.  We traversed the rest of the method and did not
really honor the user's response of yes/no to continue to modify
registry.

So we'll rename the inspect() method to isOkToProceed()

Also change the return type to a boolean to be more explicit in what
this func does.
  • Loading branch information
serverlinkdev committed Jul 21, 2020
1 parent 43ad253 commit f7f673d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ bool Widget::exists(const QString &someFile)
return ((fileInfo.exists() && fileInfo.isFile()));
}

void Widget::inspect()
bool Widget::isOkToProceed()
{
if (!exists(ut2004ExePath)) return;
if (!exists(ut2004ExePath)) return false;
// make user reselect file if they answered No
ui->pbModifyRegistry->setEnabled(false);
if (!confirmWriteChanges(ut2004ExePath)) return;
return (confirmWriteChanges(ut2004ExePath));
}

bool Widget::isFileAnExecutable(QString &someFile)
Expand Down Expand Up @@ -132,7 +132,7 @@ void Widget::on_pbModifyRegistry_clicked()
// this App says changes made successfully.

// perform some tests to be sure we have sane environment
inspect();
if (!isOkToProceed()) return;

// Write protocolKey to the registry. We wont fail if there is existing,
// so as to allow them to modify the existing.
Expand Down
2 changes: 1 addition & 1 deletion widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private slots:
bool confirmWriteChanges(QString & someFile);
QString convertToNativeSeparators(const QString & someFile);
QString fullCommand;
void inspect();
bool isOkToProceed();
bool isFileAnExecutable(QString & someFile);
void report();
void reportFail();
Expand Down

0 comments on commit f7f673d

Please sign in to comment.