summaryrefslogtreecommitdiff
path: root/libopie/ofileselector.cc
Unidiff
Diffstat (limited to 'libopie/ofileselector.cc') (more/less context) (show whitespace changes)
-rw-r--r--libopie/ofileselector.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index 9534667..6a6a300 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -366,25 +366,25 @@ QStringList OFileSelector::selectedPaths() const
366 QStringList list; 366 QStringList list;
367 list << selectedPath(); 367 list << selectedPath();
368 return list; 368 return list;
369} 369}
370QString OFileSelector::directory()const 370QString OFileSelector::directory()const
371{ 371{
372 if( m_selector == NORMAL ) 372 if( m_selector == NORMAL )
373 return QPEApplication::documentDir(); 373 return QPEApplication::documentDir();
374 374
375 return QDir(m_currentDir).absPath(); 375 return QDir(m_currentDir).absPath();
376} 376}
377 377
378int OFileSelector::fileCount() 378int OFileSelector::fileCount() const
379{ 379{
380 int count; 380 int count;
381 switch( m_selector ){ 381 switch( m_selector ){
382 case NORMAL: 382 case NORMAL:
383 count = m_select->fileCount(); 383 count = m_select->fileCount();
384 break; 384 break;
385 //case CUSTOM: 385 //case CUSTOM:
386 case EXTENDED: 386 case EXTENDED:
387 case EXTENDED_ALL: 387 case EXTENDED_ALL:
388 default: 388 default:
389 count = m_View->childCount(); 389 count = m_View->childCount();
390 break; 390 break;
@@ -673,25 +673,25 @@ void OFileSelector::initVars()
673 m_lay = 0; 673 m_lay = 0;
674 m_Oselector = 0; 674 m_Oselector = 0;
675 m_boxToolbar = 0; 675 m_boxToolbar = 0;
676 m_boxOk = 0; 676 m_boxOk = 0;
677 m_boxName = 0; 677 m_boxName = 0;
678 m_boxView = 0; 678 m_boxView = 0;
679 m_custom = 0; 679 m_custom = 0;
680 m_edit = 0; 680 m_edit = 0;
681 m_fnLabel = 0; 681 m_fnLabel = 0;
682 m_new = 0; 682 m_new = 0;
683 m_close = 0; 683 m_close = 0;
684} 684}
685void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink) 685void OFileSelector::addFile(const QString &/*mime*/, QFileInfo *info, bool symlink)
686{ 686{
687 if(!m_files) 687 if(!m_files)
688 return; 688 return;
689 // if( !compliesMime(info->absFilePath(), mime ) ) 689 // if( !compliesMime(info->absFilePath(), mime ) )
690 // return; 690 // return;
691 MimeType type( info->absFilePath() ); 691 MimeType type( info->absFilePath() );
692 if (!compliesMime( type.id() ) ) 692 if (!compliesMime( type.id() ) )
693 return; 693 return;
694 694
695 QPixmap pix = type.pixmap(); 695 QPixmap pix = type.pixmap();
696 QString dir; 696 QString dir;
697 QString name; 697 QString name;
@@ -705,25 +705,25 @@ void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink)
705 name = info->fileName(); 705 name = info->fileName();
706 if( ( m_mode == OPEN && !info->isReadable() )|| 706 if( ( m_mode == OPEN && !info->isReadable() )||
707 ( m_mode == SAVE && !info->isWritable() ) ){ 707 ( m_mode == SAVE && !info->isWritable() ) ){
708 708
709 locked = true; pix = Resource::loadPixmap("locked"); 709 locked = true; pix = Resource::loadPixmap("locked");
710 } 710 }
711 } 711 }
712 new OFileSelectorItem( m_View, pix, name, 712 new OFileSelectorItem( m_View, pix, name,
713 info->lastModified().toString(), 713 info->lastModified().toString(),
714 QString::number( info->size() ), 714 QString::number( info->size() ),
715 dir, locked ); 715 dir, locked );
716} 716}
717void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink ) 717void OFileSelector::addDir(const QString &/*mime*/, QFileInfo *info, bool symlink )
718{ 718{
719 if(!m_dir) 719 if(!m_dir)
720 return; 720 return;
721 if( m_selector == EXTENDED_ALL || m_selector == EXTENDED ){ 721 if( m_selector == EXTENDED_ALL || m_selector == EXTENDED ){
722 bool locked = false; 722 bool locked = false;
723 QString name; 723 QString name;
724 QPixmap pix; 724 QPixmap pix;
725 if( ( m_mode == OPEN && !info->isReadable() ) || ( m_mode == SAVE && !info->isWritable() ) ){ 725 if( ( m_mode == OPEN && !info->isReadable() ) || ( m_mode == SAVE && !info->isWritable() ) ){
726 locked = true; 726 locked = true;
727 if( symlink ) 727 if( symlink )
728 pix = (*m_pixmaps)["symlinkedlocked"]; 728 pix = (*m_pixmaps)["symlinkedlocked"];
729 else 729 else
@@ -1009,25 +1009,24 @@ bool OFileSelector::compliesMime( const QString& mime ) {
1009 else qWarning("found"), list = it.data(); 1009 else qWarning("found"), list = it.data();
1010 } 1010 }
1011 // dump it now 1011 // dump it now
1012 //for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { 1012 //for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
1013 // qWarning( "%s", (*it).latin1() ); 1013 // qWarning( "%s", (*it).latin1() );
1014 //} 1014 //}
1015 1015
1016 1016
1017 if ( list.contains(mime) ) return true; 1017 if ( list.contains(mime) ) return true;
1018 qWarning("list doesn't contain it "); 1018 qWarning("list doesn't contain it ");
1019 QStringList::Iterator it2; 1019 QStringList::Iterator it2;
1020 int pos; 1020 int pos;
1021 int pos2;
1022 for ( it2 = list.begin(); it2 != list.end(); ++it2 ) { 1021 for ( it2 = list.begin(); it2 != list.end(); ++it2 ) {
1023 pos = (*it2).findRev("/*"); 1022 pos = (*it2).findRev("/*");
1024 if ( pos >= 0 ) { 1023 if ( pos >= 0 ) {
1025 if ( mime.contains( (*it2).left(pos) ) ) return true; 1024 if ( mime.contains( (*it2).left(pos) ) ) return true;
1026 } 1025 }
1027 } 1026 }
1028 return false; 1027 return false;
1029} 1028}
1030void OFileSelector::slotFileSelected( const QString &string ) 1029void OFileSelector::slotFileSelected( const QString &string )
1031{ 1030{
1032 if( m_shLne ) 1031 if( m_shLne )
1033 m_edit->setText( string ); 1032 m_edit->setText( string );
@@ -1096,25 +1095,25 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &
1096 } 1095 }
1097 } 1096 }
1098} 1097}
1099void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoint &, int ) 1098void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoint &, int )
1100{ 1099{
1101 if( item == 0 ) 1100 if( item == 0 )
1102 return; 1101 return;
1103 1102
1104 if( button != Qt::RightButton ) 1103 if( button != Qt::RightButton )
1105 return; 1104 return;
1106 slotContextMenu( item ); 1105 slotContextMenu( item );
1107} 1106}
1108void OFileSelector::slotContextMenu( QListViewItem *item) 1107void OFileSelector::slotContextMenu( QListViewItem * /*item*/)
1109{ 1108{
1110 1109
1111} 1110}
1112void OFileSelector::slotChangedDir() 1111void OFileSelector::slotChangedDir()
1113{ 1112{
1114 OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); 1113 OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem();
1115 if(sel->isDir() ){ 1114 if(sel->isDir() ){
1116 QStringList str = QStringList::split("->", sel->text(1) ); 1115 QStringList str = QStringList::split("->", sel->text(1) );
1117 cd( sel->directory() + "/" + str[0].stripWhiteSpace() ); 1116 cd( sel->directory() + "/" + str[0].stripWhiteSpace() );
1118 } 1117 }
1119} 1118}
1120void OFileSelector::slotOpen() 1119void OFileSelector::slotOpen()