VirtualBox

Changeset 92913 in vbox for trunk/src


Ignore:
Timestamp:
Dec 15, 2021 8:25:52 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148869
Message:

FE/Qt: bugref:9371. Using qt instead of RT to deermine host file type.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.cpp

    r92912 r92913  
    3131#include "UIErrorString.h"
    3232#include "UIFileManager.h"
     33#include "UIFileManagerHostTable.h"
    3334#include "UIFileManagerGuestTable.h"
    3435#include "UIMessageCenter.h"
     
    618619    foreach (const QString &strSource, sourcePaths)
    619620    {
    620         RTFSOBJINFO ObjInfo;
    621         int vrc = RTPathQueryInfo(strSource.toStdString().c_str(), &ObjInfo, RTFSOBJATTRADD_NOTHING);
    622         if (RT_SUCCESS(vrc))
    623         {
    624             /* If the source is an directory, make sure to add the appropriate flag to make copying work
    625              * into existing directories on the guest. This otherwise would fail (default): */
    626             if (RTFS_IS_DIRECTORY(ObjInfo.Attr.fMode))
    627                 aFlags << strDirectoryFlags;
    628             else
    629                 aFlags << strFileFlags;
    630         }
     621        KFsObjType enmFileType = UIFileManagerHostTable::fileType(strSource);
     622        if (enmFileType == KFsObjType_Unknown)
     623            emit sigLogOutput(QString("Querying information for host item %1 failed.").arg(strSource), m_strTableName, FileManagerLogType_Error);
     624        /* If the source is an directory, make sure to add the appropriate flag to make copying work
     625         * into existing directories on the guest. This otherwise would fail (default): */
     626        else if (enmFileType == KFsObjType_Directory)
     627            aFlags << strDirectoryFlags;
    631628        else
    632             emit sigLogOutput(QString("Querying information for host item \"%s\" failed with %Rrc").arg(strSource.toStdString().c_str(), vrc),
    633                               m_strTableName, FileManagerLogType_Error);
     629            aFlags << strFileFlags;
    634630    }
    635631
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerHostTable.cpp

    r92900 r92913  
    328328}
    329329
    330 /* static */ KFsObjType UIFileManagerHostTable::fileType(const QFileInfo &fsInfo)
     330/* static */
     331KFsObjType UIFileManagerHostTable::fileType(const QFileInfo &fsInfo)
    331332{
    332333    if (!fsInfo.exists())
     
    340341    else if (fsInfo.isDir())
    341342        return KFsObjType_Directory;
    342 
    343343    return KFsObjType_Unknown;
     344}
     345
     346/* static */
     347KFsObjType  UIFileManagerHostTable::fileType(const QString &strPath)
     348{
     349    return fileType(QFileInfo(strPath));
    344350}
    345351
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerHostTable.h

    r92860 r92913  
    3939    UIFileManagerHostTable(UIActionPool *pActionPool, QWidget *pParent = 0);
    4040    static KFsObjType  fileType(const QFileInfo &fsInfo);
     41    static KFsObjType  fileType(const QString &strPath);
    4142
    4243protected:
Note: See TracChangeset for help on using the changeset viewer.

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