summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector.cc23
-rw-r--r--libopie/ofileselector.h4
2 files changed, 25 insertions, 2 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index 14f035e..fbe69ed 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -738,24 +738,27 @@ void OFileSelector::initializeListView()
738 m_boxToolbar->addWidget(m_homeButton ); 738 m_boxToolbar->addWidget(m_homeButton );
739 m_boxToolbar->addWidget(m_docButton ); 739 m_boxToolbar->addWidget(m_docButton );
740 m_pseudoLayout->addLayout(m_boxToolbar ); 740 m_pseudoLayout->addLayout(m_boxToolbar );
741 // lets fill the combobox 741 // lets fill the combobox
742 StorageInfo storage; 742 StorageInfo storage;
743 const QList<FileSystem> &fs = storage.fileSystems(); 743 const QList<FileSystem> &fs = storage.fileSystems();
744 QListIterator<FileSystem> it ( fs ); 744 QListIterator<FileSystem> it ( fs );
745 for( ; it.current(); ++it ){ 745 for( ; it.current(); ++it ){
746 const QString disk = (*it)->name(); 746 const QString disk = (*it)->name();
747 const QString path = (*it)->path(); 747 const QString path = (*it)->path();
748 m_location->insertItem(path+ "<-"+disk ); 748 m_location->insertItem(path+ "<-"+disk );
749 } 749 }
750 int count = m_location->count();
751 m_location->insertItem(m_currentDir );
752 m_location->setCurrentItem( count );
750 }; 753 };
751 m_View = new QListView(m_pseudo, "Extended view" ); 754 m_View = new QListView(m_pseudo, "Extended view" );
752 m_stack->addWidget( m_pseudo, EXTENDED ); 755 m_stack->addWidget( m_pseudo, EXTENDED );
753 m_stack->raiseWidget( EXTENDED ); 756 m_stack->raiseWidget( EXTENDED );
754 m_pseudoLayout->addWidget(m_View ); 757 m_pseudoLayout->addWidget(m_View );
755 QPEApplication::setStylusOperation( m_View->viewport(),QPEApplication::RightOnHold); 758 QPEApplication::setStylusOperation( m_View->viewport(),QPEApplication::RightOnHold);
756 // set up the stuff 759 // set up the stuff
757 // Pixmap Name Date Size mime 760 // Pixmap Name Date Size mime
758 //(m_View->header() )->hide(); 761 //(m_View->header() )->hide();
759 //m_View->setRootIsDecorated(false); 762 //m_View->setRootIsDecorated(false);
760 m_View->addColumn(" "); 763 m_View->addColumn(" ");
761 m_View->addColumn(tr("Name") ); 764 m_View->addColumn(tr("Name") );
@@ -993,24 +996,29 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
993 this, SLOT(slotDelete() ) ); 996 this, SLOT(slotDelete() ) );
994 997
995 menu.exec(QCursor::pos() ); 998 menu.exec(QCursor::pos() );
996 } 999 }
997} 1000}
998bool OFileSelector::cd(const QString &str ) 1001bool OFileSelector::cd(const QString &str )
999{ 1002{
1000 qWarning(" dir %s", str.latin1() ); 1003 qWarning(" dir %s", str.latin1() );
1001 QDir dir( str); 1004 QDir dir( str);
1002 if(dir.exists() ){ 1005 if(dir.exists() ){
1003 m_currentDir = str; 1006 m_currentDir = str;
1004 reparse(); 1007 reparse();
1008 if(m_shTool ){
1009 int count = m_location->count();
1010 m_location->insertItem(str );
1011 m_location->setCurrentItem( count );
1012 }
1005 return true; 1013 return true;
1006 } 1014 }
1007 return false; 1015 return false;
1008} 1016}
1009 1017
1010void OFileSelector::slotChangedDir() 1018void OFileSelector::slotChangedDir()
1011{ 1019{
1012 OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); 1020 OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem();
1013 if(sel->isDir() ){ 1021 if(sel->isDir() ){
1014 QStringList str = QStringList::split("->", sel->text(1) ); 1022 QStringList str = QStringList::split("->", sel->text(1) );
1015 cd( sel->directory() + "/" + str[0] ); 1023 cd( sel->directory() + "/" + str[0] );
1016 } 1024 }
@@ -1044,16 +1052,29 @@ void OFileSelector::slotDelete()
1044 } 1052 }
1045 m_View->takeItem( sel ); 1053 m_View->takeItem( sel );
1046 delete sel; 1054 delete sel;
1047} 1055}
1048 1056
1049void OFileSelector::cdUP() 1057void OFileSelector::cdUP()
1050{ 1058{
1051 QDir dir( m_currentDir ); 1059 QDir dir( m_currentDir );
1052 dir.cdUp(); 1060 dir.cdUp();
1053 if(dir.exists() ){ 1061 if(dir.exists() ){
1054 m_currentDir = dir.absPath(); 1062 m_currentDir = dir.absPath();
1055 reparse(); 1063 reparse();
1064 int count = m_location->count();
1065 m_location->insertItem(m_currentDir );
1066 m_location->setCurrentItem( count );
1056 } 1067 }
1057} 1068}
1069void OFileSelector::slotHome()
1070{
1071 cd(QDir::homeDirPath() );
1072}
1073void OFileSelector::slotDoc()
1074{
1075 cd(QDir::homeDirPath() + "/Documents" );
1076}
1077void OFileSelector::slotNavigate()
1078{
1058 1079
1059 1080}
diff --git a/libopie/ofileselector.h b/libopie/ofileselector.h
index b91c0ea..bf3cb48 100644
--- a/libopie/ofileselector.h
+++ b/libopie/ofileselector.h
@@ -258,18 +258,20 @@ private slots:
258 virtual void slotCurrentChanged(QListViewItem* ); 258 virtual void slotCurrentChanged(QListViewItem* );
259 virtual void slotClicked( int, QListViewItem *item, const QPoint &, int); 259 virtual void slotClicked( int, QListViewItem *item, const QPoint &, int);
260 virtual void slotRightButton(int, QListViewItem *, const QPoint &, int ); 260 virtual void slotRightButton(int, QListViewItem *, const QPoint &, int );
261 virtual void slotContextMenu( QListViewItem *item); 261 virtual void slotContextMenu( QListViewItem *item);
262 // listview crap see above 262 // listview crap see above
263 // PopupMenu crap 263 // PopupMenu crap
264 virtual void slotChangedDir(); 264 virtual void slotChangedDir();
265 virtual void slotOpen(); 265 virtual void slotOpen();
266 virtual void slotRescan(); 266 virtual void slotRescan();
267 virtual void slotRename(); 267 virtual void slotRename();
268 virtual void slotDelete(); 268 virtual void slotDelete();
269 virtual void cdUP(); 269 virtual void cdUP();
270 270 virtual void slotHome();
271 virtual void slotDoc();
272 virtual void slotNavigate( );
271}; 273};
272 274
273 275
274#endif 276#endif
275 277