summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-06-03 18:16:49 (UTC)
committer llornkcor <llornkcor>2002-06-03 18:16:49 (UTC)
commit8d5f42d770abca69d490774f4b1fc8284e7a86be (patch) (unidiff)
treebb40659658517007ddbab1044a376618ee897e8f
parentd068b0a50826a189d11e2f2037ee21a4c0850567 (diff)
downloadopie-8d5f42d770abca69d490774f4b1fc8284e7a86be.zip
opie-8d5f42d770abca69d490774f4b1fc8284e7a86be.tar.gz
opie-8d5f42d770abca69d490774f4b1fc8284e7a86be.tar.bz2
fixed bug with opening in app
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 869a433..a000e9b 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -1596,158 +1596,158 @@ void AdvancedFm::parsetab(const QString &fileName) {
1596 fileSystemTypeList << mountDir+"::"+filesystemType; 1596 fileSystemTypeList << mountDir+"::"+filesystemType;
1597 } 1597 }
1598 } 1598 }
1599 } 1599 }
1600 endmntent( mntfp ); 1600 endmntent( mntfp );
1601} 1601}
1602 1602
1603QString AdvancedFm::getFileSystemType(const QString &currentText) { 1603QString AdvancedFm::getFileSystemType(const QString &currentText) {
1604 parsetab("/etc/mtab"); //why did TT forget filesystem type? 1604 parsetab("/etc/mtab"); //why did TT forget filesystem type?
1605 QString current = currentText;//.right( currentText.length()-1); 1605 QString current = currentText;//.right( currentText.length()-1);
1606 QString baseFs; 1606 QString baseFs;
1607 for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it ) { 1607 for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it ) {
1608 QString temp = (*it); 1608 QString temp = (*it);
1609 QString path = temp.left(temp.find("::",0,TRUE) ); 1609 QString path = temp.left(temp.find("::",0,TRUE) );
1610 path = path.right( path.length()-1); 1610 path = path.right( path.length()-1);
1611 if(path.isEmpty()) baseFs = temp.right( temp.length() - temp.find("::",0,TRUE) - 2); 1611 if(path.isEmpty()) baseFs = temp.right( temp.length() - temp.find("::",0,TRUE) - 2);
1612 if( current.find( path,0,TRUE) != -1 && !path.isEmpty()) { 1612 if( current.find( path,0,TRUE) != -1 && !path.isEmpty()) {
1613 return temp.right( temp.length() - temp.find("::",0,TRUE) - 2); 1613 return temp.right( temp.length() - temp.find("::",0,TRUE) - 2);
1614 } 1614 }
1615 } 1615 }
1616 return baseFs; 1616 return baseFs;
1617} 1617}
1618 1618
1619 1619
1620void AdvancedFm::doBeam() { 1620void AdvancedFm::doBeam() {
1621 Ir ir; 1621 Ir ir;
1622 if(!ir.supported()){ 1622 if(!ir.supported()){
1623 } else { 1623 } else {
1624 1624
1625 QStringList curFileList = getPath(); 1625 QStringList curFileList = getPath();
1626 if( curFileList.count() > 0) { 1626 if( curFileList.count() > 0) {
1627 1627
1628 if (TabWidget->currentPageIndex() == 0) { 1628 if (TabWidget->currentPageIndex() == 0) {
1629 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 1629 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
1630 1630
1631 QString curFile = currentDir.canonicalPath()+"/"+(*it); 1631 QString curFile = currentDir.canonicalPath()+"/"+(*it);
1632 if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); 1632 if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1);
1633 Ir *file = new Ir(this, "IR"); 1633 Ir *file = new Ir(this, "IR");
1634 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); 1634 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * )));
1635 file->send( curFile, curFile ); 1635 file->send( curFile, curFile );
1636 } 1636 }
1637 1637
1638 } else { 1638 } else {
1639 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 1639 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
1640 1640
1641 QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it); 1641 QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it);
1642 if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); 1642 if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1);
1643 Ir *file = new Ir(this, "IR"); 1643 Ir *file = new Ir(this, "IR");
1644 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); 1644 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * )));
1645 file->send( curFile, curFile ); 1645 file->send( curFile, curFile );
1646 1646
1647 } 1647 }
1648 } 1648 }
1649 } 1649 }
1650} 1650}
1651 1651
1652} 1652}
1653 1653
1654void AdvancedFm::fileBeamFinished( Ir *ir) { 1654void AdvancedFm::fileBeamFinished( Ir *ir) {
1655 QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); 1655 QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") );
1656 1656
1657} 1657}
1658 1658
1659 1659
1660// QList<QListViewItem> * getSelectedItems( QListView * Local_View ); 1660// QList<QListViewItem> * getSelectedItems( QListView * Local_View );
1661// QListViewItemIterator it( Local_View ); 1661// QListViewItemIterator it( Local_View );
1662// for ( ; it.current(); ++it ) { 1662// for ( ; it.current(); ++it ) {
1663// if ( it.current()->isSelected() ) { 1663// if ( it.current()->isSelected() ) {
1664// QString strItem = it.current()->text(0); 1664// QString strItem = it.current()->text(0);
1665// QString localFile = currentDir.canonicalPath()+"/"+strItem; 1665// QString localFile = currentDir.canonicalPath()+"/"+strItem;
1666// QFileInfo fi(localFile); 1666// QFileInfo fi(localFile);
1667// } 1667// }
1668// } 1668// }
1669 1669
1670void AdvancedFm::showFileMenu() { 1670void AdvancedFm::showFileMenu() {
1671 QString curApp; 1671 QString curApp;
1672 bool isLocalView = false; 1672 bool isLocalView = false;
1673 if (TabWidget->currentPageIndex() == 0) { 1673 if (TabWidget->currentPageIndex() == 0) {
1674 isLocalView = TRUE; 1674 isLocalView = TRUE;
1675 curApp = Local_View->currentItem()->text(0); 1675 curApp = Local_View->currentItem()->text(0);
1676 } else { 1676 } else {
1677 curApp = Remote_View->currentItem()->text(0); 1677 curApp = Remote_View->currentItem()->text(0);
1678 } 1678 }
1679 1679
1680 MimeType mt( curApp ); 1680 MimeType mt( curApp );
1681 const AppLnk* app = mt.application(); 1681 const AppLnk* app = mt.application();
1682 QFile fi(curApp); 1682 QFile fi(curApp);
1683 1683
1684 QPopupMenu m; 1684 QPopupMenu m;
1685 m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); 1685 m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
1686 m.insertSeparator(); 1686 m.insertSeparator();
1687 if ( QFileInfo(fi).isDir() ) { 1687 if ( QFileInfo(fi).isDir() ) {
1688 m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); 1688 m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() ));
1689 } else { 1689 } else {
1690 1690
1691 if ( app ) 1691 if ( app )
1692 m.insertItem( app->pixmap(), tr( "Open in " + app->name() ), this, SLOT( run() ) ); 1692 m.insertItem( app->pixmap(), tr( "Open in " + app->name() ), this, SLOT( runThis() ) );
1693 else if( QFileInfo(fi).isExecutable() ) 1693 else if( QFileInfo(fi).isExecutable() )
1694 m.insertItem( tr( "Execute" ), this, SLOT( run() ) ); 1694 m.insertItem( tr( "Execute" ), this, SLOT( runThis() ) );
1695 1695
1696 m.insertItem( /*Resource::loadPixmap( "txt" ),*/ tr( "Open as text" ),this, SLOT( runText() ) ); 1696 m.insertItem( /*Resource::loadPixmap( "txt" ),*/ tr( "Open as text" ),this, SLOT( runText() ) );
1697 } 1697 }
1698 m.insertSeparator(); 1698 m.insertSeparator();
1699 1699
1700 1700
1701 if(isLocalView) 1701 if(isLocalView)
1702 m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); 1702 m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() ));
1703 else 1703 else
1704 m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); 1704 m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() ));
1705 1705
1706 m.insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); 1706 m.insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() ));
1707 m.insertSeparator(); 1707 m.insertSeparator();
1708 1708
1709 if(isLocalView) 1709 if(isLocalView)
1710 m.insertItem( tr( "Rename" ), this, SLOT( localRename() )); 1710 m.insertItem( tr( "Rename" ), this, SLOT( localRename() ));
1711 else 1711 else
1712 m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); 1712 m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() ));
1713 1713
1714 m.insertItem( tr( "Copy" ), this, SLOT( copy() )); 1714 m.insertItem( tr( "Copy" ), this, SLOT( copy() ));
1715 m.insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); 1715 m.insertItem( tr( "Copy As" ), this, SLOT( copyAs() ));
1716 m.insertItem( tr( "Move" ), this, SLOT( move() )); 1716 m.insertItem( tr( "Move" ), this, SLOT( move() ));
1717 m.insertSeparator(); 1717 m.insertSeparator();
1718 1718
1719 if(isLocalView) 1719 if(isLocalView)
1720 m.insertItem( tr( "Rescan" ), this, SLOT( populateLocalView() )); 1720 m.insertItem( tr( "Rescan" ), this, SLOT( populateLocalView() ));
1721 else 1721 else
1722 m.insertItem( tr( "Rescan" ), this, SLOT( populateRemoteView() )); 1722 m.insertItem( tr( "Rescan" ), this, SLOT( populateRemoteView() ));
1723 1723
1724 m.insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); 1724 m.insertItem( tr( "Run Command" ), this, SLOT( runCommand() ));
1725 m.insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); 1725 m.insertItem( tr( "File Info" ), this, SLOT( fileStatus() ));
1726 m.insertSeparator(); 1726 m.insertSeparator();
1727 1727
1728 if(isLocalView) 1728 if(isLocalView)
1729 m.insertItem( tr( "Delete" ), this, SLOT( localDelete() )); 1729 m.insertItem( tr( "Delete" ), this, SLOT( localDelete() ));
1730 else 1730 else
1731 m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); 1731 m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() ));
1732 1732
1733 m.insertSeparator(); 1733 m.insertSeparator();
1734 m.insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); 1734 m.insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() ));
1735 if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) //bad hack for Sharp zaurus failings 1735 if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) //bad hack for Sharp zaurus failings
1736 m.insertItem( tr( "Properties" ), this, SLOT( doProperties() )); 1736 m.insertItem( tr( "Properties" ), this, SLOT( doProperties() ));
1737 m.setCheckable(TRUE); 1737 m.setCheckable(TRUE);
1738 if (!b) 1738 if (!b)
1739 m.setItemChecked(m.idAt(0),TRUE); 1739 m.setItemChecked(m.idAt(0),TRUE);
1740 else 1740 else
1741 m.setItemChecked(m.idAt(0),FALSE); 1741 m.setItemChecked(m.idAt(0),FALSE);
1742 if(Ir::supported()) 1742 if(Ir::supported())
1743 m.insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); 1743 m.insertItem( tr( "Beam File" ), this, SLOT( doBeam() ));
1744 m.exec( QCursor::pos() ); 1744 m.exec( QCursor::pos() );
1745} 1745}
1746 1746
1747 1747
1748void AdvancedFm::cancelMenuTimer() 1748void AdvancedFm::cancelMenuTimer()
1749{ 1749{
1750qDebug("cancel menu timer"); 1750qDebug("cancel menu timer");
1751 if( menuTimer.isActive() ) 1751 if( menuTimer.isActive() )
1752 menuTimer.stop(); 1752 menuTimer.stop();
1753} 1753}