-rw-r--r-- | libopie/ofileselector/ofileselector.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libopie/ofileselector/ofileselector.cpp b/libopie/ofileselector/ofileselector.cpp index 7f38f5b..4ab744c 100644 --- a/libopie/ofileselector/ofileselector.cpp +++ b/libopie/ofileselector/ofileselector.cpp | |||
@@ -233,36 +233,36 @@ void OFileSelector::setShowFiles(bool show ) | |||
233 | } | 233 | } |
234 | /// | 234 | /// |
235 | bool OFileSelector::cd(const QString &path ) | 235 | bool OFileSelector::cd(const QString &path ) |
236 | { | 236 | { |
237 | m_currentDir = path; | 237 | m_currentDir = path; |
238 | reparse(); | 238 | reparse(); |
239 | return true; | 239 | return true; |
240 | } | 240 | } |
241 | void OFileSelector::setSelector(int mode ) | 241 | void OFileSelector::setSelector(int mode ) |
242 | { | 242 | { |
243 | QString text; | 243 | QString text; |
244 | switch( mode ){ | 244 | switch( mode ){ |
245 | case Normal: | 245 | case Normal: |
246 | text = tr("Documents"); | 246 | text = tr("Documents"); |
247 | break; | 247 | break; |
248 | case Extended: | 248 | case Extended: |
249 | text = tr("Files"); | 249 | text = tr("List View"); |
250 | break; | 250 | break; |
251 | case ExtendedAll: | 251 | case ExtendedAll: |
252 | text = tr("All Files"); | 252 | text = tr("All List View"); |
253 | break; | 253 | break; |
254 | } | 254 | } |
255 | slotViewCheck( text ); | 255 | slotViewCheck( text ); |
256 | } | 256 | } |
257 | 257 | ||
258 | void OFileSelector::setPopupFactory(OPopupMenuFactory */*popup*/ ) | 258 | void OFileSelector::setPopupFactory(OPopupMenuFactory */*popup*/ ) |
259 | { | 259 | { |
260 | /* m_custom = popup; | 260 | /* m_custom = popup; |
261 | m_showPopup = true; | 261 | m_showPopup = true; |
262 | */ | 262 | */ |
263 | } | 263 | } |
264 | 264 | ||
265 | //void OFileSelector::updateL | 265 | //void OFileSelector::updateL |
266 | 266 | ||
267 | QString OFileSelector::selectedName() const | 267 | QString OFileSelector::selectedName() const |
268 | { | 268 | { |
@@ -453,57 +453,56 @@ void OFileSelector::locationComboChanged() | |||
453 | qWarning("info %s %s", info.dirPath(true).latin1(), m_location->lineEdit()->text().latin1() ); | 453 | qWarning("info %s %s", info.dirPath(true).latin1(), m_location->lineEdit()->text().latin1() ); |
454 | if (info.isFile() ) | 454 | if (info.isFile() ) |
455 | cd(info.dirPath(TRUE) ); //absolute path | 455 | cd(info.dirPath(TRUE) ); //absolute path |
456 | else | 456 | else |
457 | cd( m_location->lineEdit()->text() ); | 457 | cd( m_location->lineEdit()->text() ); |
458 | 458 | ||
459 | reparse(); | 459 | reparse(); |
460 | } | 460 | } |
461 | void OFileSelector::init() | 461 | void OFileSelector::init() |
462 | { | 462 | { |
463 | initFactory(); | 463 | initFactory(); |
464 | m_lay = new QVBoxLayout( this ); | 464 | m_lay = new QVBoxLayout( this ); |
465 | m_lay->setSpacing(0 ); | 465 | m_lay->setSpacing(0 ); |
466 | 466 | ||
467 | /* take care of the main view... */ | 467 | /* take care of the main view... */ |
468 | initToolbar(); | 468 | initToolbar(); |
469 | //if( m_shChooser ) // the Chooser for the view and Mimetypes | ||
470 | initializeChooser(); | ||
469 | 471 | ||
470 | /* initialize the file lister */ | 472 | /* initialize the file lister */ |
471 | if( m_selector == Normal ){ | 473 | if( m_selector == Normal ){ |
472 | QString mime; | 474 | QString mime; |
473 | if (!m_autoMime) { | 475 | if (!m_autoMime) { |
474 | if (!m_mimetypes.isEmpty() ) { | 476 | if (!m_mimetypes.isEmpty() ) { |
475 | QMap<QString, QStringList>::Iterator it; | 477 | QMap<QString, QStringList>::Iterator it; |
476 | it = m_mimetypes.begin(); // cause we're in the init | 478 | it = m_mimetypes.begin(); // cause we're in the init |
477 | mime = it.data().join(";"); | 479 | mime = it.data().join(";"); |
478 | } | 480 | } |
479 | } | 481 | } |
480 | initializeOldSelector(); | 482 | initializeOldSelector(); |
481 | }else{ | 483 | }else{ |
482 | initializeView(); | 484 | initializeView(); |
483 | } | 485 | } |
484 | 486 | ||
485 | if( m_shLne ) // the LineEdit with the current FileName | 487 | if( m_shLne ) // the LineEdit with the current FileName |
486 | initializeName(); | 488 | initializeName(); |
487 | 489 | ||
488 | if( m_shPerm ) // the Permission QCheckBox | 490 | if( m_shPerm ) // the Permission QCheckBox |
489 | initializePerm(); | 491 | initializePerm(); |
490 | 492 | ||
491 | if( m_shChooser ) // the Chooser for the view and Mimetypes | ||
492 | initializeChooser(); | ||
493 | |||
494 | if( m_shYesNo ) // the Yes No button row | 493 | if( m_shYesNo ) // the Yes No button row |
495 | initializeYes( ); | 494 | initializeYes( ); |
496 | 495 | ||
497 | if (m_selector != Normal ) | 496 | if (m_selector != Normal ) |
498 | reparse(); | 497 | reparse(); |
499 | } | 498 | } |
500 | void OFileSelector::updateMimes() | 499 | void OFileSelector::updateMimes() |
501 | { | 500 | { |
502 | if( m_autoMime ){ | 501 | if( m_autoMime ){ |
503 | m_mimetypes.clear(); | 502 | m_mimetypes.clear(); |
504 | m_mimetypes.insert( tr("All"), QString::null ); | 503 | m_mimetypes.insert( tr("All"), QString::null ); |
505 | if( m_selector == Normal ){ | 504 | if( m_selector == Normal ){ |
506 | DocLnkSet set; | 505 | DocLnkSet set; |
507 | Global::findDocuments(&set, QString::null ); | 506 | Global::findDocuments(&set, QString::null ); |
508 | QListIterator<DocLnk> dit( set.children() ); | 507 | QListIterator<DocLnk> dit( set.children() ); |
509 | for( ; dit.current(); ++dit ){ | 508 | for( ; dit.current(); ++dit ){ |
@@ -943,32 +942,33 @@ void OFileSelector::setLister(const QString& lister) { | |||
943 | */ | 942 | */ |
944 | m_lister = new OLocalLister(this); | 943 | m_lister = new OLocalLister(this); |
945 | } | 944 | } |
946 | m_listerName = lister; | 945 | m_listerName = lister; |
947 | } | 946 | } |
948 | void OFileSelector::setView( const QString& lis ) { | 947 | void OFileSelector::setView( const QString& lis ) { |
949 | qWarning("setView "); | 948 | qWarning("setView "); |
950 | fillList(); | 949 | fillList(); |
951 | if ( lis == tr("Documents") ) { | 950 | if ( lis == tr("Documents") ) { |
952 | m_selector = Normal; | 951 | m_selector = Normal; |
953 | delete m_lister; | 952 | delete m_lister; |
954 | delete m_fileView; | 953 | delete m_fileView; |
955 | m_lister = 0l; | 954 | m_lister = 0l; |
956 | m_fileView = 0l; | 955 | m_fileView = 0l; |
957 | initializeOldSelector(); | 956 | initializeOldSelector(); |
958 | }else { | 957 | }else { |
958 | qWarning("lis %s", lis.latin1() ); | ||
959 | QString list; | 959 | QString list; |
960 | 960 | ||
961 | delete m_lister; | 961 | delete m_lister; |
962 | delete m_fileView; | 962 | delete m_fileView; |
963 | delete m_select; | 963 | delete m_select; |
964 | m_lister =0l; | 964 | m_lister =0l; |
965 | m_fileView = 0l; | 965 | m_fileView = 0l; |
966 | m_select = 0l; | 966 | m_select = 0l; |
967 | if ( lis.startsWith("All") ) { | 967 | if ( lis.startsWith("All") ) { |
968 | m_selector = ExtendedAll; | 968 | m_selector = ExtendedAll; |
969 | list = lis.mid(4 ).stripWhiteSpace(); | 969 | list = lis.mid(4 ).stripWhiteSpace(); |
970 | } else{ | 970 | } else{ |
971 | list = lis; | 971 | list = lis; |
972 | m_selector = Extended; | 972 | m_selector = Extended; |
973 | } | 973 | } |
974 | setLister(m_listerName); | 974 | setLister(m_listerName); |
@@ -1079,22 +1079,22 @@ void OFileSelector::initializeOldSelector() { | |||
1079 | this, SIGNAL(closeMe() ) ); | 1079 | this, SIGNAL(closeMe() ) ); |
1080 | //connect to close me and other signals as well | 1080 | //connect to close me and other signals as well |
1081 | m_mainView->setWidget( m_select ); | 1081 | m_mainView->setWidget( m_select ); |
1082 | } | 1082 | } |
1083 | /* | 1083 | /* |
1084 | * initialize the listview | 1084 | * initialize the listview |
1085 | * we will call fillList | 1085 | * we will call fillList |
1086 | * setLister | 1086 | * setLister |
1087 | * with QString::null to get the default | 1087 | * with QString::null to get the default |
1088 | * setView with either Files or All Files | 1088 | * setView with either Files or All Files |
1089 | * depending on Extended | 1089 | * depending on Extended |
1090 | */ | 1090 | */ |
1091 | void OFileSelector::initializeView() { | 1091 | void OFileSelector::initializeView() { |
1092 | setLister(QString::null); | 1092 | setLister(QString::null); |
1093 | fillList(); | 1093 | fillList(); |
1094 | if (m_selector == Extended ) { | 1094 | if (m_selector == Extended ) { |
1095 | setView( tr("Files") ); | 1095 | setView( tr("List View") ); |
1096 | }else{ | 1096 | }else{ |
1097 | setView( tr("All Files") ); | 1097 | setView( tr("All List View") ); |
1098 | } | 1098 | } |
1099 | } | 1099 | } |
1100 | 1100 | ||