author | llornkcor <llornkcor> | 2002-03-27 04:33:32 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-27 04:33:32 (UTC) |
commit | 7d6828df281631bce0aaa2aaa229b69b9329e03c (patch) (side-by-side diff) | |
tree | efd928de11a2d7d2ae33bbccf737fae7a51ff36d | |
parent | 524ad1da733675debd5c248b54efc5d58e855485 (diff) | |
download | opie-7d6828df281631bce0aaa2aaa229b69b9329e03c.zip opie-7d6828df281631bce0aaa2aaa229b69b9329e03c.tar.gz opie-7d6828df281631bce0aaa2aaa229b69b9329e03c.tar.bz2 |
fixed something erother.. probably something todo with deleting or somesuch. probably broke something else in the process
-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 17 | ||||
-rw-r--r-- | core/apps/textedit/fileBrowser.h | 2 | ||||
-rw-r--r-- | core/apps/textedit/fileSaver.cpp | 45 |
3 files changed, 54 insertions, 10 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp index 8c942a1..8ea8067 100644 --- a/core/apps/textedit/fileBrowser.cpp +++ b/core/apps/textedit/fileBrowser.cpp @@ -173,2 +173,3 @@ void fileBrowser::populateList() ListView->clear(); + QListViewItem * item; bool isDir=FALSE; @@ -184,3 +185,2 @@ void fileBrowser::populateList() while ( (fi=it.current()) ) { - if (fi->isSymLink() ){ @@ -203,3 +203,3 @@ void fileBrowser::populateList() } - if(fileL !="./") { + if(fileL !="./" && fi->exists()) { item= new QListViewItem( ListView,fileL,fileS , fileDate); @@ -236,2 +236,3 @@ void fileBrowser::populateList() ++it; +// } } @@ -265,2 +266,3 @@ void fileBrowser::listClicked(QListViewItem *selectedItem) { + if(selectedItem) { QString strItem=selectedItem->text(0); @@ -305,2 +307,3 @@ void fileBrowser::listClicked(QListViewItem *selectedItem) } +} @@ -380,5 +383,5 @@ void fileBrowser::showListMenu(QListViewItem *item) { QPopupMenu m;// = new QPopupMenu( Local_View ); + if(item) { if( item->text(0).find("/",0,TRUE)) m.insertItem( tr( "Change Directory" ), this, SLOT( doCd() )); - else m.insertItem( tr( "Make Directory" ), this, SLOT( makDir() )); @@ -388,5 +391,9 @@ void fileBrowser::showListMenu(QListViewItem *item) { m.insertItem( tr( "Delete" ), this, SLOT( localDelete() )); - m.exec( QCursor::pos() ); + } else { + m.insertItem( tr( "Make Directory" ), this, SLOT( makDir() )); + m.insertItem( tr( "Rescan" ), this, SLOT( populateList() )); } + m.exec( QCursor::pos() ); +} @@ -402,2 +409,3 @@ void fileBrowser::makDir() { QString filename = fileDlg->LineEdit1->text(); + qDebug("Make dir"); currentDir.mkdir( currentDir.canonicalPath()+"/"+filename); @@ -438,3 +446,2 @@ void fileBrowser::localDelete() { }; - } else { diff --git a/core/apps/textedit/fileBrowser.h b/core/apps/textedit/fileBrowser.h index 339483f..e76c7df 100644 --- a/core/apps/textedit/fileBrowser.h +++ b/core/apps/textedit/fileBrowser.h @@ -69,3 +69,3 @@ private: QStringList dirPathStringList, mimetypes; - QListViewItem * item; +/* QListViewItem * item; */ QComboBox *dirPathCombo; diff --git a/core/apps/textedit/fileSaver.cpp b/core/apps/textedit/fileSaver.cpp index 07fb5ba..f2a5355 100644 --- a/core/apps/textedit/fileSaver.cpp +++ b/core/apps/textedit/fileSaver.cpp @@ -16,2 +16,3 @@ #include <qpe/resource.h> +#include <qpe/mimetype.h> @@ -49,2 +50,3 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); + docButton->setFlat(TRUE); @@ -59,6 +61,8 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl ListView->addColumn( tr( "Name" ) ); - ListView->setColumnWidth(0,140); + ListView->setColumnWidth(0,120); ListView->setSorting( 2, FALSE); ListView->addColumn( tr( "Size" ) ); - ListView->setColumnWidth(1,59); + ListView->setColumnWidth(1,-1); + ListView->addColumn( "Date",-1); + ListView->setColumnWidthMode(0,QListView::Manual); @@ -99,2 +103,3 @@ void fileSaver::populateList() ListView->clear(); + bool isDir=FALSE; currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); @@ -103,3 +108,3 @@ void fileSaver::populateList() currentDir.setNameFilter("*"); - QString fileL, fileS; + QString fileL, fileS, fileDate; const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); @@ -122,2 +127,3 @@ void fileSaver::populateList() fileL+="/"; + isDir=TRUE; // qDebug(currentDir.canonicalPath()+fileL); @@ -125,3 +131,34 @@ void fileSaver::populateList() } - item= new QListViewItem( ListView,fileL,fileS ); + if(fileL !="./") { + item= new QListViewItem( ListView,fileL,fileS , fileDate); + QPixmap pm; + + if(isDir || fileL.find("/",0,TRUE) != -1) { + if( !QDir( fi->filePath() ).isReadable()) + pm = Resource::loadPixmap( "lockedfolder" ); + else + pm= Resource::loadPixmap( "folder" ); + item->setPixmap( 0,pm ); + } else { + if( !fi->isReadable() ) + pm = Resource::loadPixmap( "locked" ); + else { + MimeType mt(fi->filePath()); + pm=mt.pixmap(); + if(pm.isNull()) + pm = Resource::loadPixmap( "UnknownDocument-14" ); + item->setPixmap( 0,pm); + } + } + if( fileL.find("->",0,TRUE) != -1) { + // overlay link image + pm= Resource::loadPixmap( "folder" ); + QPixmap lnk = Resource::loadPixmap( "symlink" ); + QPainter painter( &pm ); + painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); + pm.setMask( pm.createHeuristicMask( FALSE ) ); + item->setPixmap( 0, pm); + } + } + isDir=FALSE; ++it; |