Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

trim the textbox inputs in hunter config dialog

  • Loading branch information...
commit 25bc6a52945259e02fcd030fba78b518e2bfbb71 1 parent 0195e07
agentzh authored
Showing with 10 additions and 10 deletions.
  1. +5 −5 hunterconfigdialog.cpp
  2. +4 −4 hunterconfigdialog.h
  3. +1 −1  mainwindow.cpp
View
10 hunterconfigdialog.cpp
@@ -71,25 +71,25 @@ HunterConfigDialog::HunterConfigDialog(QWidget *parent): QDialog(parent) {
void HunterConfigDialog::accept() {
//qDebug() << "Checking form values...\n";
if (formGroup->isChecked()) {
- QString progPath = progPathEdit->text();
+ QString progPath = progPathEdit->text().trimmed();
if (progPath.isEmpty()) {
croak(tr("Hunter Program Path is empty."));
progPathEdit->selectAll();
return;
}
if (! QFile::exists(progPath)) {
- croak(tr("Hunter Program File not found."));
+ croak(tr("Hunter Program File \"%1\" not found.").arg(progPath));
progPathEdit->selectAll();
return;
}
QFile::Permissions perms = QFile::permissions(progPath);
if (! (perms & QFile::ExeUser)) {
- croak(tr("Hunter Program File is not executable."));
+ croak(tr("Hunter Program File \"%1\" is not executable.").arg(progPath));
progPathEdit->selectAll();
return;
}
- QString vdomPath = vdomPathEdit->text();
+ QString vdomPath = vdomPathEdit->text().trimmed();
if (vdomPath.isEmpty()) {
croak(tr("VDOM Output File Path is empty."));
vdomPathEdit->selectAll();
@@ -99,7 +99,7 @@ void HunterConfigDialog::accept() {
//qDebug() << "VDOM Path " << vdomPath << " exists.\n";
perms = QFile::permissions(vdomPath);
if (! (perms & QFile::WriteUser)) {
- croak(tr("VDOM Output File Path is not writable."));
+ croak(tr("VDOM Output File \"%1\" is not writable.").arg(vdomPath));
vdomPathEdit->selectAll();
return;
}
View
8 hunterconfigdialog.h
@@ -16,11 +16,11 @@ class HunterConfigDialog: public QDialog {
}
void setProgPath(const QString& path) {
- progPathEdit->setText(path);
+ progPathEdit->setText(path.trimmed());
}
void setVdomPath(const QString& path) {
- vdomPathEdit->setText(path);
+ vdomPathEdit->setText(path.trimmed());
}
bool hunterEnabled() {
@@ -28,11 +28,11 @@ class HunterConfigDialog: public QDialog {
}
QString progPath() const {
- return progPathEdit->text();
+ return progPathEdit->text().trimmed();
}
QString vdomPath() const {
- return vdomPathEdit->text();
+ return vdomPathEdit->text().trimmed();
}
public slots:
View
2  mainwindow.cpp
@@ -78,7 +78,7 @@ void MainWindow::changeLocation() {
void MainWindow::loadFinished(bool done) {
if (!done) {
QMessageBox::warning(this, tr("Browser Loader"),
- QString("Failed to open resource %1.").arg(m_urlEdit->text()),
+ QString("Failed to open resource %1.").arg(m_urlEdit->text().trimmed()),
QMessageBox::NoButton);
return;
}
Please sign in to comment.
Something went wrong with that request. Please try again.