Logo Search packages:      
Sourcecode: q4wine version File versions  Download package

bool corelib::umountImage ( const QString  prefix_name  ) 

This function umount an image or drive from prefix mount point.

Parameters:
prefix_name Prefix name.
Returns:
Return an list of cdrom devices.

Definition at line 1232 of file q4wine-lib.cpp.

References getEscapeString(), getMountedImages(), Prefix::getMountPoint(), getSetting(), runProcess(), and showError().

Referenced by mountImage().

                                                          {
            QString mount_point=db_prefix.getMountPoint(prefix_name);

            if (this->getMountedImages(mount_point)=="none"){
#ifdef DEBUG
                qDebug()<<"[ii] corelib::umountImage: no mounted images found in mount point: "<<mount_point;
#endif
                return false;
            }

#ifdef DEBUG
                  qDebug()<<"[ii] corelib::umountImage: mount point: "<<mount_point;
#endif
                  if (mount_point.isEmpty()){
                        this->showError(QObject::tr("It seems no mount point was set in prefix options.<br>You might need to set it manualy."));
                        return false;
                  }

                  QStringList args;
                  QString arg;

                  QString mount_string;
                  mount_string=this->getSetting("quickmount", "umount_string", false).toString();
#ifdef DEBUG
                  qDebug()<<"[ii] corelib::umountImage: umount string: "<<mount_string;
#endif
                  mount_string.replace("%GUI_SUDO%", getSetting("system", "gui_sudo").toString());
                  mount_string.replace("%SUDO%", getSetting("system", "sudo").toString());
                  mount_string.replace("%UMOUNT_BIN%", getSetting("system", "umount").toString());
                  mount_string.replace("%MOUNT_POINT%", this->getEscapeString(mount_point));

                  args.clear();
                  args.append("-c");
                  args.append(mount_string);
#ifdef DEBUG
                  qDebug()<<"[ii] corelib::umountImage: umount args: "<<args;
#endif

                  return this->runProcess(args, QObject::tr("Umounting..."), QObject::tr("Umounting point: %1").arg(mount_point));

                  return true;
            }


Generated by  Doxygen 1.6.0   Back to index