Hmmm... to delete on a local pc a dir recursive .... i not write 200 feet code...
/* remove dir recursive */
{
if (dir.exists())
{
const QFileInfoList list = dir.entryInfoList();
for (int l = 0; l < list.size(); l++)
{
fi = list.at(l);
if (fi.isDir() && fi.fileName() != "." && fi.fileName() != "..")
DownDir_RM(fi.absoluteFilePath());
else if (fi.isFile())
{
bool ret = qt_unlink(fi.absoluteFilePath());
if (!ret) {
//////Api_Log("Can't remove: " + fi.absoluteFilePath() + " (write-protect?)");
}
}
}
dir.rmdir(d);
}
}
/* remove dir recursive */
void DownDir_RM(const QString d)
{
QDir dir(d);
if (dir.exists())
{
const QFileInfoList list = dir.entryInfoList();
QFileInfo fi;
for (int l = 0; l < list.size(); l++)
{
fi = list.at(l);
if (fi.isDir() && fi.fileName() != "." && fi.fileName() != "..")
DownDir_RM(fi.absoluteFilePath());
else if (fi.isFile())
{
bool ret = qt_unlink(fi.absoluteFilePath());
if (!ret) {
//////Api_Log("Can't remove: " + fi.absoluteFilePath() + " (write-protect?)");
}
}
}
dir.rmdir(d);
}
}
To copy to clipboard, switch view to plain text mode
My problem is to delete on remote server file and path.....
to delete dir i and file i have only a class ....
new QHttp();
QHttpRequestHeader header("DELETE", pathorfile ,1,1); /* header */
http://www.webdav.org/specs/rfc2518....ection.8.6.2.1
DavDelete *lismix = new DavDelete(dbdav,anextpath);
lismix->SetPosition(now);
connect(lismix,
SIGNAL(WarningMsg
(QString)),
this,
SLOT(ShowMessageWarning
(QString)));
connect(lismix, SIGNAL(ConChain(int)), this, SLOT(CodaRemove(int)));
DavDelete *lismix = new DavDelete(dbdav,anextpath);
lismix->SetPosition(now);
connect(lismix, SIGNAL(WarningMsg(QString)), this, SLOT(ShowMessageWarning(QString)));
connect(lismix, SIGNAL(ConChain(int)), this, SLOT(CodaRemove(int)));
To copy to clipboard, switch view to plain text mode
and i have only QStringList from file and Dir or a domdocument like this...
http://ppk.ciz.ch/qt_c++/davinfo.xml
to display tree folder like mc gui....
Bookmarks