summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-02 02:09:49 (UTC)
committer llornkcor <llornkcor>2002-05-02 02:09:49 (UTC)
commit6dfc6f34420b8c9222d1c785efc950fc5031a7f0 (patch) (unidiff)
treea144e5e4c2be3e57d0939090ee5a39982f17804d
parent45ba3b844e3fb8d9b9e1936ad2abec869d25dd33 (diff)
downloadopie-6dfc6f34420b8c9222d1c785efc950fc5031a7f0.zip
opie-6dfc6f34420b8c9222d1c785efc950fc5031a7f0.tar.gz
opie-6dfc6f34420b8c9222d1c785efc950fc5031a7f0.tar.bz2
damned QFileInfo::isExecutable bug...
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index e3ab76b..7cd8644 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -709,68 +709,75 @@ void AdvancedFm::showRemoteMenu(QListViewItem * item)
709 m.insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); 709 m.insertItem( tr( "File Info" ), this, SLOT( fileStatus() ));
710 m.insertSeparator(); 710 m.insertSeparator();
711 m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); 711 m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() ));
712 m.insertSeparator(); 712 m.insertSeparator();
713 m.insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); 713 m.insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() ));
714 m.insertItem( tr( "Properties" ), this, SLOT( doProperties() )); 714 m.insertItem( tr( "Properties" ), this, SLOT( doProperties() ));
715 m.setCheckable(TRUE); 715 m.setCheckable(TRUE);
716 if (!b) 716 if (!b)
717 m.setItemChecked(m.idAt(0),TRUE); 717 m.setItemChecked(m.idAt(0),TRUE);
718 else 718 else
719 m.setItemChecked(m.idAt(0),FALSE); 719 m.setItemChecked(m.idAt(0),FALSE);
720 m.exec( QCursor::pos() ); 720 m.exec( QCursor::pos() );
721 } 721 }
722} 722}
723 723
724void AdvancedFm::runThis() { 724void AdvancedFm::runThis() {
725// QFileInfo *fi; 725// QFileInfo *fi;
726QString fs; 726QString fs;
727 if (TabWidget->currentPageIndex() == 0) { 727 if (TabWidget->currentPageIndex() == 0) {
728 QString curFile = Local_View->currentItem()->text(0); 728 QString curFile = Local_View->currentItem()->text(0);
729 729
730 fs= getFileSystemType((const QString &) currentDir.canonicalPath()); 730 fs= getFileSystemType((const QString &) currentDir.canonicalPath());
731 QFileInfo fileInfo( currentDir.canonicalPath()+"/"+curFile); 731 QFileInfo fileInfo( currentDir.canonicalPath()+"/"+curFile);
732 qDebug( fileInfo.owner()); 732 qDebug( fileInfo.owner());
733 if( fileInfo.isExecutable() || fs == "vfat" && fileInfo.filePath().contains("/bin") ) { 733 if( (fileInfo.permission( QFileInfo::ExeUser)
734 QCopEnvelope e("QPE/System", "execute(QString)" ); 734 | fileInfo.permission( QFileInfo::ExeGroup)
735 e << curFile; 735 | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) {
736 | fs == "vfat" && fileInfo.filePath().contains("/bin") ) {
737// if( fileInfo.isExecutable() |
738 QCopEnvelope e("QPE/System", "execute(QString)" );
739 e << curFile;
736 } else { 740 } else {
737 curFile = currentDir.canonicalPath()+"/"+curFile; 741 curFile = currentDir.canonicalPath()+"/"+curFile;
738 DocLnk nf(curFile); 742 DocLnk nf(curFile);
739 QString execStr = nf.exec(); 743 QString execStr = nf.exec();
740 qDebug( execStr); 744 qDebug( execStr);
741 if( execStr.isEmpty() ) { 745 if( execStr.isEmpty() ) {
742 } else { 746 } else {
743 nf.execute(); 747 nf.execute();
744 } 748 }
745 } 749 }
746// MimeType mt( curFile); 750// MimeType mt( curFile);
747 } else { 751 } else {
748 QString curFile = Remote_View->currentItem()->text(0); 752 QString curFile = Remote_View->currentItem()->text(0);
749 fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath()); 753 fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath());
750 qDebug("Filesystemtype is "+fs); 754 qDebug("Filesystemtype is "+fs);
751 QFileInfo fileInfo( currentRemoteDir.canonicalPath()+"/"+curFile); 755 QFileInfo fileInfo( currentRemoteDir.canonicalPath()+"/"+curFile);
752 if(fileInfo.isExecutable() || fs == "vfat" && fileInfo.filePath().contains("/bin") ) { 756 if( (fileInfo.permission( QFileInfo::ExeUser)
757 | fileInfo.permission( QFileInfo::ExeGroup)
758 | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) {
759 | fs == "vfat" && fileInfo.filePath().contains("/bin") ) {
753 QCopEnvelope e("QPE/System", "execute(QString)" ); 760 QCopEnvelope e("QPE/System", "execute(QString)" );
754 e << curFile; 761 e << curFile;
755 } else { 762 } else {
756 curFile = currentRemoteDir.canonicalPath()+"/"+curFile; 763 curFile = currentRemoteDir.canonicalPath()+"/"+curFile;
757 DocLnk nf(curFile); 764 DocLnk nf(curFile);
758 QString execStr = nf.exec(); 765 QString execStr = nf.exec();
759 qDebug(execStr); 766 qDebug(execStr);
760 if( execStr.isEmpty() ) { 767 if( execStr.isEmpty() ) {
761 } else { 768 } else {
762 nf.execute(); 769 nf.execute();
763 } 770 }
764 } 771 }
765// MimeType mt( curFile); 772// MimeType mt( curFile);
766 } 773 }
767} 774}
768 775
769void AdvancedFm::runText() { 776void AdvancedFm::runText() {
770 if (TabWidget->currentPageIndex() == 0) { 777 if (TabWidget->currentPageIndex() == 0) {
771 QString curFile = Local_View->currentItem()->text(0); 778 QString curFile = Local_View->currentItem()->text(0);
772 curFile = currentDir.canonicalPath()+"/"+curFile; 779 curFile = currentDir.canonicalPath()+"/"+curFile;
773 QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); 780 QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" );
774 e << curFile; 781 e << curFile;
775 } else { 782 } else {
776 QString curFile = Remote_View->currentItem()->text(0); 783 QString curFile = Remote_View->currentItem()->text(0);