summaryrefslogtreecommitdiff
path: root/noncore/unsupported/filebrowser/filebrowser.cpp
authoralwin <alwin>2004-03-02 12:21:11 (UTC)
committer alwin <alwin>2004-03-02 12:21:11 (UTC)
commitb6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff)
treed3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/unsupported/filebrowser/filebrowser.cpp
parent0d59c780513da78033f4d9040475dee9db0256d4 (diff)
downloadopie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/unsupported/filebrowser/filebrowser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/filebrowser/filebrowser.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/unsupported/filebrowser/filebrowser.cpp b/noncore/unsupported/filebrowser/filebrowser.cpp
index 8cf8a60..92a688a 100644
--- a/noncore/unsupported/filebrowser/filebrowser.cpp
+++ b/noncore/unsupported/filebrowser/filebrowser.cpp
@@ -239,52 +239,52 @@ FileView::FileView( const QString & dir, QWidget * parent,
239 menuTimer( this ), 239 menuTimer( this ),
240 le( NULL ), 240 le( NULL ),
241 itemToRename( NULL ), 241 itemToRename( NULL ),
242 showHidden( hidden ), 242 showHidden( hidden ),
243 showSymlinks( symlinks ), 243 showSymlinks( symlinks ),
244 showThumbnails( thumbnails ), 244 showThumbnails( thumbnails ),
245 menuKeepsOpen( FALSE ) 245 menuKeepsOpen( FALSE )
246{ 246{
247 addColumn( "Name" ); 247 addColumn( "Name" );
248 addColumn( "Size" ); 248 addColumn( "Size" );
249 addColumn( "Date" ); 249 addColumn( "Date" );
250 addColumn( "Type" ); 250 addColumn( "Type" );
251 251
252 setMultiSelection( TRUE ); 252 setMultiSelection( TRUE );
253 //header()->hide(); 253 //header()->hide();
254 254
255 setColumnWidthMode( 0, Manual ); 255 setColumnWidthMode( 0, Manual );
256 setColumnWidthMode( 3, Manual ); 256 setColumnWidthMode( 3, Manual );
257 257
258 // right align yize column 258 // right align yize column
259 setColumnAlignment( 1, AlignRight ); 259 setColumnAlignment( 1, AlignRight );
260 260
261 generateDir( dir ); 261 generateDir( dir );
262 262
263 connect( this, SIGNAL( clicked( QListViewItem * )), 263 connect( this, SIGNAL( clicked(QListViewItem*)),
264 SLOT( itemClicked( QListViewItem * )) ); 264 SLOT( itemClicked(QListViewItem*)) );
265 connect( this, SIGNAL( doubleClicked( QListViewItem * )), 265 connect( this, SIGNAL( doubleClicked(QListViewItem*)),
266 SLOT( itemDblClicked( QListViewItem * )) ); 266 SLOT( itemDblClicked(QListViewItem*)) );
267 connect( this, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); 267 connect( this, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) );
268 connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); 268 connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) );
269} 269}
270 270
271void FileView::resizeEvent( QResizeEvent *e ) 271void FileView::resizeEvent( QResizeEvent *e )
272{ 272{
273 setColumnWidth( 0, width() - 2 * lineWidth() - 20 - columnWidth( 1 ) - columnWidth( 2 ) ); 273 setColumnWidth( 0, width() - 2 * lineWidth() - 20 - columnWidth( 1 ) - columnWidth( 2 ) );
274 274
275 // hide type column, we use it for "sort by type" only 275 // hide type column, we use it for "sort by type" only
276 //setColumnWidth( 3, 0 ); 276 //setColumnWidth( 3, 0 );
277 QListView::resizeEvent( e ); 277 QListView::resizeEvent( e );
278} 278}
279 279
280void FileView::updateDir() 280void FileView::updateDir()
281{ 281{
282 generateDir( currentDir ); 282 generateDir( currentDir );
283} 283}
284 284
285void FileView::setDir( const QString & dir ) 285void FileView::setDir( const QString & dir )
286{ 286{
287 if ( dir.startsWith( "/dev" ) ) { 287 if ( dir.startsWith( "/dev" ) ) {
288 QMessageBox::warning( this, tr( "File Manager" ), 288 QMessageBox::warning( this, tr( "File Manager" ),
289 tr( "Can't show /dev/ directory." ), tr( "&Ok" ) ); 289 tr( "Can't show /dev/ directory." ), tr( "&Ok" ) );
290 return; 290 return;
@@ -887,50 +887,50 @@ void FileBrowser::init(const QString & dir)
887 connect( a, SIGNAL( activated() ), fileView, SLOT( newFolder() ) ); 887 connect( a, SIGNAL( activated() ), fileView, SLOT( newFolder() ) );
888 a->addTo( toolBar ); 888 a->addTo( toolBar );
889 889
890 a = new QAction( tr("Cut"), Resource::loadPixmap( "cut" ), 890 a = new QAction( tr("Cut"), Resource::loadPixmap( "cut" ),
891 QString::null, 0, this, 0 ); 891 QString::null, 0, this, 0 );
892 connect( a, SIGNAL( activated() ), fileView, SLOT( cut() ) ); 892 connect( a, SIGNAL( activated() ), fileView, SLOT( cut() ) );
893 a->addTo( toolBar ); 893 a->addTo( toolBar );
894 894
895 a = new QAction( tr("Copy"), Resource::loadPixmap( "copy" ), 895 a = new QAction( tr("Copy"), Resource::loadPixmap( "copy" ),
896 QString::null, 0, this, 0 ); 896 QString::null, 0, this, 0 );
897 connect( a, SIGNAL( activated() ), fileView, SLOT( copy() ) ); 897 connect( a, SIGNAL( activated() ), fileView, SLOT( copy() ) );
898 a->addTo( toolBar ); 898 a->addTo( toolBar );
899 899
900 pasteAction = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), 900 pasteAction = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ),
901 QString::null, 0, this, 0 ); 901 QString::null, 0, this, 0 );
902 connect( pasteAction, SIGNAL( activated() ), fileView, SLOT( paste() ) ); 902 connect( pasteAction, SIGNAL( activated() ), fileView, SLOT( paste() ) );
903 pasteAction->addTo( toolBar ); 903 pasteAction->addTo( toolBar );
904 904
905// dirLabel = new QLabel(this, "DirLabel"); 905// dirLabel = new QLabel(this, "DirLabel");
906 906
907 connect( fileView, SIGNAL( dirChanged() ), SLOT( updateDirMenu() ) ); 907 connect( fileView, SIGNAL( dirChanged() ), SLOT( updateDirMenu() ) );
908 updateDirMenu(); 908 updateDirMenu();
909 909
910 QCopChannel* pcmciaChannel = new QCopChannel( "QPE/Card", this ); 910 QCopChannel* pcmciaChannel = new QCopChannel( "QPE/Card", this );
911 connect( pcmciaChannel, SIGNAL(received(const QCString &, const QByteArray &)), 911 connect( pcmciaChannel, SIGNAL(received(const QCString&,const QByteArray&)),
912 this, SLOT(pcmciaMessage( const QCString &, const QByteArray &)) ); 912 this, SLOT(pcmciaMessage(const QCString&,const QByteArray&)) );
913} 913}
914 914
915void FileBrowser::pcmciaMessage( const QCString &msg, const QByteArray &) 915void FileBrowser::pcmciaMessage( const QCString &msg, const QByteArray &)
916{ 916{
917 if ( msg == "mtabChanged()" ) { 917 if ( msg == "mtabChanged()" ) {
918 // ## Only really needed if current dir is on a card 918 // ## Only really needed if current dir is on a card
919 fileView->updateDir(); 919 fileView->updateDir();
920 } 920 }
921} 921}
922 922
923void FileBrowser::changeCaption(const QString & dir) { 923void FileBrowser::changeCaption(const QString & dir) {
924 setCaption( dir); 924 setCaption( dir);
925} 925}
926 926
927void FileBrowser::dirSelected( int id ) 927void FileBrowser::dirSelected( int id )
928{ 928{
929 int i = 0, j; 929 int i = 0, j;
930 QString dir; 930 QString dir;
931 931
932 // Bulid target dir from menu 932 // Bulid target dir from menu
933 while( (j = dirMenu->idAt( i )) != id ){ 933 while( (j = dirMenu->idAt( i )) != id ){
934 dir += dirMenu->text( j ).stripWhiteSpace(); 934 dir += dirMenu->text( j ).stripWhiteSpace();
935 if( dirMenu->text( j ) != "/" ) dir += "/"; 935 if( dirMenu->text( j ) != "/" ) dir += "/";
936 i++; 936 i++;