当前位置: 首页>>代码示例>>C++>>正文


C++ QDir::rmpath方法代码示例

本文整理汇总了C++中QDir::rmpath方法的典型用法代码示例。如果您正苦于以下问题:C++ QDir::rmpath方法的具体用法?C++ QDir::rmpath怎么用?C++ QDir::rmpath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QDir的用法示例。


在下文中一共展示了QDir::rmpath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: removePath

/*!
 * \qmlsignal FileWriter::removePath()
 * Used in QML to remove a Path from a file system
 */
void FileWriter::removePath(){
    QDir qdir;
    if (qdir.exists(m_RemoveDir)){
        qdir.rmpath(m_RemoveDir);
    }else{
        QString s;
        s.append("the path ").append(m_RemoveDir).append("Does not exsit  so there no need to remove it");
        emit error(s);
        m_errorString = s;
    }
}
开发者ID:bobweaver,项目名称:QtPlugins,代码行数:15,代码来源:filewriter.cpp

示例2: bupFuseFinished

void PlanExecutor::bupFuseFinished(int pExitCode, QProcess::ExitStatus pExitStatus) {
	if(pExitStatus != QProcess::NormalExit || pExitCode != 0) {
		KNotification::event(KNotification::Error, i18nc("@title", "Problem"),
		                     i18nc("notification", "Error when trying to mount backup archive:\n%1",
		                           QString::fromLocal8Bit(mBupFuseProcess->readAllStandardError())));
	}

	mShowFilesAction->setChecked(false);
	mBupFuseProcess->deleteLater();
	mBupFuseProcess = NULL;
	QDir lDir;
	lDir.rmpath(mTempDir);
	mOkToShowBackup = false;
}
开发者ID:kcroot,项目名称:Kup,代码行数:14,代码来源:planexecutor.cpp

示例3: undoOperation

bool CopyDirectoryOperation::undoOperation()
{
    Q_ASSERT(arguments().count() == 2);

    QDir dir;
    const QStringList files = value(QLatin1String("files")).toStringList();
    foreach (const QString &file, files) {
        if (!QFile::remove(file)) {
            setError(InvalidArguments);
            setErrorString(tr("Could not remove %0").arg(file));
            return false;
        }
        dir.rmpath(QFileInfo(file).absolutePath());
        emit outputTextChanged(file);
    }

    setValue(QLatin1String("files"), QStringList());
    return true;
}
开发者ID:KDE,项目名称:necessitas-installer-framework,代码行数:19,代码来源:copydirectoryoperation.cpp

示例4: run

void IncomeDataThread::run() {
	//Receiving Record data from the server.
	//std::cout << "IDT_RUN" << std::endl;
	char buff[2048];
	while (fd >= 0) {
		int temp1, readLen;
		read(fd, &temp1, 4);
		//memcpy(&temp1,buff,4);
		//std::cout << temp1 << std::endl;
		char fn[temp1 + 1];
		read(fd, fn, temp1);
		fn[temp1] = '\0';
		read(fd, &temp1, 4);
		//memcpy(&temp1,buff,4);
		emit recordHeader(temp1, QString::fromLatin1(fn));

		int slideCount = temp1;
		for (int i = 0; i < slideCount; i++) {
			int animCount;
			int noteLen;
			read(fd, &animCount, 4);
			//memcpy(&animCount,buff,4);
			read(fd, &noteLen, 4);
			if (noteLen != 0) {
				char note[noteLen + 1];
				int offset = 0;
				int remain = noteLen;
				while (remain) {
					if (remain < 2048)
						readLen = read(fd, buff, remain);
					else
						readLen = read(fd, buff, 2048);
					memcpy(note + offset, buff, readLen);
					offset += readLen;
					remain -= readLen;
				}
				note[noteLen] = '\0';
				emit slide(i, animCount, QString::fromLatin1(note));
			} else
				emit slide(i, animCount, QString::fromLatin1('\0'));
		}

		emit received();

		QDir dir;
		dir.rmpath("data/image/tempData");
		dir.mkpath("data/image/tempData");
		//dir.mkpath("app/native/assets/images/temp");
		//dir.mkpath("images/tempData");
		QString first("data/image/tempData/s");
		//QString first("app/native/assets/images/temp/s");
		QString last(".png");

		for (int i = 0; i < slideCount; i++) {
			int fileLen;
			read(fd, &fileLen, 4);
			std::cout << fileLen << std::endl;
			//char bufk[fileLen];
			char *bufk = (char*)malloc(fileLen);
			int remain = fileLen;
			int offset = 0;

			/*readLen = read(fd,bufk,fileLen);
			std::cout<<readLen<<std::endl;
			return;*/

			while (remain) {
				if (remain < 2048)
					readLen = read(fd, buff, remain);
				else
					readLen = read(fd, buff, 2048);
				memcpy(bufk + offset, buff, readLen);
				offset += readLen;
				remain -= readLen;
				std::cout<<remain<<std::endl;
				//usleep(1);
			}
			QByteArray ba(bufk, fileLen);
			QImage file = QImage::fromData(ba, "PNG");
			QString no;
			no.setNum(i + 1);
			file.save(first + no + last, "PNG");
			free(bufk);
			//usleep(700000);
			//ba.clear();
		}

		/*long fileLen;
		 read(fd, &fileLen, 8);
		 std::cout << fileLen << std::endl;
		 char bufk[(int) fileLen];
		 int remain = (int) fileLen;
		 int offset = 0;
		 int count = 0;
		 while (remain) {
		 if (remain < 2048)
		 readLen = read(fd, buff, remain);
		 else
		 readLen = read(fd, buff, 2048);
		 memcpy(bufk + offset, buff, readLen);
//.........这里部分代码省略.........
开发者ID:aaron3481,项目名称:BSmartPresentor,代码行数:101,代码来源:ConnectionManager.cpp


注:本文中的QDir::rmpath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。