summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index e770304..6abdc85 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -155,97 +155,97 @@ void AdvancedFm::doDelete() {
doMsg=false;
break;
case 1:
return;
break;
default:
return;
break;
};
}
QString myFile;
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
myFile = (*it);
if( myFile.find(" -> ",0,TRUE) != -1)
myFile = myFile.left( myFile.find(" -> ",0,TRUE));
QString f = CurrentDir()->canonicalPath();
if(f.right(1).find("/",0,TRUE) == -1)
f += "/";
f += myFile;
if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) {
//if file is a directory
switch ( QMessageBox::warning( this, tr("Delete Directory?"),
tr("<p>Really delete %1 and all it's contents?</p>" ).arg( f ) ,
tr("Yes"), tr("No"), 0, 0, 1) ) {
case 0:
{
f=f.left(f.length()-1);
QString cmd="rm -rf "+f;
startProcess( (const QString)cmd.latin1() );
populateView();
}
break;
case 1:
// exit
break;
default:
break;
};
} else {
if(doMsg) {
switch ( QMessageBox::warning(this,tr("Delete"),
tr("<p>Really delete %1?</p>").arg( myFile ),
tr("Yes"), tr("No"), 0, 0, 1) ) {
- case 0;
+ case 0:
break;
case 1:
return;
break;
default:
return;
break;
};
}
QString cmd="rm "+f;
QFile file(f);
QFileInfo fi(myFile);
if( fi.fileName().find("../",0,TRUE)==-1) {
// odebug << "remove link files "+myFile << oendl;
// DocLnk lnk(f);
DocLnk *lnk;
lnk = new DocLnk(f);
// odebug << "Deleting doclnk " + lnk->linkFile() << oendl;
if(lnk->isValid())
lnk->removeLinkFile();
// delete lnk;
file.remove();
}
}
}
}
populateView();
}
void AdvancedFm::filePerms() {
QStringList curFileList = getPath();
QString filePath;
filePath = CurrentDir()->canonicalPath()+"/";
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
filePermissions *filePerm;
filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it));
QPEApplication::execDialog( filePerm );
if( filePerm )
delete filePerm;
}
populateView();
}
void AdvancedFm::doProperties() {
@@ -279,97 +279,97 @@ void AdvancedFm::copyTimer() {
QTimer::singleShot(125,this,SLOT(copy()));
}
void AdvancedFm::copy() {
QStringList curFileList = getPath();
QDir *thisDir = CurrentDir();
QDir *thatDir = OtherDir();
bool doMsg = true;
int count = curFileList.count();
if( count > 0) {
if(count > 1 ){
QString msg;
msg=tr("<p>Really copy %1 files?</p>").arg(count);
switch ( QMessageBox::warning(this,tr("Copy"),msg
,tr("Yes"),tr("No"),0,0,1) )
{
case 0:
doMsg=false;
break;
case 1:
return;
break;
default:
return;
break;
};
}
QString curFile, item, destFile;
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
item=(*it);
if(item.find("->",0,TRUE)) //symlink
item = item.left(item.find("->",0,TRUE));
curFile = thisDir->canonicalPath()+"/"+ item;
destFile = thatDir->canonicalPath()+"/"+ item;
// odebug << "Destination file is "+destFile << oendl;
// odebug << "CurrentFile file is " + curFile << oendl;
QFile f(destFile);
if( f.exists()) {
if(doMsg) {
switch ( QMessageBox::warning(this,tr("File Exists!"),
tr("<p>%1 already exists. Ok to overwrite?</P>").arg(item),
tr("Yes"),tr("No"),0,0,1)) {
- case 0;
+ case 0:
break;
case 1:
return;
break;
default:
return;
break;
};
}
f.remove();
}
if( !copyFile( curFile, destFile) ) {
QMessageBox::message("AdvancedFm",
tr( "<P>Could not copy %1 to %2</P>").arg(curFile).arg(destFile));
return;
}
}
rePopulate();
}
}
void AdvancedFm::copyAsTimer() {
QTimer::singleShot(125,this,SLOT(copyAs()));
}
void AdvancedFm::copyAs() {
QStringList curFileList = getPath();
QString curFile, item;
InputDialog *fileDlg;
QDir *thisDir = CurrentDir();
QDir *thatDir = OtherDir();
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
QString destFile;
item=(*it);
curFile = thisDir->canonicalPath()+"/"+(*it);
fileDlg = new InputDialog( this, tr("Copy %1 As").arg(curFile), TRUE, 0);
fileDlg->setInputText((const QString &) destFile );
fileDlg->exec();
if( fileDlg->result() == 1 ) {
QString filename = fileDlg->LineEdit1->text();
destFile = thatDir->canonicalPath()+"/"+filename;