summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-09-25 05:01:41 (UTC)
committer llornkcor <llornkcor>2004-09-25 05:01:41 (UTC)
commit45a59fcd4a35c9c0ce35162c0ac7a5c914e24a52 (patch) (side-by-side diff)
tree99fd7480b1825b8eb956f40f163aa3fc20cfc6cf
parent06073d16f0dd3fb332af60467bb90480e21ebc28 (diff)
downloadopie-45a59fcd4a35c9c0ce35162c0ac7a5c914e24a52.zip
opie-45a59fcd4a35c9c0ce35162c0ac7a5c914e24a52.tar.gz
opie-45a59fcd4a35c9c0ce35162c0ac7a5c914e24a52.tar.bz2
redunancy
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp31
-rw-r--r--noncore/apps/advancedfm/advancedfm.h1
2 files changed, 4 insertions, 28 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 3bfec7d..3cd2067 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -333,25 +333,25 @@ QStringList AdvancedFm::getPath() {
QListView *thisView=CurrentView();
QList<QListViewItem> * getSelectedItems( QListView * thisView );
QListViewItemIterator it( thisView );
for ( ; it.current(); ++it ) {
if ( it.current()->isSelected() ) {
strList << it.current()->text(0);
// odebug << it.current()->text(0) << oendl;
}
}
return strList;
}
-void AdvancedFm::changeTo(QString dir) {
+void AdvancedFm::changeTo(const QString dir) {
chdir( dir.latin1());
CurrentDir()->cd(dir, TRUE);
populateView();
update();
}
void AdvancedFm::homeButtonPushed() {
changeTo(QDir::homeDirPath());
}
void AdvancedFm::docButtonPushed() {
changeTo(QPEApplication::documentDir());
@@ -690,25 +690,25 @@ void AdvancedFm::removeCustomDir() {
void AdvancedFm::gotoCustomDir(const QString &dir) {
// odebug << "gotoCustomDir(const QString &dir) " +dir << oendl;
// QString curDir = dir;
// QDir *thisDir = CurrentDir();
// if( curDir.isEmpty()) {
// }
if( dir == s_addBookmark) {
addCustomDir();
}
if( dir == s_removeBookmark) {
removeCustomDir( );
} else {
- gotoDirectory( dir);
+ changeTo( dir);
// if(QDir( curDir).exists() )
// {
// thisDir->setPath( curDir );
// chdir( curDir.latin1() );
// thisDir->cd( curDir, TRUE);
// populateView();
// }
}
}
QDir *AdvancedFm::CurrentDir() {
if ( whichTab == 1) {
@@ -757,56 +757,33 @@ void AdvancedFm::setOtherTabCurrent() {
}
OtherView()->setFocus();
OtherView()->setSelected( CurrentView()->firstChild(), true);
}
void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) {
// odebug << "qcop message "+msg << oendl;
QDataStream stream ( data, IO_ReadOnly );
if ( msg == "openDirectory(QString)" ) {
// odebug << "received" << oendl;
QString file;
stream >> file;
- gotoDirectory( (const QString &) file);
+ changeTo( (const QString &) file);
}
}
void AdvancedFm::setDocument(const QString &file) {
- gotoDirectory( file);
+ changeTo( file);
}
-void AdvancedFm::gotoDirectory(const QString &file) {
-// qDebug("goto dir "+file);
- QString curDir = file;
- QDir *thisDir = CurrentDir();
- if(QDir( curDir).exists() ) {
- thisDir->setPath( curDir );
- chdir( curDir.latin1() );
- thisDir->cd( curDir, TRUE);
- populateView();
- }
- else if(QFileInfo(curDir).exists()) {
- QFileInfo fileInfo(curDir);
- curDir=fileInfo.dirPath();
- if(QDir( curDir).exists() ) {
- thisDir->setPath( curDir );
- chdir( curDir.latin1() );
- thisDir->cd( curDir, TRUE);
- populateView();
- }
- findFile(file);
- }
-
-}
void AdvancedFm::findFile(const QString &fileName) {
QFileInfo fi(fileName);
QListView *thisView = CurrentView();
QListViewItemIterator it( thisView );
for ( ; it.current(); ++it ) {
if(it.current()->text(0) == fi.fileName()) {
it.current()->setSelected(true);
thisView->ensureItemVisible(it.current());
}
}
}
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index 9dbdc70..00ab909 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -168,25 +168,24 @@ protected slots:
private:
MenuButton *menuButton;
QString oldName, localViewDir, remoteViewDir;
void startProcess(const QString &);
bool eventFilter( QObject * , QEvent * );
void cancelRename();
void doRename(QListView *);
void okRename();
void customDirsToMenu();
void addCustomDir();
void removeCustomDir();
- void gotoDirectory(const QString &);
void navigateToSelected();
void findFile(const QString &);
private slots:
void processEnded(Opie::Core::OProcess *);
void oprocessStderr(Opie::Core::OProcess *, char *, int);
void gotoCustomDir(const QString &);
void qcopReceive(const QCString&, const QByteArray&);
void setDocument(const QString &);
// void doMenu(int
};