summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp3
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp9
2 files changed, 6 insertions, 6 deletions
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index a120f35..45dc0c4 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -214,36 +214,37 @@ void AdvancedFm::init() {
214 } 214 }
215 215
216 if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { 216 if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) {
217 qDebug("not have sd"); 217 qDebug("not have sd");
218 sdButton->hide(); 218 sdButton->hide();
219 } 219 }
220 if( !StorageInfo::hasCf() ) { 220 if( !StorageInfo::hasCf() ) {
221 qDebug("not have cf"); 221 qDebug("not have cf");
222 cfButton->hide(); 222 cfButton->hide();
223 } 223 }
224 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 224 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
225 currentDir.setPath( QDir::currentDirPath()); 225 currentDir.setPath( QDir::currentDirPath());
226 226
227 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 227 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
228 currentRemoteDir.setPath( QDir::currentDirPath()); 228 currentRemoteDir.setPath( QDir::currentDirPath());
229 229
230 b = TRUE; 230 // b = TRUE;
231 231
232 filterStr="*"; 232 filterStr="*";
233 b=FALSE; 233 b=FALSE;
234 showMenuHidden();
234 TabWidget->setCurrentTab(0); 235 TabWidget->setCurrentTab(0);
235 236
236} 237}
237 238
238void AdvancedFm::initConnections() 239void AdvancedFm::initConnections()
239{ 240{
240 241
241 connect( qApp,SIGNAL( aboutToQuit()), 242 connect( qApp,SIGNAL( aboutToQuit()),
242 this, SLOT( cleanUp()) ); 243 this, SLOT( cleanUp()) );
243 connect( qpeDirButton ,SIGNAL(released()), 244 connect( qpeDirButton ,SIGNAL(released()),
244 this,SLOT( QPEButtonPushed()) ); 245 this,SLOT( QPEButtonPushed()) );
245 connect( cfButton ,SIGNAL(released()), 246 connect( cfButton ,SIGNAL(released()),
246 this,SLOT( CFButtonPushed()) ); 247 this,SLOT( CFButtonPushed()) );
247 connect( sdButton ,SIGNAL(released()), 248 connect( sdButton ,SIGNAL(released()),
248 this,SLOT( SDButtonPushed()) ); 249 this,SLOT( SDButtonPushed()) );
249 connect( cdUpButton ,SIGNAL(released()), 250 connect( cdUpButton ,SIGNAL(released()),
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 00d0e07..544350c 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -21,33 +21,32 @@
21#include <qpe/resource.h> 21#include <qpe/resource.h>
22#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
23#include <qpe/applnk.h> 23#include <qpe/applnk.h>
24#include <qpe/ir.h> 24#include <qpe/ir.h>
25 25
26#include <qmessagebox.h> 26#include <qmessagebox.h>
27#include <qmultilineedit.h> 27#include <qmultilineedit.h>
28 28
29#include <qstring.h> 29#include <qstring.h>
30 30
31#include <qlayout.h> 31#include <qlayout.h>
32#include <qpixmap.h> 32#include <qpixmap.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qpopupmenu.h> 34#include <qpopupmenu.h>
35#include <qtabwidget.h> 35#include <qtabwidget.h>
36#include <qtoolbutton.h> 36#include <qtoolbutton.h>
37#include <qtabwidget.h>
38#include <qlineedit.h> 37#include <qlineedit.h>
39#include <qlistview.h> 38#include <qlistview.h>
40 39
41#include <errno.h> 40#include <errno.h>
42#include <stdlib.h> 41#include <stdlib.h>
43#include <unistd.h> 42#include <unistd.h>
44#include <sys/stat.h> 43#include <sys/stat.h>
45#include <dirent.h> 44#include <dirent.h>
46#include <sys/sendfile.h> 45#include <sys/sendfile.h>
47#include <fcntl.h> 46#include <fcntl.h>
48 47
49 48
50void AdvancedFm::doDirChange() 49void AdvancedFm::doDirChange()
51{ 50{
52 ListClicked( CurrentView()->currentItem()); 51 ListClicked( CurrentView()->currentItem());
53} 52}
@@ -58,33 +57,33 @@ void AdvancedFm::showMenuHidden()
58 { 57 {
59 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 58 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
60 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 59 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
61 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); 60 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
62// b=FALSE; 61// b=FALSE;
63 62
64 } 63 }
65 else 64 else
66 { 65 {
67 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 66 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
68 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 67 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
69 fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); 68 fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
70// b=TRUE; 69// b=TRUE;
71 } 70 }
72 rePopulate(); 71 rePopulate();
73// if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); 72// if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true");
74 if(b) b = false; else b = true; 73 b = !b;
75} 74}
76 75
77void AdvancedFm::showHidden() 76void AdvancedFm::showHidden()
78{ 77{
79 if (b) 78 if (b)
80 { 79 {
81 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 80 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
82 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 81 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
83// fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); 82// fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
84// b=FALSE; 83// b=FALSE;
85 84
86 } 85 }
87 else 86 else
88 { 87 {
89 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 88 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
90 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 89 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
@@ -507,35 +506,35 @@ void AdvancedFm::move()
507 if(curFile.right(1).find("/",0,TRUE) == -1) 506 if(curFile.right(1).find("/",0,TRUE) == -1)
508 curFile +="/"; 507 curFile +="/";
509 curFile+= item; 508 curFile+= item;
510 qDebug("CurrentFile file is " + curFile); 509 qDebug("CurrentFile file is " + curFile);
511 510
512 QFile f( curFile); 511 QFile f( curFile);
513 if( f.exists()) { 512 if( f.exists()) {
514 if( !copyFile( curFile, destFile) ) { 513 if( !copyFile( curFile, destFile) ) {
515 QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile); 514 QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile);
516 return; 515 return;
517 } else 516 } else
518 QFile::remove(curFile); 517 QFile::remove(curFile);
519 } 518 }
520 } 519 }
521 520
522 } 521 }
523 setOtherTabCurrent(); 522 populateView();
524 populateView(); 523 setOtherTabCurrent();
525// populateLocalView(); 524 populateView();
526} 525}
527 526
528bool AdvancedFm::copyFile( const QString & src, const QString & dest ) 527bool AdvancedFm::copyFile( const QString & src, const QString & dest )
529{ 528{
530 bool success = true; 529 bool success = true;
531 struct stat status; 530 struct stat status;
532 QFile srcFile(src); 531 QFile srcFile(src);
533 QFile destFile(dest); 532 QFile destFile(dest);
534 int err=0; 533 int err=0;
535 int read_fd=0; 534 int read_fd=0;
536 int write_fd=0; 535 int write_fd=0;
537 struct stat stat_buf; 536 struct stat stat_buf;
538 off_t offset = 0; 537 off_t offset = 0;
539 if(!srcFile.open( IO_ReadOnly|IO_Raw)) { 538 if(!srcFile.open( IO_ReadOnly|IO_Raw)) {
540 qWarning("open failed"); 539 qWarning("open failed");
541 return success = false; 540 return success = false;