author | llornkcor <llornkcor> | 2002-05-02 02:09:49 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-05-02 02:09:49 (UTC) |
commit | 6dfc6f34420b8c9222d1c785efc950fc5031a7f0 (patch) (side-by-side diff) | |
tree | a144e5e4c2be3e57d0939090ee5a39982f17804d | |
parent | 45ba3b844e3fb8d9b9e1936ad2abec869d25dd33 (diff) | |
download | opie-6dfc6f34420b8c9222d1c785efc950fc5031a7f0.zip opie-6dfc6f34420b8c9222d1c785efc950fc5031a7f0.tar.gz opie-6dfc6f34420b8c9222d1c785efc950fc5031a7f0.tar.bz2 |
damned QFileInfo::isExecutable bug...
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 11 |
1 files changed, 9 insertions, 2 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) m.insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); m.insertSeparator(); m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); m.insertSeparator(); m.insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); m.insertItem( tr( "Properties" ), this, SLOT( doProperties() )); m.setCheckable(TRUE); if (!b) m.setItemChecked(m.idAt(0),TRUE); else m.setItemChecked(m.idAt(0),FALSE); m.exec( QCursor::pos() ); } } void AdvancedFm::runThis() { // QFileInfo *fi; QString fs; if (TabWidget->currentPageIndex() == 0) { QString curFile = Local_View->currentItem()->text(0); fs= getFileSystemType((const QString &) currentDir.canonicalPath()); QFileInfo fileInfo( currentDir.canonicalPath()+"/"+curFile); qDebug( fileInfo.owner()); - if( fileInfo.isExecutable() || fs == "vfat" && fileInfo.filePath().contains("/bin") ) { + if( (fileInfo.permission( QFileInfo::ExeUser) + | fileInfo.permission( QFileInfo::ExeGroup) + | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { + | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { +// if( fileInfo.isExecutable() | QCopEnvelope e("QPE/System", "execute(QString)" ); e << curFile; } else { curFile = currentDir.canonicalPath()+"/"+curFile; DocLnk nf(curFile); QString execStr = nf.exec(); qDebug( execStr); if( execStr.isEmpty() ) { } else { nf.execute(); } } // MimeType mt( curFile); } else { QString curFile = Remote_View->currentItem()->text(0); fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath()); qDebug("Filesystemtype is "+fs); QFileInfo fileInfo( currentRemoteDir.canonicalPath()+"/"+curFile); - if(fileInfo.isExecutable() || fs == "vfat" && fileInfo.filePath().contains("/bin") ) { + if( (fileInfo.permission( QFileInfo::ExeUser) + | fileInfo.permission( QFileInfo::ExeGroup) + | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { + | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { QCopEnvelope e("QPE/System", "execute(QString)" ); e << curFile; } else { curFile = currentRemoteDir.canonicalPath()+"/"+curFile; DocLnk nf(curFile); QString execStr = nf.exec(); qDebug(execStr); if( execStr.isEmpty() ) { } else { nf.execute(); } } // MimeType mt( curFile); } } void AdvancedFm::runText() { if (TabWidget->currentPageIndex() == 0) { QString curFile = Local_View->currentItem()->text(0); curFile = currentDir.canonicalPath()+"/"+curFile; QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); e << curFile; } else { QString curFile = Remote_View->currentItem()->text(0); |