author | llornkcor <llornkcor> | 2004-09-25 04:54:06 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-09-25 04:54:06 (UTC) |
commit | e474ac3ccfb7668eca0de69d42d7d8505f8ae5d8 (patch) (unidiff) | |
tree | e6244b2241099077cd289bd1a0460a58b8515f37 | |
parent | 2b31930ef559a2893f47aa866a706ea13d99a6f5 (diff) | |
download | opie-e474ac3ccfb7668eca0de69d42d7d8505f8ae5d8.zip opie-e474ac3ccfb7668eca0de69d42d7d8505f8ae5d8.tar.gz opie-e474ac3ccfb7668eca0de69d42d7d8505f8ae5d8.tar.bz2 |
unused
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 9cb9aba..3bfec7d 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -316,133 +316,132 @@ void AdvancedFm::fillCombo(const QString ¤tPath) { | |||
316 | if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { | 316 | if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { |
317 | currentPathCombo->clear(); | 317 | currentPathCombo->clear(); |
318 | remoteDirPathStringList.prepend( currentPath ); | 318 | remoteDirPathStringList.prepend( currentPath ); |
319 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); | 319 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); |
320 | } | 320 | } |
321 | } | 321 | } |
322 | } | 322 | } |
323 | 323 | ||
324 | void AdvancedFm::currentPathComboActivated(const QString & currentPath) { | 324 | void AdvancedFm::currentPathComboActivated(const QString & currentPath) { |
325 | chdir( currentPath.latin1() ); | 325 | chdir( currentPath.latin1() ); |
326 | CurrentDir()->cd( currentPath, TRUE); | 326 | CurrentDir()->cd( currentPath, TRUE); |
327 | populateView(); | 327 | populateView(); |
328 | update(); | 328 | update(); |
329 | } | 329 | } |
330 | 330 | ||
331 | QStringList AdvancedFm::getPath() { | 331 | QStringList AdvancedFm::getPath() { |
332 | QStringList strList; | 332 | QStringList strList; |
333 | QListView *thisView=CurrentView(); | 333 | QListView *thisView=CurrentView(); |
334 | QList<QListViewItem> * getSelectedItems( QListView * thisView ); | 334 | QList<QListViewItem> * getSelectedItems( QListView * thisView ); |
335 | QListViewItemIterator it( thisView ); | 335 | QListViewItemIterator it( thisView ); |
336 | for ( ; it.current(); ++it ) { | 336 | for ( ; it.current(); ++it ) { |
337 | if ( it.current()->isSelected() ) { | 337 | if ( it.current()->isSelected() ) { |
338 | strList << it.current()->text(0); | 338 | strList << it.current()->text(0); |
339 | // odebug << it.current()->text(0) << oendl; | 339 | // odebug << it.current()->text(0) << oendl; |
340 | } | 340 | } |
341 | } | 341 | } |
342 | return strList; | 342 | return strList; |
343 | } | 343 | } |
344 | 344 | ||
345 | void AdvancedFm::changeTo(QString dir) { | 345 | void AdvancedFm::changeTo(QString dir) { |
346 | chdir( dir.latin1()); | 346 | chdir( dir.latin1()); |
347 | CurrentDir()->cd(dir, TRUE); | 347 | CurrentDir()->cd(dir, TRUE); |
348 | populateView(); | 348 | populateView(); |
349 | update(); | 349 | update(); |
350 | } | 350 | } |
351 | 351 | ||
352 | void AdvancedFm::homeButtonPushed() { | 352 | void AdvancedFm::homeButtonPushed() { |
353 | changeTo(QDir::homeDirPath()); | 353 | changeTo(QDir::homeDirPath()); |
354 | } | 354 | } |
355 | 355 | ||
356 | void AdvancedFm::docButtonPushed() { | 356 | void AdvancedFm::docButtonPushed() { |
357 | changeTo(QPEApplication::documentDir()); | 357 | changeTo(QPEApplication::documentDir()); |
358 | } | 358 | } |
359 | 359 | ||
360 | void AdvancedFm::SDButtonPushed() { | 360 | void AdvancedFm::SDButtonPushed() { |
361 | changeTo("/mnt/card");// this can change so fix | 361 | changeTo("/mnt/card");// this can change so fix |
362 | } | 362 | } |
363 | 363 | ||
364 | void AdvancedFm::CFButtonPushed() { | 364 | void AdvancedFm::CFButtonPushed() { |
365 | if(zaurusDevice) | 365 | if(zaurusDevice) |
366 | changeTo("/mnt/cf"); //zaurus | 366 | changeTo("/mnt/cf"); //zaurus |
367 | else | 367 | else |
368 | changeTo("/mnt/hda"); //ipaq | 368 | changeTo("/mnt/hda"); //ipaq |
369 | } | 369 | } |
370 | 370 | ||
371 | void AdvancedFm::QPEButtonPushed() { | 371 | void AdvancedFm::QPEButtonPushed() { |
372 | changeTo(QPEApplication::qpeDir()); | 372 | changeTo(QPEApplication::qpeDir()); |
373 | } | 373 | } |
374 | 374 | ||
375 | void AdvancedFm::doAbout() { | 375 | void AdvancedFm::doAbout() { |
376 | QMessageBox::message("AdvancedFm",tr("<P>Advanced FileManager is copyright 2002-2003 by L.J.Potter<llornkcor@handhelds.org> and is licensed by the GPL</P>")); | 376 | QMessageBox::message("AdvancedFm",tr("<P>Advanced FileManager is copyright 2002-2003 by L.J.Potter<llornkcor@handhelds.org> and is licensed by the GPL</P>")); |
377 | } | 377 | } |
378 | 378 | ||
379 | void AdvancedFm::keyPressEvent( QKeyEvent *e) { | 379 | void AdvancedFm::keyPressEvent( QKeyEvent *e) { |
380 | qDebug("keypressevent"); | 380 | Q_UNUSED(e); |
381 | } | 381 | } |
382 | 382 | ||
383 | void AdvancedFm::keyReleaseEvent( QKeyEvent *e) { | 383 | void AdvancedFm::keyReleaseEvent( QKeyEvent *e) { |
384 | qDebug("key release"); | ||
385 | if( CurrentView()->hasFocus() ) | 384 | if( CurrentView()->hasFocus() ) |
386 | e->ignore(); | 385 | e->ignore(); |
387 | if( e->key() == Key_Left ) | 386 | if( e->key() == Key_Left ) |
388 | upDir(); | 387 | upDir(); |
389 | else if( e->key() == Key_Return || e->key() == Key_Enter) | 388 | else if( e->key() == Key_Return || e->key() == Key_Enter) |
390 | navigateToSelected(); | 389 | navigateToSelected(); |
391 | else if( e->key() == Key_Tab) | 390 | else if( e->key() == Key_Tab) |
392 | setOtherTabCurrent(); | 391 | setOtherTabCurrent(); |
393 | else if( e->key() == Key_Delete ) | 392 | else if( e->key() == Key_Delete ) |
394 | del(); | 393 | del(); |
395 | else if( e->key() == Key_A) | 394 | else if( e->key() == Key_A) |
396 | copyAs(); | 395 | copyAs(); |
397 | else if( e->key() == Key_C) | 396 | else if( e->key() == Key_C) |
398 | copy(); | 397 | copy(); |
399 | else if( e->key() == Key_E) | 398 | else if( e->key() == Key_E) |
400 | runThis(); | 399 | runThis(); |
401 | else if( e->key() == Key_G) | 400 | else if( e->key() == Key_G) |
402 | currentPathCombo->lineEdit()->setFocus(); | 401 | currentPathCombo->lineEdit()->setFocus(); |
403 | else if( e->key() == Key_H ) | 402 | else if( e->key() == Key_H ) |
404 | showHidden(); | 403 | showHidden(); |
405 | else if( e->key() == Key_I) | 404 | else if( e->key() == Key_I) |
406 | fileStatus(); | 405 | fileStatus(); |
407 | else if( e->key() == Key_M) | 406 | else if( e->key() == Key_M) |
408 | move(); | 407 | move(); |
409 | else if( e->key() == Key_N ) | 408 | else if( e->key() == Key_N ) |
410 | mkDir(); | 409 | mkDir(); |
411 | else if( e->key() == Key_P) | 410 | else if( e->key() == Key_P) |
412 | filePerms(); | 411 | filePerms(); |
413 | else if( e->key() == Key_R ) | 412 | else if( e->key() == Key_R ) |
414 | rn(); | 413 | rn(); |
415 | else if( e->key() == Key_U ) | 414 | else if( e->key() == Key_U ) |
416 | upDir(); | 415 | upDir(); |
417 | else if( e->key() == Key_1) | 416 | else if( e->key() == Key_1) |
418 | switchToLocalTab(); | 417 | switchToLocalTab(); |
419 | else if( e->key() == Key_2) | 418 | else if( e->key() == Key_2) |
420 | switchToRemoteTab(); | 419 | switchToRemoteTab(); |
421 | else if( e->key() == Key_3) | 420 | else if( e->key() == Key_3) |
422 | CFButtonPushed(); | 421 | CFButtonPushed(); |
423 | else if( e->key() == Key_4) | 422 | else if( e->key() == Key_4) |
424 | SDButtonPushed(); | 423 | SDButtonPushed(); |
425 | else if( e->key() == Key_5 ) | 424 | else if( e->key() == Key_5 ) |
426 | homeButtonPushed(); | 425 | homeButtonPushed(); |
427 | else if( e->key() == Key_6 ) | 426 | else if( e->key() == Key_6 ) |
428 | docButtonPushed(); | 427 | docButtonPushed(); |
429 | else | 428 | else |
430 | e->accept(); | 429 | e->accept(); |
431 | } | 430 | } |
432 | 431 | ||
433 | 432 | ||
434 | void AdvancedFm::parsetab(const QString &fileName) { | 433 | void AdvancedFm::parsetab(const QString &fileName) { |
435 | 434 | ||
436 | fileSystemTypeList.clear(); | 435 | fileSystemTypeList.clear(); |
437 | fsList.clear(); | 436 | fsList.clear(); |
438 | struct mntent *me; | 437 | struct mntent *me; |
439 | FILE *mntfp = setmntent( fileName.latin1(), "r" ); | 438 | FILE *mntfp = setmntent( fileName.latin1(), "r" ); |
440 | if ( mntfp ) { | 439 | if ( mntfp ) { |
441 | while ( (me = getmntent( mntfp )) != 0 ) { | 440 | while ( (me = getmntent( mntfp )) != 0 ) { |
442 | QString deviceName = me->mnt_fsname; | 441 | QString deviceName = me->mnt_fsname; |
443 | QString filesystemType = me->mnt_type; | 442 | QString filesystemType = me->mnt_type; |
444 | QString mountDir = me->mnt_dir; | 443 | QString mountDir = me->mnt_dir; |
445 | if(deviceName != "none") { | 444 | if(deviceName != "none") { |
446 | if( fsList.contains(filesystemType) == 0 | 445 | if( fsList.contains(filesystemType) == 0 |
447 | & filesystemType.find("proc",0,TRUE) == -1 | 446 | & filesystemType.find("proc",0,TRUE) == -1 |
448 | & filesystemType.find("cramfs",0,TRUE) == -1 | 447 | & filesystemType.find("cramfs",0,TRUE) == -1 |
@@ -752,72 +751,73 @@ QListView * AdvancedFm::OtherView() { | |||
752 | void AdvancedFm::setOtherTabCurrent() { | 751 | void AdvancedFm::setOtherTabCurrent() { |
753 | // qDebug("setOtherTabCurrent() %d",whichTab); | 752 | // qDebug("setOtherTabCurrent() %d",whichTab); |
754 | if ( whichTab == 1) { | 753 | if ( whichTab == 1) { |
755 | TabWidget->setCurrentWidget(1); | 754 | TabWidget->setCurrentWidget(1); |
756 | } else { | 755 | } else { |
757 | TabWidget->setCurrentWidget(0); | 756 | TabWidget->setCurrentWidget(0); |
758 | } | 757 | } |
759 | OtherView()->setFocus(); | 758 | OtherView()->setFocus(); |
760 | OtherView()->setSelected( CurrentView()->firstChild(), true); | 759 | OtherView()->setSelected( CurrentView()->firstChild(), true); |
761 | } | 760 | } |
762 | 761 | ||
763 | void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { | 762 | void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { |
764 | // odebug << "qcop message "+msg << oendl; | 763 | // odebug << "qcop message "+msg << oendl; |
765 | QDataStream stream ( data, IO_ReadOnly ); | 764 | QDataStream stream ( data, IO_ReadOnly ); |
766 | if ( msg == "openDirectory(QString)" ) { | 765 | if ( msg == "openDirectory(QString)" ) { |
767 | // odebug << "received" << oendl; | 766 | // odebug << "received" << oendl; |
768 | QString file; | 767 | QString file; |
769 | stream >> file; | 768 | stream >> file; |
770 | gotoDirectory( (const QString &) file); | 769 | gotoDirectory( (const QString &) file); |
771 | } | 770 | } |
772 | } | 771 | } |
773 | 772 | ||
774 | void AdvancedFm::setDocument(const QString &file) { | 773 | void AdvancedFm::setDocument(const QString &file) { |
775 | gotoDirectory( file); | 774 | gotoDirectory( file); |
776 | 775 | ||
777 | } | 776 | } |
778 | 777 | ||
779 | void AdvancedFm::gotoDirectory(const QString &file) { | 778 | void AdvancedFm::gotoDirectory(const QString &file) { |
780 | // qDebug("goto dir "+file); | 779 | // qDebug("goto dir "+file); |
781 | QString curDir = file; | 780 | QString curDir = file; |
782 | QDir *thisDir = CurrentDir(); | 781 | QDir *thisDir = CurrentDir(); |
783 | if(QDir( curDir).exists() ) { | 782 | if(QDir( curDir).exists() ) { |
784 | thisDir->setPath( curDir ); | 783 | thisDir->setPath( curDir ); |
785 | chdir( curDir.latin1() ); | 784 | chdir( curDir.latin1() ); |
786 | thisDir->cd( curDir, TRUE); | 785 | thisDir->cd( curDir, TRUE); |
787 | populateView(); | 786 | populateView(); |
788 | } | 787 | } |
789 | else if(QFileInfo(curDir).exists()) { | 788 | else if(QFileInfo(curDir).exists()) { |
790 | QFileInfo fileInfo(curDir); | 789 | QFileInfo fileInfo(curDir); |
791 | curDir=fileInfo.dirPath(); | 790 | curDir=fileInfo.dirPath(); |
792 | if(QDir( curDir).exists() ) { | 791 | if(QDir( curDir).exists() ) { |
793 | thisDir->setPath( curDir ); | 792 | thisDir->setPath( curDir ); |
794 | chdir( curDir.latin1() ); | 793 | chdir( curDir.latin1() ); |
795 | thisDir->cd( curDir, TRUE); | 794 | thisDir->cd( curDir, TRUE); |
796 | populateView(); | 795 | populateView(); |
797 | } | 796 | } |
798 | findFile(file); | 797 | findFile(file); |
799 | } | 798 | } |
800 | 799 | ||
801 | } | 800 | } |
802 | 801 | ||
803 | void AdvancedFm::findFile(const QString &fileName) { | 802 | void AdvancedFm::findFile(const QString &fileName) { |
804 | QFileInfo fi(fileName); | 803 | QFileInfo fi(fileName); |
805 | QListView *thisView = CurrentView(); | 804 | QListView *thisView = CurrentView(); |
806 | QListViewItemIterator it( thisView ); | 805 | QListViewItemIterator it( thisView ); |
807 | for ( ; it.current(); ++it ) { | 806 | for ( ; it.current(); ++it ) { |
808 | if(it.current()->text(0) == fi.fileName()) { | 807 | if(it.current()->text(0) == fi.fileName()) { |
809 | it.current()->setSelected(true); | 808 | it.current()->setSelected(true); |
810 | thisView->ensureItemVisible(it.current()); | 809 | thisView->ensureItemVisible(it.current()); |
811 | } | 810 | } |
812 | } | 811 | } |
813 | } | 812 | } |
814 | 813 | ||
815 | void AdvancedFm::slotSwitchMenu(int item) { | 814 | void AdvancedFm::slotSwitchMenu(int item) { |
815 | Q_UNUSED(item); | ||
816 | // qDebug( "Switch %d",item); | 816 | // qDebug( "Switch %d",item); |
817 | // viewMenu->setItemChecked(item, true); | 817 | // viewMenu->setItemChecked(item, true); |
818 | } | 818 | } |
819 | 819 | ||
820 | void AdvancedFm::navigateToSelected() { | 820 | void AdvancedFm::navigateToSelected() { |
821 | if( !CurrentView()->currentItem()) return; | 821 | if( !CurrentView()->currentItem()) return; |
822 | doDirChange(); | 822 | doDirChange(); |
823 | } | 823 | } |