summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp149
1 files changed, 76 insertions, 73 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index bd513c0..b5fcccf 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -321,7 +321,7 @@ void AdvancedFm::populateLocalView()
} else {
- if(fi->isExecutable()) {
- pm = Resource::loadPixmap( "exec");
- item->setPixmap( 0,pm);
- }
- else if( !fi->isReadable() ) {
+// if(fi->isExecutable()) {
+// pm = Resource::loadPixmap( "exec");
+// item->setPixmap( 0,pm);
+// }
+ if( !fi->isReadable() ) {
pm = Resource::loadPixmap( "locked" );
@@ -437,7 +437,7 @@ void AdvancedFm::populateRemoteView()
} else {
- if(fi->isExecutable()) {
- pm = Resource::loadPixmap( "exec");
- item->setPixmap( 0,pm);
- }
- else if( !fi->isReadable() ) {
+// if(fi->isExecutable()) {
+// pm = Resource::loadPixmap( "exec");
+// item->setPixmap( 0,pm);
+// }
+ if( !fi->isReadable() ) {
pm = Resource::loadPixmap( "locked" );
@@ -718,6 +718,6 @@ void AdvancedFm::runThis() {
QFileInfo fileInfo( currentDir.canonicalPath()+"/"+curFile);
- if(fileInfo.isExecutable()) {
- QCopEnvelope e("QPE/System", "execute(QString)" );
- e << curFile;
- } else {
+// if(fileInfo.isExecutable()) {
+// QCopEnvelope e("QPE/System", "execute(QString)" );
+// e << curFile;
+// } else {
curFile = currentDir.canonicalPath()+"/"+curFile;
@@ -730,3 +730,3 @@ void AdvancedFm::runThis() {
}
- }
+// }
// MimeType mt( curFile);
@@ -735,6 +735,6 @@ void AdvancedFm::runThis() {
QFileInfo fileInfo( currentRemoteDir.canonicalPath()+"/"+curFile);
- if(fileInfo.isExecutable()) {
- QCopEnvelope e("QPE/System", "execute(QString)" );
- e << curFile;
- } else {
+// if(fileInfo.isExecutable()) {
+// QCopEnvelope e("QPE/System", "execute(QString)" );
+// e << curFile;
+// } else {
curFile = currentRemoteDir.canonicalPath()+"/"+curFile;
@@ -747,3 +747,3 @@ void AdvancedFm::runThis() {
}
- }
+// }
// MimeType mt( curFile);
@@ -1048,3 +1048,3 @@ QStringList AdvancedFm::getPath() {
if ( it.current()->isSelected() ) {
- strList << currentDir.canonicalPath()+"/"+ it.current()->text(0);
+ strList << it.current()->text(0);
}
@@ -1141,10 +1141,12 @@ void AdvancedFm::copy()
- QString destFile = currentRemoteDir.canonicalPath();
- if(destFile.right(1).find("/",0,TRUE) == -1)
- destFile+="/";
- destFile +=(*it);
- curFile = currentDir.canonicalPath();
- if(curFile.right(1).find("/",0,TRUE) == -1)
- curFile +="/";
- curFile +=(*it);
+ QString destFile = currentRemoteDir.canonicalPath()+"/"+(*it);
+// if(destFile.right(1).find("/",0,TRUE) == -1)
+// destFile+="/";
+// destFile +=(*it);
+
+ curFile = currentDir.canonicalPath()+"/"+(*it);
+// if(curFile.right(1).find("/",0,TRUE) == -1)
+// curFile +="/";
+// curFile +=(*it);
+
QFile f(destFile);
@@ -1152,4 +1154,6 @@ void AdvancedFm::copy()
f.remove();
- if(!copyFile(destFile, curFile) )
+ if(!copyFile(destFile, curFile) ) {
+ QMessageBox::message("AdvancedFm","Could not copy\n"+curFile +"to\n"+destFile);
qWarning("nothin doing");
+ }
}
@@ -1161,10 +1165,5 @@ void AdvancedFm::copy()
- QString destFile = currentDir.canonicalPath();
- if(destFile.right(1).find("/",0,TRUE) == -1)
- destFile+="/";
- destFile +=(*it);
- curFile = currentRemoteDir.canonicalPath();
- if(curFile.right(1).find("/",0,TRUE) == -1)
- curFile +="/";
- curFile +=(*it);
+ QString destFile = currentDir.canonicalPath()+"/"+(*it);
+ curFile = currentRemoteDir.canonicalPath()+"/"+(*it);
+
QFile f(destFile);
@@ -1172,4 +1171,7 @@ void AdvancedFm::copy()
f.remove();
- if(!copyFile(destFile, curFile) )
- qWarning("nothin doing");
+ if(!copyFile(destFile, curFile) ) {
+ QMessageBox::message("AdvancedFm","Could not copy\n"+curFile +"to\n"+destFile);
+
+ qWarning("nothin doing");
+ }
}
@@ -1190,6 +1192,3 @@ void AdvancedFm::copyAs()
QString destFile;
- curFile = currentDir.canonicalPath();
- if(curFile.right(1).find("/",0,TRUE) == -1)
- curFile +="/";
- curFile+=(*it);
+ curFile = currentDir.canonicalPath()+"/"+(*it);
// InputDialog *fileDlg;
@@ -1200,6 +1199,3 @@ void AdvancedFm::copyAs()
QString filename = fileDlg->LineEdit1->text();
- destFile = currentRemoteDir.canonicalPath();
- if(destFile.right(1).find("/",0,TRUE) == -1)
- destFile+="/";
- destFile +=(*it);
+ destFile = currentRemoteDir.canonicalPath()+"/"+(*it);
@@ -1208,4 +1204,6 @@ void AdvancedFm::copyAs()
f.remove();
- if(!copyFile(destFile, curFile) )
+ if(!copyFile(destFile, curFile) ) {
+ QMessageBox::message("AdvancedFm","Could not copy\n"+curFile +"to\n"+destFile);
qWarning("nothin doing");
+ }
}
@@ -1219,6 +1217,3 @@ void AdvancedFm::copyAs()
- curFile = currentDir.canonicalPath();
- if(curFile.right(1).find("/",0,TRUE) == -1)
- curFile +="/";
- curFile+=(*it);
+ curFile = currentDir.canonicalPath()+"/"+(*it);
QString destFile;
@@ -1228,6 +1223,3 @@ void AdvancedFm::copyAs()
QString filename = fileDlg->LineEdit1->text();
- destFile = currentDir.canonicalPath();
- if(destFile.right(1).find("/",0,TRUE) == -1)
- destFile+="/";
- destFile +=(*it);
+ destFile = currentDir.canonicalPath()+"/"+(*it);
@@ -1236,4 +1228,6 @@ void AdvancedFm::copyAs()
f.remove();
- if(!copyFile(destFile, curFile) )
- qWarning("nothin doing");
+ if(!copyFile(destFile, curFile) ) {
+ QMessageBox::message("AdvancedFm","Could not copy\n"+curFile +"to\n"+destFile);
+ qWarning("nothin doing");
+ }
}
@@ -1536,18 +1530,27 @@ void AdvancedFm::mkSym() {
QString cmd;
+ QStringList curFileList = getPath();
+
if (TabWidget->currentPageIndex() == 0) {
- QString curFile = Local_View->currentItem()->text(0);
- if(curFile.right(1) == "/") curFile = curFile.left(curFile.length() - 1);
- QString destName = currentRemoteDir.canonicalPath()+"/"+curFile;
- curFile = currentDir.canonicalPath()+"/"+curFile;
- cmd = "ln -s "+curFile+" "+destName;
- system(cmd.latin1() );
- populateRemoteView();
+ for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
+
+ QString destName = currentRemoteDir.canonicalPath()+"/"+(*it);
+ QString curFile = currentDir.canonicalPath()+"/"+(*it);
+ cmd = "ln -s "+curFile+" "+destName;
+ qDebug(cmd);
+ system(cmd.latin1() );
+ }
+ populateRemoteView();
+ TabWidget->setCurrentPage(1);
} else {
- QString curFile = Remote_View->currentItem()->text(0);
- if(curFile.right(1) == "/") curFile = curFile.left(curFile.length() - 1);
- QString destName = currentDir.canonicalPath()+"/"+curFile;
- curFile = currentRemoteDir.canonicalPath()+"/"+curFile;
- cmd = "ln -s "+curFile+" "+destName;
- system(cmd.latin1() );
- populateLocalView();
+ for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
+
+ QString destName = currentDir.canonicalPath()+"/"+(*it);
+ QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it);
+
+ cmd = "ln -s "+curFile+" "+destName;
+ qDebug(cmd);
+ system(cmd.latin1() );
+ }
+ populateLocalView();
+ TabWidget->setCurrentPage(0);
}