author | llornkcor <llornkcor> | 2004-09-18 09:05:57 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-09-18 09:05:57 (UTC) |
commit | eaf09b9b6e1abbe36e814a8e4da315ac8d96bd63 (patch) (side-by-side diff) | |
tree | ee914747ae2494d50716ab3cda866613d4eb134c /noncore/apps/advancedfm/advancedfm.cpp | |
parent | 5096f9bd9f1a06e5238e2206eee195c43a2bdb6b (diff) | |
download | opie-eaf09b9b6e1abbe36e814a8e4da315ac8d96bd63.zip opie-eaf09b9b6e1abbe36e814a8e4da315ac8d96bd63.tar.gz opie-eaf09b9b6e1abbe36e814a8e4da315ac8d96bd63.tar.bz2 |
fix stuff, including #1404
Diffstat (limited to 'noncore/apps/advancedfm/advancedfm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 88 |
1 files changed, 57 insertions, 31 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index afb44f5..b4461cb 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -13,4 +13,5 @@ #include "advancedfm.h" +#include <opie2/odebug.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> @@ -43,11 +44,19 @@ AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); - initConnections(); - whichTab=1; - rePopulate(); - currentPathCombo->setFocus(); - channel = new QCopChannel( "QPE/Application/advancedfm", this ); - connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), - this, SLOT( qcopReceive(const QCString&,const QByteArray&)) ); + initConnections(); + + whichTab = 1; + populateView(); +// rePopulate(); +// currentPathCombo->setFocus(); + channel = new QCopChannel( "QPE/Application/advancedfm", this ); + connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), + this, SLOT( qcopReceive(const QCString&,const QByteArray&)) ); + +// if( CurrentView() == Local_View) +// qDebug("LOCAL VIEW"); +// else +// qDebug("REMOTE VIEW"); + switchToLocalTab(); } @@ -67,10 +76,15 @@ void AdvancedFm::cleanUp() { } -void AdvancedFm::tabChanged(QWidget *) { -// owarn << "tab changed" << oendl; - QString path = CurrentDir()->canonicalPath(); +void AdvancedFm::tabChanged(QWidget *wd) { + if(wd == tab) + odebug << "LOCAL VIEW SHOWN"<< oendl; + else if(wd == tab_2) + odebug<< "REMOTE VIEW SHOWN"<< oendl; + + QString path = CurrentDir()->canonicalPath(); currentPathCombo->lineEdit()->setText( path ); - if(whichTab == 1) { + if ( TabWidget->currentWidget() == tab) { +// if(whichTab == 1) { viewMenu->setItemChecked(viewMenu->idAt(0), true); viewMenu->setItemChecked(viewMenu->idAt(1), false); @@ -85,4 +99,10 @@ void AdvancedFm::tabChanged(QWidget *) { +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); chdir( path.latin1()); + if( wd == Local_View) { + Remote_View->clearFocus(); + } else { + Local_View->clearFocus(); + } + } @@ -90,5 +110,4 @@ void AdvancedFm::tabChanged(QWidget *) { void AdvancedFm::populateView() { -// owarn << "PopulateView" << oendl; QPixmap pm; QListView *thisView = CurrentView(); @@ -96,5 +115,4 @@ void AdvancedFm::populateView() { QString path = thisDir->canonicalPath(); -//owarn << "path is "+path << oendl; thisView->clear(); thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); @@ -216,6 +234,11 @@ void AdvancedFm::rePopulate() { void AdvancedFm::ListClicked(QListViewItem *selectedItem) { -//owarn << "listclicked" << oendl; - if(selectedItem) { + if ( TabWidget->currentWidget() == tab) + qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked local"); + else + qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked remote"); + + + if(selectedItem) { QString strItem=selectedItem->text(0); // owarn << strItem << oendl; @@ -247,5 +270,5 @@ void AdvancedFm::ListClicked(QListViewItem *selectedItem) { void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { - dealWithSchmooSchmaa( item->listView()); + Q_UNUSED(item); switch (mouse) { case 1: @@ -256,4 +279,7 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in } break; +// case 2: +// menuTimer.start( 50, TRUE ); +// break; }; } @@ -261,11 +287,10 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in void AdvancedFm::switchToLocalTab() { -//owarn << "switch to local view" << oendl; TabWidget->setCurrentWidget(0); Local_View->setFocus(); + } void AdvancedFm::switchToRemoteTab() { -//owarn << "switch to local view" << oendl; TabWidget->setCurrentWidget(1); Remote_View->setFocus(); @@ -291,5 +316,6 @@ void AdvancedFm::currentPathComboChanged() { void AdvancedFm::fillCombo(const QString ¤tPath) { - if ( whichTab == 1) { + if ( TabWidget->currentWidget() == tab) { +// if ( whichTab == 1) { currentPathCombo->lineEdit()->setText( currentPath); if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { @@ -758,4 +784,9 @@ void AdvancedFm::gotoCustomDir(const QString &dir) { QDir *AdvancedFm::CurrentDir() { + if ( TabWidget->currentWidget() == tab) + qDebug("CurrentTab is Local"); + else + qDebug("CurrentTab is Remote"); + if ( whichTab == 1) { return ¤tDir; @@ -766,4 +797,5 @@ QDir *AdvancedFm::CurrentDir() { QDir *AdvancedFm::OtherDir() { +// if ( TabWidget->currentWidget() == tab) { if ( whichTab == 1) { return ¤tRemoteDir; @@ -774,6 +806,9 @@ QDir *AdvancedFm::OtherDir() { QListView * AdvancedFm::CurrentView() { + if ( TabWidget->currentWidget() == tab) + odebug << "CurrentView local" << oendl; + +// if ( TabWidget->currentWidget() == tab) { if ( whichTab == 1) { -// owarn << "CurrentView Tab 1" << oendl; return Local_View; } else { @@ -791,5 +826,5 @@ QListView * AdvancedFm::OtherView() { void AdvancedFm::setOtherTabCurrent() { -// owarn << "setOtherTabCurrent() " << whichTab << "" << oendl; + qDebug("setOtherTabCurrent() %d",whichTab); if ( whichTab == 1) { TabWidget->setCurrentWidget(1); @@ -818,5 +853,5 @@ void AdvancedFm::setDocument(const QString &file) { void AdvancedFm::gotoDirectory(const QString &file) { -// owarn << "goto dir "+file << oendl; + qDebug("goto dir "+file); QString curDir = file; QDir *thisDir = CurrentDir(); @@ -858,13 +893,4 @@ void AdvancedFm::slotSwitchMenu(int ) { } -void AdvancedFm::dealWithSchmooSchmaa(QWidget *w) { - tabChanged( w); - if( w == Local_View) { - Remote_View->clearFocus(); - } else { - Local_View->clearFocus(); - } -} - void AdvancedFm::navigateToSelected() { if( !CurrentView()->currentItem()) return; |