summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-07 00:14:17 (UTC)
committer llornkcor <llornkcor>2002-05-07 00:14:17 (UTC)
commitc9849cc04b668f1cda7a16d868299c436d1de042 (patch) (side-by-side diff)
treecc9ff9565931bec34602468b5335e19ed2b3d662
parentf046179d3b49c44896298aa86380046a21394bbc (diff)
downloadopie-c9849cc04b668f1cda7a16d868299c436d1de042.zip
opie-c9849cc04b668f1cda7a16d868299c436d1de042.tar.gz
opie-c9849cc04b668f1cda7a16d868299c436d1de042.tar.bz2
Fix for Sharp rom not having the Properties class
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index b9e254e..18952c3 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -663,84 +663,86 @@ void AdvancedFm::showLocalMenu(QListViewItem * item)
if(item) {
QPopupMenu m;
m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
m.insertSeparator();
if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1)
m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() ));
else
m.insertItem( tr( "Open / Execute" ), this, SLOT( runThis() ));
m.insertItem( tr( "Open as Text" ), this, SLOT( runText() ));
m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() ));
m.insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() ));
m.insertSeparator();
m.insertItem( tr( "Rename" ), this, SLOT( localRename() ));
m.insertItem( tr( "Copy" ), this, SLOT( copy() ));
m.insertItem( tr( "Copy As" ), this, SLOT( copyAs() ));
m.insertItem( tr( "Move" ), this, SLOT( move() ));
m.insertSeparator();
m.insertItem( tr( "Rescan" ), this, SLOT( populateLocalView() ));
m.insertItem( tr( "Run Command" ), this, SLOT( runCommand() ));
m.insertItem( tr( "File Info" ), this, SLOT( fileStatus() ));
m.insertSeparator();
m.insertItem( tr( "Delete" ), this, SLOT( localDelete() ));
m.insertSeparator();
m.insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() ));
+ if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) //bad hack for Sharp zaurus failings
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::showRemoteMenu(QListViewItem * item)
{
if(item) {
QPopupMenu m;
m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showRemoteHidden() ));
m.insertSeparator();
if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1)
m.insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() ));
else
m.insertItem( tr( "Open / Execute" ), this, SLOT( runThis() ));
m.insertItem( tr( "Open as Text" ), this, SLOT( runText() ));
m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() ));
m.insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() ));
m.insertSeparator();
m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() ));
m.insertItem( tr( "Copy" ), this, SLOT( copy() ));
m.insertItem( tr( "Copy As" ), this, SLOT( copyAs() ));
m.insertItem( tr( "Move" ), this, SLOT( move() ));
m.insertSeparator();
m.insertItem( tr( "Rescan" ), this, SLOT( populateRemoteView() ));
m.insertItem( tr( "Run Command" ), this, SLOT( runCommand() ));
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() ));
+ if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) //bad hack for Sharp zaurus failings
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.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() |
@@ -1035,53 +1037,56 @@ void AdvancedFm::filePerms() {
filePath= currentRemoteDir.canonicalPath()+"/";
}
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
filePermissions *filePerm;
filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it));
filePerm->showMaximized();
filePerm->exec();
if( filePerm)
delete filePerm;
}
if (TabWidget->currentPageIndex() == 0) {
populateLocalView();
} else {
populateRemoteView();
}
}
void AdvancedFm::doProperties() {
QStringList curFileList = getPath();
QString filePath;
if (TabWidget->currentPageIndex() == 0) {
+
filePath = currentDir.canonicalPath()+"/";
} else {
filePath= currentRemoteDir.canonicalPath()+"/";
}
+ // qDebug("%d",curFileList.count());
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
+ qDebug((filePath+*it));
DocLnk lnk( (filePath+*it));
LnkProperties prop( &lnk );
// connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *)));
prop.showMaximized();
prop.exec();
}
}
QStringList AdvancedFm::getPath() {
QStringList strList;
if (TabWidget->currentPageIndex() == 0) {
QList<QListViewItem> * getSelectedItems( QListView * Local_View );
QListViewItemIterator it( Local_View );
for ( ; it.current(); ++it ) {
if ( it.current()->isSelected() ) {
strList << it.current()->text(0);
}
}
return strList;
} else {
QList<QListViewItem> * getSelectedItems( QListView * Remote_View );
QListViewItemIterator it( Remote_View );
for ( ; it.current(); ++it ) {
if ( it.current()->isSelected() ) {