[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdebase/kcontrol/kfontinst/kio
From: Craig Drummond <craig () kde ! org>
Date: 2003-11-01 0:19:20
[Download RAW message or body]
CVS commit by craig:
Fix renaming of folders.
M +10 -7 KioFonts.cpp 1.17
--- kdebase/kcontrol/kfontinst/kio/KioFonts.cpp #1.16:1.17
@@ -1060,5 +1060,6 @@ void CKioFonts::rename(const KURL &src,
bool nrs=false,
- dir=S_ISDIR(buffSrc.st_mode);
+ dir=S_ISDIR(buffSrc.st_mode),
+ linkDir=S_ISLNK(buffSrc.st_mode) && \
!(CFontEngine::isAFont(srcPath)||CFontEngine::isAAfm(srcPath)); \
QStringList::ConstIterator it;
QStringList list=CGlobal::cfg().getRealTopDirs(src.path());
@@ -1067,8 +1068,9 @@ void CKioFonts::rename(const KURL &src,
{
QCString cmd;
- bool first=true;
+ bool first=true,
+ found=false;
for(it=list.begin(); it!=list.end(); ++it)
- if(CMisc::fExists(*it+sSub))
+ if(dir ? CMisc::dExists(*it+sSub) : CMisc::fExists(*it+sSub) || \
CMisc::isLink(*it+sSub)) {
if(first)
@@ -1080,9 +1082,10 @@ void CKioFonts::rename(const KURL &src,
cmd+=" ";
cmd+=QFile::encodeName(KProcess::quote(*it+dSub));
+ found=true;
}
nrs=true;
- if(!doRootCmd(cmd))
+ if(!found || !doRootCmd(cmd))
{
error(KIO::ERR_CANNOT_RENAME, src.path());
@@ -1092,5 +1095,5 @@ void CKioFonts::rename(const KURL &src,
else
for(it=list.begin(); it!=list.end(); ++it)
- if(CMisc::fExists(*it+sSub))
+ if(dir ? CMisc::dExists(*it+sSub) : CMisc::fExists(*it+sSub) || \
CMisc::isLink(*it+sSub)) {
KDE_DBUG << "rename " << *it+sSub << " to " << *it+dSub << endl;
@@ -1117,5 +1120,5 @@ void CKioFonts::rename(const KURL &src,
}
- if(dir)
+ if(dir || linkDir)
{
if(!CMisc::hidden(srcPath, true))
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic