author | llornkcor <llornkcor> | 2002-08-06 14:42:54 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-06 14:42:54 (UTC) |
commit | e6a512dc2e0602298f8a745036d25eb171ced977 (patch) (side-by-side diff) | |
tree | 38a1df282028ac69fba494dba2ca41d04e565a54 | |
parent | 64888e9cd2f4c8f40f08a6712e2fd27220ff14ad (diff) | |
download | opie-e6a512dc2e0602298f8a745036d25eb171ced977.zip opie-e6a512dc2e0602298f8a745036d25eb171ced977.tar.gz opie-e6a512dc2e0602298f8a745036d25eb171ced977.tar.bz2 |
fixed proper path for familiar cf, and hide sd for non zaurus
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 39 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 1 |
2 files changed, 29 insertions, 11 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 7ee78c0..0f2555d 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -67,16 +67,17 @@ #include <stdio.h> #include <time.h> #include <fcntl.h> #include <mntent.h> #include <string.h> #include <errno.h> #include <sys/vfs.h> #include <mntent.h> +#include <sys/utsname.h> AdvancedFm::AdvancedFm( ) : QMainWindow( ) { setCaption( tr( "AdvancedFm" ) ); QGridLayout *layout = new QGridLayout( this ); layout->setSpacing( 2); @@ -242,17 +243,28 @@ AdvancedFm::AdvancedFm( ) tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); TabWidget->insertTab( tab_3, tr( "Remote" ) ); */ /////////////// - + + struct utsname name; /* check for embedix kernel running on the zaurus*/ + if (uname(&name) != -1) { + QString release=name.release; + if(release.find("embedix",0,TRUE) !=-1) { + zaurusDevice=TRUE; + } else { + zaurusDevice=FALSE; + sdButton->hide(); + } + } + currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); currentDir.setPath( QDir::currentDirPath()); currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); currentRemoteDir.setPath( QDir::currentDirPath()); b = TRUE; @@ -1057,26 +1069,31 @@ void AdvancedFm::SDButtonPushed() { currentRemoteDir.cd( current, TRUE); populateRemoteView(); } update(); } void AdvancedFm::CFButtonPushed() { - QString current = "/mnt/cf"; - chdir( current.latin1() ); - if (TabWidget->currentPageIndex() == 0) { - currentDir.cd( current, TRUE); - populateLocalView(); - } else { - currentRemoteDir.cd( current, TRUE); - populateRemoteView(); - } - update(); + QString current; + if(zaurusDevice) + current= "/mnt/cf"; + else + current = "/mnt/hda"; + + chdir( current.latin1() ); + if (TabWidget->currentPageIndex() == 0) { + currentDir.cd( current, TRUE); + populateLocalView(); + } else { + currentRemoteDir.cd( current, TRUE); + populateRemoteView(); + } + update(); } void AdvancedFm::upDir() { if (TabWidget->currentPageIndex() == 0) { QString current = currentDir.canonicalPath(); diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 78f0bad..5b714ae 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h @@ -100,16 +100,17 @@ protected slots: void runCommand(); void runCommandStd(); QStringList getPath(); void mkSym(); void switchToLocalTab(); void switchToRemoteTab(); protected: + bool zaurusDevice; QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; QStringList remoteDirPathStringList, localDirPathStringList; void keyReleaseEvent( QKeyEvent *); QString getFileSystemType(const QString &); QString getDiskSpace(const QString &); void parsetab(const QString &fileName); |