Skip to content

Commit

Permalink
Updated checksum validation
Browse files Browse the repository at this point in the history
  • Loading branch information
pazuzu156 committed Sep 23, 2015
1 parent 23461b4 commit f5bae56
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ int main(int argc, char *argv[])
if(upFile.exists())
upFile.remove();

QMessageBox::information(&w, "Up to Date", "You are now up to date!");
QMessageBox::StandardButton reply;
QMessageBox::question(&w, "Up to Date", "You are now up to date! Would you like to view the changelog?", QMessageBox::Yes|QMessageBox::No);
if(reply == QMessageBox::Yes)
{
QDesktopServices::openUrl(QString("http://kalebklein.com/portfolio/post/checkmate"));
}
}
}

Expand Down
26 changes: 24 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ MainWindow::MainWindow(QWidget *parent) :

this->establishUIConnections();
this->working = false;
this->lVersion = 18; // Important! This is the version checker!!!!!!!
this->version = "2.2";
this->lVersion = 19; // Important! This is the version checker!!!!!!!
this->version = "2.3";
this->gversion = "2.1.2";
this->hashType = -1;
}

MainWindow::~MainWindow()
Expand Down Expand Up @@ -147,6 +148,24 @@ void MainWindow::onValidateButtonClicked()
}
else
{
if(this->hashType == -1)
{
switch(hash.length())
{
case 32:
setHashType("md5");
break;
case 40:
setHashType("sha1");
break;
case 64:
setHashType("sha256");
break;
default:
setHashType("md5");
}
}

this->mThread->setFileLocation(file);
this->mThread->setHashType(this->hashType);
connect(mThread, SIGNAL(CalculationPerformed(QString)), this, SLOT(onCalculationPerformed(QString)));
Expand Down Expand Up @@ -181,6 +200,9 @@ void MainWindow::onCalculationPerformed(QString hash)

// revert working to false
this->working = false;

// set hashType back to -1
this->hashType = -1;
}

void MainWindow::alert(QString title, QString message, bool critical)
Expand Down

0 comments on commit f5bae56

Please sign in to comment.