本文整理汇总了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;
}
}
示例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;
}
示例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;
}
示例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, ¬eLen, 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);
//.........这里部分代码省略.........