void MusicFileInformationWidget::setFileInformation(const QString &name) { MusicSongTag tag; bool state = tag.readFile(m_path = name); QFileInfo fin(name); QString check; ui->filePathEdit->setText( (check = name).isEmpty() ? "-" : check ); ui->fileFormatEdit->setText( (check = fin.suffix() ).isEmpty() ? "-" : check ); ui->fileSizeEdit->setText( (check = MusicUtils::UNumber::size2Label(fin.size()) ) .isEmpty() ? "-" : check ); ui->fileAlbumEdit->setText( state ? ((check = tag.getAlbum()).isEmpty() ? "-" : check) : "-" ); ui->fileArtistEdit->setText( state ? ((check = tag.getArtist()).isEmpty() ? "-" : check) : "-" ); ui->fileGenreEdit->setText( state ? ((check = tag.getGenre()).isEmpty() ? "-" : check) : "-" ); ui->fileTitleEdit->setText( state ? ((check = tag.getTitle()).isEmpty() ? "-" : check) : "-" ); ui->fileYearEdit->setText( state ? ((check = tag.getYear()).isEmpty() ? "-" : check) : "-" ); ui->fileTimeEdit->setText( state ? ((check = tag.getLengthString()).isEmpty() ? "-" : check) : "-" ); ui->BitrateEdit->setText( state ? ((check = (tag.getBitrate())) .isEmpty() ? "-" : check) : "-" ); ui->ChannelEdit->setText( state ? ((check = tag.getChannel()) .isEmpty() ? "-" : check) : "-" ); ui->SamplingRateEdit->setText( state ? ((check = tag.getSamplingRate()) .isEmpty() ? "-" : check) : "-" ); ui->TrackNumEdit->setText( state ? ((check = tag.getTrackNum()).isEmpty() ? "-" : check) : "-" ); ui->descriptionEdit->setText( state ? ((check = QString("%1 %2").arg(tag.getFormat()) .arg(tag.getMode())).isEmpty() ? "-" : check) : "-" ); }