From eaf09b9b6e1abbe36e814a8e4da315ac8d96bd63 Mon Sep 17 00:00:00 2001 From: llornkcor Date: Sat, 18 Sep 2004 09:05:57 +0000 Subject: fix stuff, including #1404 --- (limited to 'noncore/apps/advancedfm') 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 @@ -12,6 +12,7 @@ #define DEVELOPERS_VERSION #include "advancedfm.h" +#include #include #include #include @@ -42,13 +43,21 @@ 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(); } AdvancedFm::~AdvancedFm() { @@ -66,12 +75,17 @@ void AdvancedFm::cleanUp() { file.remove(); } -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); } else { @@ -84,18 +98,22 @@ void AdvancedFm::tabChanged(QWidget *) { setCaption(tr("AdvancedFm :: ")+fs+" :: " +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); chdir( path.latin1()); + if( wd == Local_View) { + Remote_View->clearFocus(); + } else { + Local_View->clearFocus(); + } + } void AdvancedFm::populateView() { -// owarn << "PopulateView" << oendl; QPixmap pm; QListView *thisView = CurrentView(); QDir *thisDir = CurrentDir(); QString path = thisDir->canonicalPath(); -//owarn << "path is "+path << oendl; thisView->clear(); thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); thisDir->setMatchAllDirs(TRUE); @@ -215,8 +233,13 @@ 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; QString strSize=selectedItem->text(1); @@ -246,7 +269,7 @@ 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: { @@ -255,18 +278,20 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in } } break; +// case 2: +// menuTimer.start( 50, TRUE ); +// break; }; } 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(); } @@ -290,7 +315,8 @@ 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() ) { currentPathCombo->clear(); @@ -757,6 +783,11 @@ 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; } else { @@ -765,6 +796,7 @@ QDir *AdvancedFm::CurrentDir() { } QDir *AdvancedFm::OtherDir() { +// if ( TabWidget->currentWidget() == tab) { if ( whichTab == 1) { return ¤tRemoteDir; } else { @@ -773,8 +805,11 @@ 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 { // owarn << "CurrentView Tab 2" << oendl; @@ -790,7 +825,7 @@ QListView * AdvancedFm::OtherView() { } void AdvancedFm::setOtherTabCurrent() { -// owarn << "setOtherTabCurrent() " << whichTab << "" << oendl; + qDebug("setOtherTabCurrent() %d",whichTab); if ( whichTab == 1) { TabWidget->setCurrentWidget(1); } else { @@ -817,7 +852,7 @@ 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(); if(QDir( curDir).exists() ) { @@ -857,15 +892,6 @@ void AdvancedFm::slotSwitchMenu(int ) { // viewMenu->setItemChecked(item, true); } -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; doDirChange(); diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index effda0b..e596977 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h @@ -129,9 +129,9 @@ protected: QListView *CurrentView(); QListView *OtherView(); void setOtherTabCurrent(); - void dealWithSchmooSchmaa(QWidget *); protected slots: + void openSearch(); void dirMenuSelected(int); void showFileMenu(); @@ -156,6 +156,7 @@ protected slots: bool copyDirectory( const QString & , const QString & ); // void navigateToSelected(); bool moveDirectory( const QString & , const QString & ); + // void slotSwitchtoLocal(int); private: diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro index f1c518e..0644edb 100644 --- a/noncore/apps/advancedfm/advancedfm.pro +++ b/noncore/apps/advancedfm/advancedfm.pro @@ -5,7 +5,7 @@ SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions TARGET = advancedfm INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopiecore2 -lopieui2 +LIBS += -lqpe -lqte -lopiecore2 -lopieui2 !contains(CONFIG,quick-app) { DESTDIR = $(OPIEDIR)/bin diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 4628170..8d04c68 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp @@ -334,7 +334,6 @@ void AdvancedFm::copy() { } void AdvancedFm::copyAs() { - qApp->processEvents(); QStringList curFileList = getPath(); QString curFile, item; @@ -378,8 +377,10 @@ void AdvancedFm::copyAs() { delete fileDlg; } - rePopulate(); - setOtherTabCurrent(); + rePopulate(); + setOtherTabCurrent(); + qApp->processEvents(); + } void AdvancedFm::copySameDir() { @@ -753,12 +754,13 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { } if ( o->inherits( "QListView" ) ) { if ( e->type() == QEvent::FocusIn ) { - if( o == Local_View) { //keep track of which view - whichTab=1; - } - else { - whichTab=2; - } + if( o == Local_View) { //keep track of which view + qDebug("local view"); + whichTab = 1; + } else { + whichTab = 2; + qDebug("remote view"); + } } OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection } -- cgit v0.9.0.2