aboutsummaryrefslogtreecommitdiff
path: root/lumina-fm/MainUI.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-12-23 08:46:02 -0500
committerKen Moore <ken@pcbsd.org>2014-12-23 08:46:02 -0500
commit7531a620650cdf0985525775ca84160933e99f26 (patch)
tree89880be799e8da8fc10774c66f4a9fe77fdb8749 /lumina-fm/MainUI.cpp
parentMerge branch 'master' of github.com:pcbsd/lumina (diff)
downloadlumina-7531a620650cdf0985525775ca84160933e99f26.tar.gz
lumina-7531a620650cdf0985525775ca84160933e99f26.tar.bz2
lumina-7531a620650cdf0985525775ca84160933e99f26.zip
Clean up all the Qt5 *.pro files a bit. Now they should always work.
Also do a large clean up of the file operations in lumina-fm: 1) When doing copies of directories, make sure to properly copy all child files/dirs (no matter how deep) 2) Clean the order of directory copies so that you can successfull make a copy of a directory into itself (copy ~/Test -> ~/Test/Test for example) 3) Check for attempting to *move* a directory into itself and show a warning to the user about an invalid operation. 4) Get the total number of files/dirs to be operated on before starting operations. This allows the UI to be more detailed about what it is doing at that particular time. 5) If a directory fails to copy for some reason, don't try to copy all the children of that directory either (they will all fail and just bloat the list of errors)
Diffstat (limited to 'lumina-fm/MainUI.cpp')
-rw-r--r--lumina-fm/MainUI.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp
index 03e7a533..f77d8290 100644
--- a/lumina-fm/MainUI.cpp
+++ b/lumina-fm/MainUI.cpp
@@ -1105,12 +1105,17 @@ void MainUI::RemoveItem(){
if(!checkUserPerms()){ return; }
//Get the selected items
QStringList paths, names;
- QFileInfoList sel = getSelectedItems();
- for(int i=0; i<sel.length(); i++){
- paths << sel[i].absoluteFilePath();
- names << sel[i].fileName();
- }
- if(sel.isEmpty()){ return; } //nothing selected
+ if(CItem.isEmpty()){
+ QFileInfoList sel = getSelectedItems();
+ for(int i=0; i<sel.length(); i++){
+ paths << sel[i].absoluteFilePath();
+ names << sel[i].fileName();
+ }
+ if(sel.isEmpty()){ return; } //nothing selected
+ }else{
+ paths << CItem;
+ names << CItem.section("/",-1);
+ }
//Verify permanent removal of file/dir
if(QMessageBox::Yes != QMessageBox::question(this, tr("Verify Removal"), tr("WARNING: This will permanently delete the file(s) from the system!")+"\n"+tr("Are you sure you want to continue?")+"\n\n"+names.join("\n"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) ){
return; //cancelled
@@ -1119,7 +1124,9 @@ void MainUI::RemoveItem(){
qDebug() << "Delete: "<<paths;
FODialog dlg(this);
dlg.RemoveFiles(paths);
+ dlg.show();
dlg.exec();
+ CItem.clear();
}
void MainUI::RenameItem(){
@@ -1160,6 +1167,7 @@ void MainUI::RenameItem(){
FODialog dlg(this);
dlg.setOverwrite(overwrite);
dlg.MoveFiles(QStringList() << path+fname, QStringList() << path+nname);
+ dlg.show();
dlg.exec();
CItem.clear();
}
@@ -1248,6 +1256,7 @@ void MainUI::PasteItems(){
qDebug() << "Paste Copy:" << copy << "->" << newcopy;
FODialog dlg(this);
dlg.CopyFiles(copy, newcopy);
+ dlg.show();
dlg.exec();
errs = errs || !dlg.noerrors;
}
@@ -1255,6 +1264,7 @@ void MainUI::PasteItems(){
qDebug() << "Paste Cut:" << cut << "->" << newcut;
FODialog dlg(this);
dlg.MoveFiles(cut, newcut);
+ dlg.show();
dlg.exec();
errs = errs || !dlg.noerrors;
}
bgstack15