From beeb5c9377c26ae44a8723609af2d672c32d00b7 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 23 May 2020 23:28:39 -0500 Subject: Qt UI: Fix building non-install environment --- ui/qt5/mountdialog.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ui/qt5/mountdialog.cc') diff --git a/ui/qt5/mountdialog.cc b/ui/qt5/mountdialog.cc index f986423..103e442 100644 --- a/ui/qt5/mountdialog.cc +++ b/ui/qt5/mountdialog.cc @@ -16,6 +16,7 @@ #include #include #include +#include #include MountDialog::MountDialog(QStringList skipParts, QStringList skipMounts, @@ -75,7 +76,11 @@ MountDialog::MountDialog(QStringList skipParts, QStringList skipMounts, QVBoxLayout *controlLayout = new QVBoxLayout; controlLayout->addWidget(new QLabel(tr("Partition"))); +#ifdef HAS_INSTALL_ENV controlLayout->addWidget(partList); +#else /* !HAS_INSTALL_ENV */ + controlLayout->addWidget(partInput); +#endif /* HAS_INSTALL_ENV */ controlLayout->addWidget(new QLabel(tr("will be mounted on"))); controlLayout->addWidget(pathInput); @@ -87,14 +92,22 @@ MountDialog::MountDialog(QStringList skipParts, QStringList skipMounts, } QString MountDialog::partition() const { +#ifdef HAS_INSTALL_ENV assert(partList->currentItem() != nullptr); return partList->currentItem()->text(); +#else /* !HAS_INSTALL_ENV */ + return partInput->text(); +#endif /* HAS_INSTALL_ENV */ } void MountDialog::setPartition(const QString &part) { +#ifdef HAS_INSTALL_ENV QList candidate = partList->findItems(part, Qt::MatchExactly); if(candidate.empty()) return; partList->setCurrentItem(candidate.at(0)); +#else /* !HAS_INSTALL_ENV */ + partInput->setText(part); +#endif /* HAS_INSTALL_ENV */ } QString MountDialog::mountPoint() const { -- cgit v1.2.3-60-g2f50