VirtualBox

Changeset 87317 in vbox


Ignore:
Timestamp:
Jan 20, 2021 10:14:39 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: Adding isValid method to UIFilePathSelector's API

Location:
trunk/src/VBox/Frontends/VirtualBox/src/widgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp

    r85136 r87317  
    161161}
    162162
     163bool UIFilePathSelector::isValid() const
     164{
     165    if (m_strPath.isNull() || m_strPath.isEmpty())
     166        return false;
     167    QFileInfo fileInfo(m_strPath);
     168    if (!fileInfo.exists() || !fileInfo.isReadable())
     169        return false;
     170    return true;
     171}
     172
    163173void UIFilePathSelector::setToolTip(const QString &strToolTip)
    164174{
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h

    r85137 r87317  
    111111    QString path() const { return m_strPath; }
    112112
     113    /** Returns true if the selected path points to an existing/readable file. */
     114    bool isValid() const;
     115
    113116    /** Sets overriden widget's @a strToolTip.
    114117      * @note If nothing set it's generated automatically. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette