Exemplo n.º 1
0
void uiLoader::setupLocal()
{
    qDebug( " ========== Setting up local environment" );

    QDir dir;

    errorMsg = "could not create path " + output;
    QVERIFY2( dir.mkpath(output), qPrintable(errorMsg) );

    QHashIterator<QString, QString> j(enginesToTest);
    while ( j.hasNext() ) {
        j.next();

        QString engineName = j.key();
        QString engineDir = output + '/' + engineName;

        // create <engine> or clean it
        QString tmpPath = output + '/' + engineName;
        if ( dir.exists(tmpPath) ) {
            clearDirectory(tmpPath);
        } else {
            dir.mkdir(tmpPath);
        }

        // create *.baseline or clean it
        tmpPath = output + '/' + engineName + ".baseline";
        if ( dir.exists(tmpPath) ) {
            clearDirectory(tmpPath);
        } else {
            dir.mkdir(tmpPath);
        }

        // create *.diff or clean it
        tmpPath = output + '/' + engineName + ".diff";
        if ( dir.exists(tmpPath) ) {
            clearDirectory(tmpPath);
        } else {
            dir.mkdir(tmpPath);
        }

        // create *.failed or clean it
        tmpPath = output + '/' + engineName + ".failed";
        if ( dir.exists(tmpPath) ) {
            clearDirectory(tmpPath);
        } else {
            dir.mkdir(tmpPath);
        }
    }

    qDebug() << "\t(I) Created on local machine:" << output;
}
Exemplo n.º 2
0
void RepositoryProfile::removeDirectory ( const QString& path )
{
  QDir dir ( path );

  if ( !dir.exists() ) // nothing to delete
    return;

  clearDirectory ( path );

  if ( !dir.rmdir ( path ) )
    qDebug ( "could not remove directory: %s", qPrintable ( path ) );
}
Exemplo n.º 3
0
bool AdiumChatStyleEngine::clearDirectory(const QString &directory)
{
	QDir dir(directory);
	QFileInfo fi;

	foreach (const QString &fileName, dir.entryList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden))
	{
		fi.setFile(dir, fileName);
		if (!fi.isDir())
		{
			if (!dir.remove(fileName))
				return false;
		}
		else
		{
			if (!clearDirectory(QString(directory + "/" + fileName)) || !dir.rmdir(fileName))
				return false;
				
		}	
	}
	return dir.entryList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden).isEmpty();
}
Exemplo n.º 4
0
bool AdiumChatStyleEngine::removeStyle(const QString &styleName)
{
	QDir dir(QString(ggPath() + "/syntax/chat/" + styleName));
	return clearDirectory(dir.absolutePath()) && dir.cdUp() && dir.rmdir(styleName);
}