summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp34
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp18
2 files changed, 26 insertions, 26 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index fc6c3bf..d56e746 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -265,49 +265,48 @@ void AdvancedFm::ListClicked(QListViewItem *selectedItem)
265 { 265 {
266 266
267 if(QDir(strItem).exists()) 267 if(QDir(strItem).exists())
268 isDirectory = true; 268 isDirectory = true;
269 } 269 }
270 270
271 if( isDirectory ) 271 if( isDirectory )
272 { 272 {
273 CurrentDir()->cd( strItem, TRUE); 273 CurrentDir()->cd( strItem, TRUE);
274 populateView(); 274 populateView();
275 CurrentView()->ensureItemVisible( CurrentView()->firstChild()); 275 CurrentView()->ensureItemVisible( CurrentView()->firstChild());
276 } 276 }
277 chdir( strItem.latin1()); 277 chdir( strItem.latin1());
278 } 278 }
279} 279}
280 280
281void AdvancedFm::ListPressed( int mouse, QListViewItem *, const QPoint& , int ) { 281void AdvancedFm::ListPressed( int mouse, QListViewItem *, const QPoint& , int ) {
282 switch (mouse) { 282 switch (mouse) {
283 case 1: 283 case 1:
284 { 284 {
285 if(renameBox != 0 ) 285 if(renameBox != 0 )
286 { 286 {
287 cancelRename(); 287 cancelRename();
288 } 288 }
289
290 } 289 }
291 break; 290 break;
292 case 2: 291 case 2:
293 menuTimer.start( 500, TRUE ); 292 menuTimer.start( 500, TRUE );
294 break; 293 break;
295 }; 294 };
296} 295}
297 296
298void AdvancedFm::switchToLocalTab() 297void AdvancedFm::switchToLocalTab()
299{ 298{
300 TabWidget->setCurrentTab(0); 299 TabWidget->setCurrentTab(0);
301 Local_View->setFocus(); 300 Local_View->setFocus();
302} 301}
303 302
304void AdvancedFm::switchToRemoteTab() 303void AdvancedFm::switchToRemoteTab()
305{ 304{
306 TabWidget->setCurrentTab(1); 305 TabWidget->setCurrentTab(1);
307 Remote_View->setFocus(); 306 Remote_View->setFocus();
308} 307}
309 308
310void AdvancedFm::readConfig() 309void AdvancedFm::readConfig()
311{ 310{
312 Config cfg("AdvancedFm"); 311 Config cfg("AdvancedFm");
313} 312}
@@ -346,97 +345,95 @@ void AdvancedFm::fillCombo(const QString &currentPath)
346 else 345 else
347 { 346 {
348 currentPathCombo->lineEdit()->setText( currentPath); 347 currentPathCombo->lineEdit()->setText( currentPath);
349 if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) 348 if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() )
350 { 349 {
351 currentPathCombo->clear(); 350 currentPathCombo->clear();
352 remoteDirPathStringList.prepend( currentPath ); 351 remoteDirPathStringList.prepend( currentPath );
353 currentPathCombo->insertStringList( remoteDirPathStringList,-1); 352 currentPathCombo->insertStringList( remoteDirPathStringList,-1);
354 } 353 }
355 } 354 }
356} 355}
357 356
358void AdvancedFm::currentPathComboActivated(const QString & currentPath) 357void AdvancedFm::currentPathComboActivated(const QString & currentPath)
359{ 358{
360 chdir( currentPath.latin1() ); 359 chdir( currentPath.latin1() );
361 CurrentDir()->cd( currentPath, TRUE); 360 CurrentDir()->cd( currentPath, TRUE);
362 populateView(); 361 populateView();
363 update(); 362 update();
364} 363}
365 364
366QStringList AdvancedFm::getPath() 365QStringList AdvancedFm::getPath()
367{ 366{
368 QStringList strList; 367 QStringList strList;
369 QListView *thisView=CurrentView(); 368 QListView *thisView=CurrentView();
370 QList<QListViewItem> * getSelectedItems( QListView * thisView ); 369 QList<QListViewItem> * getSelectedItems( QListView * thisView );
371 QListViewItemIterator it( thisView ); 370 QListViewItemIterator it( thisView );
372 for ( ; it.current(); ++it ) 371 for ( ; it.current(); ++it )
373 { 372 {
374 if ( it.current()->isSelected() ) 373 if ( it.current()->isSelected() )
375 { 374 {
376 strList << it.current()->text(0); 375 strList << it.current()->text(0);
377// qDebug(it.current()->text(0)); 376// qDebug(it.current()->text(0));
378 } 377 }
379 } 378 }
380 return strList; 379 return strList;
381} 380}
382 381
383void AdvancedFm::homeButtonPushed() 382void AdvancedFm::homeButtonPushed()
384{ 383{
385 QString current = QDir::homeDirPath(); 384 QString current = QDir::homeDirPath();
386 chdir( current.latin1() ); 385 chdir( current.latin1() );
387 CurrentDir()->cd( current, TRUE); 386 CurrentDir()->cd( current, TRUE);
388 populateView(); 387 populateView();
389 update(); 388 update();
390} 389}
391 390
392void AdvancedFm::docButtonPushed() 391void AdvancedFm::docButtonPushed()
393{ 392{
394 QString current = QPEApplication::documentDir(); 393 QString current = QPEApplication::documentDir();
395 chdir( current.latin1() ); 394 chdir( current.latin1() );
396 395 CurrentDir()->cd( current, TRUE);
397 CurrentDir()->cd( current, TRUE); 396 populateView();
398 populateView();
399 update(); 397 update();
400} 398}
401 399
402void AdvancedFm::SDButtonPushed() 400void AdvancedFm::SDButtonPushed()
403{ 401{
404 QString current = "/mnt/card";// this can change so fix 402 QString current = "/mnt/card";// this can change so fix
405 chdir( current.latin1() ); 403 chdir( current.latin1() );
406 CurrentDir()->cd( current, TRUE); 404 CurrentDir()->cd( current, TRUE);
407 populateView(); 405 populateView();
408 update(); 406 update();
409} 407}
410 408
411void AdvancedFm::CFButtonPushed() 409void AdvancedFm::CFButtonPushed()
412{ 410{
413 QString current; 411 QString current;
414 if(zaurusDevice) 412 if(zaurusDevice)
415 current= "/mnt/cf"; //zaurus 413 current= "/mnt/cf"; //zaurus
416 else 414 else
417 current = "/mnt/hda"; //ipaq 415 current = "/mnt/hda"; //ipaq
418
419 chdir( current.latin1() ); 416 chdir( current.latin1() );
420 CurrentDir()->cd( current, TRUE); 417 CurrentDir()->cd( current, TRUE);
421 populateView(); 418 populateView();
422 update(); 419 update();
423} 420}
424 421
425 422
426void AdvancedFm::doAbout() 423void AdvancedFm::doAbout()
427{ 424{
428 QMessageBox::message("AdvancedFm",tr("Advanced FileManager\n" 425 QMessageBox::message("AdvancedFm",tr("Advanced FileManager\n"
429 "is copyright 2002-2003 by\n" 426 "is copyright 2002-2003 by\n"
430 "L.J.Potter<llornkcor@handhelds.org>\n" 427 "L.J.Potter<llornkcor@handhelds.org>\n"
431 "and is licensed by the GPL")); 428 "and is licensed by the GPL"));
432} 429}
433 430
434void AdvancedFm::keyPressEvent( QKeyEvent *e) 431void AdvancedFm::keyPressEvent( QKeyEvent *e)
435{ 432{
436// e->accept(); 433// e->accept();
437 if( CurrentView()->hasFocus() ) 434 if( CurrentView()->hasFocus() )
438 { 435 {
439 switch ( e->key() ) { 436 switch ( e->key() ) {
440 case Key_Delete: 437 case Key_Delete:
441 del(); 438 del();
442 break; 439 break;
@@ -766,49 +763,50 @@ void AdvancedFm::addCustomDir()
766 { 763 {
767 menuButton->insertItem(dir); 764 menuButton->insertItem(dir);
768// customDirMenu->insertItem(dir); 765// customDirMenu->insertItem(dir);
769 list << dir; 766 list << dir;
770 } 767 }
771 768
772 cfg.writeEntry("CustomDir", list, ','); 769 cfg.writeEntry("CustomDir", list, ',');
773 cfg.write(); 770 cfg.write();
774} 771}
775 772
776void AdvancedFm::removeCustomDir() 773void AdvancedFm::removeCustomDir()
777{ 774{
778// qDebug("remove custom dir"); 775// qDebug("remove custom dir");
779 Config cfg("AdvancedFm"); 776 Config cfg("AdvancedFm");
780 cfg.setGroup("Menu"); 777 cfg.setGroup("Menu");
781 QString dir; 778 QString dir;
782 QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); 779 QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)',');
783 QStringList list2; 780 QStringList list2;
784 dir = CurrentDir()->canonicalPath(); 781 dir = CurrentDir()->canonicalPath();
785 int ramble=2; 782 int ramble=2;
786// int ramble=-24; 783// int ramble=-24;
787//first remove list 784//first remove list
788 if(list.grep(dir,true).isEmpty()) 785 if(list.grep(dir,true).isEmpty())
789 { 786 {
790 QMessageBox::message("AdvancedFm",tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!!")); 787 QMessageBox::message("AdvancedFm",
788 tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!!"));
791 } 789 }
792 else 790 else
793 { 791 {
794 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) 792 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
795 { 793 {
796 if((*it) != dir)//current item is not our current dir, so add it to temp list 794 if((*it) != dir)//current item is not our current dir, so add it to temp list
797 { 795 {
798 list2 <<(*it); 796 list2 <<(*it);
799 } 797 }
800 else 798 else
801 { 799 {
802// customDirMenu->removeItem( ramble); 800// customDirMenu->removeItem( ramble);
803 menuButton->remove( ramble); 801 menuButton->remove( ramble);
804 802
805 } 803 }
806 ramble++; 804 ramble++;
807// ramble--; 805// ramble--;
808 } 806 }
809 807
810 cfg.writeEntry("CustomDir", list2, ','); 808 cfg.writeEntry("CustomDir", list2, ',');
811 cfg.write(); 809 cfg.write();
812 } 810 }
813// customDirsToMenu(); 811// customDirsToMenu();
814 812
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index c553017..062a013 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -34,79 +34,81 @@
34#include <qpixmap.h> 34#include <qpixmap.h>
35#include <qcombobox.h> 35#include <qcombobox.h>
36#include <qpopupmenu.h> 36#include <qpopupmenu.h>
37#include <qtabwidget.h> 37#include <qtabwidget.h>
38#include <qtoolbutton.h> 38#include <qtoolbutton.h>
39#include <qtabwidget.h> 39#include <qtabwidget.h>
40#include <qlineedit.h> 40#include <qlineedit.h>
41#include <qlistview.h> 41#include <qlistview.h>
42 42
43#include <stdlib.h> 43#include <stdlib.h>
44#include <unistd.h> 44#include <unistd.h>
45#include <sys/stat.h> 45#include <sys/stat.h>
46#include <dirent.h> 46#include <dirent.h>
47 47
48 48
49void AdvancedFm::doDirChange() 49void AdvancedFm::doDirChange()
50{ 50{
51 ListClicked( CurrentView()->currentItem()); 51 ListClicked( CurrentView()->currentItem());
52} 52}
53 53
54void AdvancedFm::showMenuHidden() 54void AdvancedFm::showMenuHidden()
55{ 55{
56 if (b) 56 if (b)
57 { 57 {
58 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 58 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
59 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 59 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
60 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); 60 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
61// b=FALSE; 61// b=FALSE;
62 62
63 } 63 }
64 else 64 else
65 { 65 {
66 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 66 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
67 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 67 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
68 fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); 68 fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
69// b=TRUE; 69// b=TRUE;
70 } 70 }
71 populateView(); 71 populateView();
72// populateRemoteView(); 72// populateRemoteView();
73// if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); 73// if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true");
74 if(b) b = false; else b = true; 74 if(b) b = false; else b = true;
75} 75}
76 76
77void AdvancedFm::showHidden() 77void AdvancedFm::showHidden()
78{ 78{
79 if (b) 79 if (b)
80 { 80 {
81 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 81 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
82 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
82// fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); 83// fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
83// b=FALSE; 84// b=FALSE;
84 85
85 } 86 }
86 else 87 else
87 { 88 {
88 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 89 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
90 s OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
89// fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); 91// fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
90// b=TRUE; 92// b=TRUE;
91 } 93 }
92 populateView(); 94 populateView();
93} 95}
94 96
95QString AdvancedFm::dealWithSymName(const QString &fileName) 97QString AdvancedFm::dealWithSymName(const QString &fileName)
96{ 98{
97 QString strItem = fileName; 99 QString strItem = fileName;
98 return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); 100 return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
99} 101}
100 102
101void AdvancedFm::runThis() 103void AdvancedFm::runThis()
102{ 104{
103 QString fs; 105 QString fs;
104 QDir *thisDir = CurrentDir(); 106 QDir *thisDir = CurrentDir();
105 107
106 QString curFile = CurrentView()->currentItem()->text(0); 108 QString curFile = CurrentView()->currentItem()->text(0);
107 QString path = thisDir->canonicalPath(); 109 QString path = thisDir->canonicalPath();
108 110
109 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink 111 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink
110 112
111 curFile = dealWithSymName((const QString&)curFile); 113 curFile = dealWithSymName((const QString&)curFile);
112 114