author | llornkcor <llornkcor> | 2002-03-20 01:08:47 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-20 01:08:47 (UTC) |
commit | 25653ee75580cdd24a16e82abe7271c9402429c7 (patch) (side-by-side diff) | |
tree | 7b84fa83f295fd541a64dcc04d6522ce3c280e55 | |
parent | 090ac02da739600c577ed6396e04ed0e121f7890 (diff) | |
download | opie-25653ee75580cdd24a16e82abe7271c9402429c7.zip opie-25653ee75580cdd24a16e82abe7271c9402429c7.tar.gz opie-25653ee75580cdd24a16e82abe7271c9402429c7.tar.bz2 |
fix hidden mode revertig after delete and such
-rw-r--r-- | noncore/unsupported/filebrowser/filebrowser.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/noncore/unsupported/filebrowser/filebrowser.cpp b/noncore/unsupported/filebrowser/filebrowser.cpp index d9aabfd..6f82f95 100644 --- a/noncore/unsupported/filebrowser/filebrowser.cpp +++ b/noncore/unsupported/filebrowser/filebrowser.cpp @@ -187,51 +187,48 @@ FileView::FileView( const QString & dir, QWidget * parent, // right align yize column setColumnAlignment( 1, AlignRight ); generateDir( dir ); connect( this, SIGNAL( clicked( QListViewItem * )), SLOT( itemClicked( QListViewItem * )) ); connect( this, SIGNAL( doubleClicked( QListViewItem * )), SLOT( itemDblClicked( QListViewItem * )) ); connect( this, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); } void FileView::resizeEvent( QResizeEvent *e ) { setColumnWidth( 0, width() - 2 * lineWidth() - 20 - columnWidth( 1 ) - columnWidth( 2 ) ); // hide type column, we use it for "sort by type" only setColumnWidth( 3, 0 ); QListView::resizeEvent( e ); } void FileView::updateDir() { - setCaption( "Boogie on boogieboy"); - //qDebug("Caption should be "+currentDir); - generateDir( currentDir ); } void FileView::setDir( const QString & dir ) { if ( dir.startsWith( "/dev" ) ) { QMessageBox::warning( this, tr( "File Manager" ), tr( "Can't show /dev/ directory." ), tr( "&Ok" ) ); return; } dirHistory += currentDir; generateDir( dir ); } void FileView::generateDir( const QString & dir ) { QDir d( dir ); if( d.exists() && !d.isReadable() ) return; currentDir = d.canonicalPath(); if( !showingHidden) d.setFilter( QDir::Dirs | QDir::Files ); @@ -701,49 +698,50 @@ void FileBrowser::init(const QString & dir) fileView = new FileView( dir, this ); fileView->setAllColumnsShowFocus( TRUE ); setCentralWidget( fileView ); setToolBarsMovable( FALSE ); QPEToolBar* toolBar = new QPEToolBar( this ); toolBar->setHorizontalStretchable( TRUE ); QPEMenuBar* menuBar = new QPEMenuBar( toolBar ); dirMenu = new QPopupMenu( this ); menuBar->insertItem( tr( "Dir" ), dirMenu ); sortMenu = new QPopupMenu( this ); menuBar->insertItem( tr( "Sort" ), sortMenu ); sortMenu->insertItem( tr( "by Name "), this, SLOT( sortName() ) ); sortMenu->insertItem( tr( "by Size "), this, SLOT( sortSize() ) ); sortMenu->insertItem( tr( "by Date "), this, SLOT( sortDate() ) ); sortMenu->insertItem( tr( "by Type "), this, SLOT( sortType() ) ); sortMenu->insertSeparator(); sortMenu->insertItem( tr( "Ascending" ), this, SLOT( updateSorting() ) ); sortMenu->insertSeparator(); sortMenu->insertItem( tr( "Show Hidden "), this, SLOT( showHidden() ) ); - fileView->showingHidden=FALSE; + +// fileView->showingHidden=FALSE; sortMenu->setItemChecked( sortMenu->idAt( 5 ), TRUE ); sortMenu->setItemChecked( sortMenu->idAt( 0 ), TRUE ); toolBar = new QPEToolBar( this ); lastAction = new QAction( tr("Previous dir"), Resource::loadIconSet( "back" ), QString::null, 0, this, 0 ); connect( lastAction, SIGNAL( activated() ), fileView, SLOT( lastDir() ) ); lastAction->addTo( toolBar ); lastAction->setEnabled( FALSE ); upAction = new QAction( tr("Parent dir"), Resource::loadIconSet( "up" ), QString::null, 0, this, 0 ); connect( upAction, SIGNAL( activated() ), fileView, SLOT( parentDir() ) ); upAction->addTo( toolBar ); QAction *a = new QAction( tr("New folder"), Resource::loadPixmap( "newfolder" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), fileView, SLOT( newFolder() ) ); a->addTo( toolBar ); a = new QAction( tr("Cut"), Resource::loadPixmap( "cut" ), QString::null, 0, this, 0 ); @@ -852,49 +850,49 @@ void FileBrowser::sortType() { fileView->setSorting( 3, sortMenu->isItemChecked( sortMenu->idAt( 5 ) ) ); fileView->sort(); sortMenu->setItemChecked( sortMenu->idAt( 0 ), FALSE ); sortMenu->setItemChecked( sortMenu->idAt( 1 ), FALSE ); sortMenu->setItemChecked( sortMenu->idAt( 2 ), FALSE ); sortMenu->setItemChecked( sortMenu->idAt( 3 ), TRUE ); } void FileBrowser::updateSorting() { sortMenu->setItemChecked( sortMenu->idAt( 5 ), !sortMenu->isItemChecked( sortMenu->idAt( 5 ) ) ); if ( sortMenu->isItemChecked( sortMenu->idAt( 0 ) ) ) sortName(); else if ( sortMenu->isItemChecked( sortMenu->idAt( 1 ) ) ) sortSize(); else if ( sortMenu->isItemChecked( sortMenu->idAt( 2 ) ) ) sortDate(); else sortType(); } void FileBrowser::showHidden() { - if(! fileView->showingHidden) { + if(!fileView->showingHidden) { fileView->showingHidden=TRUE; sortMenu->setItemChecked( sortMenu->idAt( 7),TRUE); } else { fileView->showingHidden=FALSE; sortMenu->setItemChecked( sortMenu->idAt( 7),FALSE); } fileView->updateDir(); } void FileView::chPerm() { FileItem * i; QStringList fl; QString cmd; int err; if((i = (FileItem *) firstChild()) == 0) return; while( i ){ if( i->isSelected() ){ fl += i->getFilePath(); } i = (FileItem *) i->nextSibling(); } if( fl.count() < 1 ) return; |