Jump to content
  • 0
Alexey

Delete record file

Question

How do I remove a recorded QVRT file? Is it a reliable way to construct the path manually using WbtCommon::Data::FileInfo contents and then pass it to QFile::remove() or is there an API method? For example:

const WbtCommon::Data::FileInfo file = WbtApi::WbtSystem().getRecordingList()[0];
const WbtCommon::Data::WbtStatusData status = WbtApi::WbtStatus().getCurrentStatus();
QString mountPoint;
switch(file._diskSlot)
{
    case WbtCommon::Data::DATA_DISK_1:
        mountPoint = QString::fromStdString(status._systemVolumesStatus._DataDisk1VolumeStatus._mountPoint);
        break;
    case WbtCommon::Data::DATA_DISK_2:
        mountPoint = QString::fromStdString(status._systemVolumesStatus._DataDisk2VolumeStatus._mountPoint);
        break;
}
if(!mountPoint.isEmpty())
{
    const QString path = mountPoint + QDir::separator() + QString::fromStdString(file._fileName) + ".qvrt";
    QFile::remove(path);
}

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

When you get the FileInfo data it gives you a name and the disk that the file resides on. Disk 1 is mounted at /data1, Disk 2 is mounted at /data2. I don't remember off the top of my head whether the filename ends in .qvrt or not, but if it doesn't you want to add that to the end of the name to get the full filename. From there C++ and the various libraries included with the dev environment provide plenty of options to delete files. Here's an example-

http://www.cplusplus.com/reference/cstdio/remove/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×