@@ -142,7 +142,7 @@ static QString MakeOptions(const QList<FormatOption>& options)
142142static QString MakeOptionsNoLeadingComma (const QList<FormatOption>& options)
143143{
144144 QString str = MakeOptions (options);
145- return ( str.length ()) != 0 ? str.mid (1 ) : str;
145+ return ! str.isEmpty () ? str.mid (1 ) : str;
146146
147147}
148148
@@ -461,7 +461,7 @@ QString MainWindow::filterForFormat(int idx)
461461QString MainWindow::ensureExtensionPresent (const QString& name, int idx)
462462{
463463 QString outname = name;
464- if (QFileInfo (name).suffix ().length () == 0 ) {
464+ if (QFileInfo (name).suffix ().isEmpty () ) {
465465 QStringList extensions = formatList_[idx].getExtensions ();
466466 if (!extensions.empty () && !extensions[0 ].isEmpty ()) {
467467 outname += " ." + extensions[0 ];
@@ -524,7 +524,7 @@ void MainWindow::browseInputFile()
524524void MainWindow::browseOutputFile ()
525525{
526526 int idx = currentComboFormatIndex (ui_.outputFormatCombo );
527- QString startFile = babelData_.outputFileName_ .length () == 0 ? babelData_.outputBrowse_ : babelData_.outputFileName_ ;
527+ QString startFile = babelData_.outputFileName_ .isEmpty () ? babelData_.outputBrowse_ : babelData_.outputFileName_ ;
528528 QFileInfo finfo (startFile);
529529 if (!finfo.isDir () && (!filterForFormatIncludes (idx, finfo.suffix ()))) {
530530 startFile = finfo.dir ().absolutePath ();
@@ -534,7 +534,7 @@ void MainWindow::browseOutputFile()
534534 QFileDialog::getSaveFileName (nullptr , tr (" Output File Name" ),
535535 startFile,
536536 filterForFormat (idx));
537- if (str.length () != 0 ) {
537+ if (! str.isEmpty () ) {
538538 str = ensureExtensionPresent (str, idx);
539539 babelData_.outputBrowse_ = str;
540540 babelData_.outputFileName_ = str;
@@ -805,7 +805,7 @@ bool MainWindow::isOkToGo()
805805 babelData_.inputFileNames_ << ui_.inputFileNameText ->text ();
806806 }
807807 if ((babelData_.outputType_ == BabelData::fileType_) &&
808- (babelData_.outputFileName_ .size () == 0 ) &&
808+ (babelData_.outputFileName_ .isEmpty () ) &&
809809 (!ui_.outputFileNameText ->text ().isEmpty ())) {
810810 babelData_.outputFileName_ = ui_.outputFileNameText ->text ();
811811 }
@@ -825,7 +825,7 @@ bool MainWindow::isOkToGo()
825825 return false ;
826826 }
827827 if (babelData_.outputType_ == BabelData::fileType_ &&
828- babelData_.outputFileName_ .length () == 0 ) {
828+ babelData_.outputFileName_ .isEmpty () ) {
829829 QMessageBox::information (nullptr , QString (appName), tr (" No output file specified" ));
830830 return false ;
831831 }
@@ -920,7 +920,7 @@ void MainWindow::applyActionX()
920920
921921 // output file or device option
922922 if (outIsFile) {
923- if (babelData_.outputFileName_ != " " ) {
923+ if (! babelData_.outputFileName_ . isEmpty () ) {
924924 args << " -F" << babelData_.outputFileName_ ;
925925 }
926926 } else if (babelData_.outputType_ == BabelData::deviceType_) {
0 commit comments