summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp39
-rw-r--r--noncore/apps/advancedfm/advancedfm.h1
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
@@ -69,12 +69,13 @@
69#include <fcntl.h> 69#include <fcntl.h>
70#include <mntent.h> 70#include <mntent.h>
71#include <string.h> 71#include <string.h>
72#include <errno.h> 72#include <errno.h>
73#include <sys/vfs.h> 73#include <sys/vfs.h>
74#include <mntent.h> 74#include <mntent.h>
75#include <sys/utsname.h>
75 76
76AdvancedFm::AdvancedFm( ) 77AdvancedFm::AdvancedFm( )
77 : QMainWindow( ) 78 : QMainWindow( )
78{ 79{
79 setCaption( tr( "AdvancedFm" ) ); 80 setCaption( tr( "AdvancedFm" ) );
80 81
@@ -244,13 +245,24 @@ AdvancedFm::AdvancedFm( )
244 tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); 245 tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 );
245 246
246 TabWidget->insertTab( tab_3, tr( "Remote" ) ); 247 TabWidget->insertTab( tab_3, tr( "Remote" ) );
247 */ 248 */
248 249
249 /////////////// 250 ///////////////
250 251
252 struct utsname name; /* check for embedix kernel running on the zaurus*/
253 if (uname(&name) != -1) {
254 QString release=name.release;
255 if(release.find("embedix",0,TRUE) !=-1) {
256 zaurusDevice=TRUE;
257 } else {
258 zaurusDevice=FALSE;
259 sdButton->hide();
260 }
261 }
262
251 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 263 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
252 currentDir.setPath( QDir::currentDirPath()); 264 currentDir.setPath( QDir::currentDirPath());
253 265
254 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 266 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
255 currentRemoteDir.setPath( QDir::currentDirPath()); 267 currentRemoteDir.setPath( QDir::currentDirPath());
256 268
@@ -1059,22 +1071,27 @@ void AdvancedFm::SDButtonPushed() {
1059 } 1071 }
1060 update(); 1072 update();
1061 1073
1062} 1074}
1063 1075
1064void AdvancedFm::CFButtonPushed() { 1076void AdvancedFm::CFButtonPushed() {
1065 QString current = "/mnt/cf"; 1077 QString current;
1066 chdir( current.latin1() ); 1078 if(zaurusDevice)
1067 if (TabWidget->currentPageIndex() == 0) { 1079 current= "/mnt/cf";
1068 currentDir.cd( current, TRUE); 1080 else
1069 populateLocalView(); 1081 current = "/mnt/hda";
1070 } else { 1082
1071 currentRemoteDir.cd( current, TRUE); 1083 chdir( current.latin1() );
1072 populateRemoteView(); 1084 if (TabWidget->currentPageIndex() == 0) {
1073 } 1085 currentDir.cd( current, TRUE);
1074 update(); 1086 populateLocalView();
1087 } else {
1088 currentRemoteDir.cd( current, TRUE);
1089 populateRemoteView();
1090 }
1091 update();
1075 1092
1076} 1093}
1077 1094
1078 1095
1079void AdvancedFm::upDir() 1096void AdvancedFm::upDir()
1080{ 1097{
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
@@ -102,12 +102,13 @@ protected slots:
102 QStringList getPath(); 102 QStringList getPath();
103 void mkSym(); 103 void mkSym();
104 void switchToLocalTab(); 104 void switchToLocalTab();
105 void switchToRemoteTab(); 105 void switchToRemoteTab();
106 106
107protected: 107protected:
108 bool zaurusDevice;
108 QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; 109 QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3;
109 QStringList remoteDirPathStringList, localDirPathStringList; 110 QStringList remoteDirPathStringList, localDirPathStringList;
110 111
111 void keyReleaseEvent( QKeyEvent *); 112 void keyReleaseEvent( QKeyEvent *);
112 QString getFileSystemType(const QString &); 113 QString getFileSystemType(const QString &);
113 QString getDiskSpace(const QString &); 114 QString getDiskSpace(const QString &);