summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp74
-rw-r--r--noncore/apps/advancedfm/advancedfm.h3
-rw-r--r--noncore/apps/advancedfm/advancedfm.pro2
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp8
4 files changed, 58 insertions, 29 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>
@@ -44,10 +45,18 @@ AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags )
initConnections();
+
whichTab=1;
- rePopulate();
- currentPathCombo->setFocus();
+ 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;
+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,5 +234,10 @@ void AdvancedFm::rePopulate() {
void AdvancedFm::ListClicked(QListViewItem *selectedItem) {
-//owarn << "listclicked" << oendl;
+ if ( TabWidget->currentWidget() == tab)
+ qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked local");
+ else
+ qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked remote");
+
+
if(selectedItem) {
QString strItem=selectedItem->text(0);
@@ -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 &currentPath) {
- 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 &currentDir;
@@ -766,4 +797,5 @@ QDir *AdvancedFm::CurrentDir() {
QDir *AdvancedFm::OtherDir() {
+// if ( TabWidget->currentWidget() == tab) {
if ( whichTab == 1) {
return &currentRemoteDir;
@@ -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;
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
@@ -130,7 +130,7 @@ protected:
QListView *OtherView();
void setOtherTabCurrent();
- void dealWithSchmooSchmaa(QWidget *);
protected slots:
+
void openSearch();
void dirMenuSelected(int);
@@ -157,4 +157,5 @@ protected slots:
// void navigateToSelected();
bool moveDirectory( const QString & , const QString & );
+
// void slotSwitchtoLocal(int);
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
@@ -6,5 +6,5 @@ TARGET = advancedfm
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe -lopiecore2 -lopieui2
+LIBS += -lqpe -lqte -lopiecore2 -lopieui2
!contains(CONFIG,quick-app) {
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
@@ -335,5 +335,4 @@ void AdvancedFm::copy() {
void AdvancedFm::copyAs() {
- qApp->processEvents();
QStringList curFileList = getPath();
@@ -381,4 +380,6 @@ void AdvancedFm::copyAs() {
rePopulate();
setOtherTabCurrent();
+ qApp->processEvents();
+
}
@@ -755,8 +756,9 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
if ( e->type() == QEvent::FocusIn ) {
if( o == Local_View) { //keep track of which view
+ qDebug("local view");
whichTab=1;
- }
- else {
+ } else {
whichTab=2;
+ qDebug("remote view");
}
}