Exemple #1
0
PackageManagerSettings::PackageManagerSettings( QWidget* parent,  const char* name, WFlags fl )
  : PackageManagerSettingsBase( parent, name, fl )
{
  connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) );
  connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) );
  connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
  connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) );
  connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) );
  connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
  //   connect( CheckBoxLink, SIGNAL(toggled(bool)),
  //    				 activeLinkDestination, SLOT(setEnabled(bool)) );

//  connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) );
//  connect( settingName, SIGNAL(textChanged(const QString&)), this, SLOT(installationSettingSetName(const QString&)) );
//  connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) );
//  connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) );
 // connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) );
  servername->setEnabled(FALSE);
  serverurl->setEnabled(FALSE);
  serverurlDic.setAutoDelete(TRUE);
  destinationname->setEnabled(FALSE);
  destinationurl->setEnabled(FALSE);
  destinationurlDic.setAutoDelete(TRUE);
  readSettings();
	activeLinkDestination->hide();
  serverChanged = false;

  // get rid of setups
//  Settings->hide();
//  settingName->hide();
//  newsetting->hide();
//  renamesetting->hide();
//  removesetting->hide();
}
/*!
  Create a sandbox install directory on the media card for this package
  and if necessary create the media card "package" directory parent.
  The sandbox install directory is symlinked to the main package root.
*/
void SandboxInstallJob::mediaSandboxRoot()
{
    QDir mediaSandbox( media + "/" + PACKAGE_DIRECTORY );
    if ( !mediaSandbox.exists() )  // try creating it from parent
    {
        QDir mediaDir( media );
        if ( !mediaDir.exists() )
        {
            //TODO: Proper error reporting for media card errors
            qWarning( "### %s (the media path) doesnt exist! ###", qPrintable( media ));
            abort = true;
            return;
        }
        qLog(Package) << "Creating directory" << mediaSandbox.path() << "in path" << media;
        if ( !mediaDir.mkdir( PACKAGE_DIRECTORY ))
        {
            //TODO: Proper error reporting for media card errors
            qWarning( "mkdir failed : %s", strerror( errno ));
            abort = true;
            return;
        }
    }
    QString linkTarget = mediaSandbox.path() + "/" + package->md5Sum;
    QFile::link( linkTarget, destination );
    destination = linkTarget;
    if ( mediaSandbox.exists( package->md5Sum ))
    {
        // overwriting with reinstalled package
        removeDestination();
    }
    mediaSandbox.mkdir( package->md5Sum );
}
Exemple #3
0
 void LocationModel::removeAllDestinations()
 {
     while(hasAnyDestination())
         removeDestination(*mDestinations.begin());
 }