summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm
authorllornkcor <llornkcor>2003-05-12 14:03:37 (UTC)
committer llornkcor <llornkcor>2003-05-12 14:03:37 (UTC)
commit3c19dcc0e905d3142acc9c1ab0ce8349740afe76 (patch) (side-by-side diff)
tree2fe7fd08d98045e85bd398c19aa835678a005f6d /noncore/apps/advancedfm
parent9659016253efa1e81b782e6fd787225522602428 (diff)
downloadopie-3c19dcc0e905d3142acc9c1ab0ce8349740afe76.zip
opie-3c19dcc0e905d3142acc9c1ab0ce8349740afe76.tar.gz
opie-3c19dcc0e905d3142acc9c1ab0ce8349740afe76.tar.bz2
added setDocument(QString) and openDirectory(QString) qcop messages to show open directory. use setDocument if you are unsure if advancedfm is executed already.
Diffstat (limited to 'noncore/apps/advancedfm') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp55
-rw-r--r--noncore/apps/advancedfm/advancedfm.h7
2 files changed, 51 insertions, 11 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index d4351b0..6b7fa1f 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -60,2 +60,5 @@ AdvancedFm::AdvancedFm( )
currentPathCombo->setFocus();
+ channel = new QCopChannel( "QPE/Application/advancedfm", this );
+ connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
+ this, SLOT( qcopReceive(const QCString&, const QByteArray&)) );
}
@@ -808,7 +811,7 @@ void AdvancedFm::gotoCustomDir(const QString &dir)
// qDebug("gotoCustomDir(const QString &dir) " +dir );
- QString curDir = dir;
- QDir *thisDir = CurrentDir();
+// QString curDir = dir;
+// QDir *thisDir = CurrentDir();
// if( curDir.isEmpty()) {
// }
- if( curDir == s_addBookmark)
+ if( dir == s_addBookmark)
{
@@ -816,3 +819,3 @@ void AdvancedFm::gotoCustomDir(const QString &dir)
}
- if( curDir == s_removeBookmark)
+ if( dir == s_removeBookmark)
{
@@ -822,9 +825,10 @@ void AdvancedFm::gotoCustomDir(const QString &dir)
{
- if(QDir( curDir).exists() )
- {
- thisDir->setPath( curDir );
- chdir( curDir.latin1() );
- thisDir->cd( curDir, TRUE);
- populateView();
- }
+ gotoDirectory( dir);
+// if(QDir( curDir).exists() )
+// {
+// thisDir->setPath( curDir );
+// chdir( curDir.latin1() );
+// thisDir->cd( curDir, TRUE);
+// populateView();
+// }
}
@@ -879 +883,30 @@ void AdvancedFm::setOtherTabCurrent()
}
+
+void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) {
+ qDebug("qcop message "+msg );
+ QDataStream stream ( data, IO_ReadOnly );
+ if ( msg == "openDirectory(QString)" ) {
+ qDebug("received");
+ QString file;
+ stream >> file;
+ gotoDirectory( (const QString &) file);
+ }
+}
+
+ void AdvancedFm::setDocument(const QString &file) {
+ gotoDirectory( file);
+
+ }
+
+void AdvancedFm::gotoDirectory(const QString &file) {
+
+ QString curDir = file;
+ QDir *thisDir = CurrentDir();
+
+ if(QDir( curDir).exists() ) {
+ thisDir->setPath( curDir );
+ chdir( curDir.latin1() );
+ thisDir->cd( curDir, TRUE);
+ populateView();
+ }
+}
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index 4480051..c9a5525 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -18,3 +18,5 @@
#include <opie/oprocess.h>
+
#include <qpe/ir.h>
+#include <qpe/qcopenvelope_qws.h>
@@ -91,2 +93,3 @@ protected:
OTabWidget *TabWidget;
+ QCopChannel * channel;
QPixmap unknownXpm;
@@ -163,2 +166,3 @@ private:
void removeCustomDir();
+ void gotoDirectory(const QString &);
@@ -168,2 +172,5 @@ private slots:
void gotoCustomDir(const QString &);
+ void qcopReceive(const QCString&, const QByteArray&);
+ void setDocument(const QString &);
+
};