-rw-r--r-- | libopie/ofileselector/ofiledialog.cpp | 4 | ||||
-rw-r--r-- | libopie/ofileselector/ofilelistview.cpp | 43 | ||||
-rw-r--r-- | libopie/ofileselector/ofileselector.cpp | 56 | ||||
-rw-r--r-- | libopie/ofileselector/ofileselector.h | 2 | ||||
-rw-r--r-- | libopie/ofileselector/ofileview.cpp | 3 | ||||
-rw-r--r-- | libopie/ofileselector/ofileview.h | 2 |
6 files changed, 69 insertions, 41 deletions
diff --git a/libopie/ofileselector/ofiledialog.cpp b/libopie/ofileselector/ofiledialog.cpp index 4783004..430def2 100644 --- a/libopie/ofileselector/ofiledialog.cpp +++ b/libopie/ofileselector/ofiledialog.cpp | |||
@@ -82,5 +82,5 @@ QString OFileDialog::getOpenFileName(int selector, | |||
82 | QString ret; | 82 | QString ret; |
83 | OFileDialog dlg( caption.isEmpty() ? tr("Open") : caption, | 83 | OFileDialog dlg( caption.isEmpty() ? tr("Open") : caption, |
84 | wid, OFileSelector::OPEN, selector, startDir, file, mimes); | 84 | wid, OFileSelector::Open, selector, startDir, file, mimes); |
85 | dlg.showMaximized(); | 85 | dlg.showMaximized(); |
86 | if( dlg.exec() ) | 86 | if( dlg.exec() ) |
@@ -98,5 +98,5 @@ QString OFileDialog::getSaveFileName(int selector, | |||
98 | QString ret; | 98 | QString ret; |
99 | OFileDialog dlg( caption.isEmpty() ? tr("Save") : caption, | 99 | OFileDialog dlg( caption.isEmpty() ? tr("Save") : caption, |
100 | wid, OFileSelector::SAVE, selector, startDir, file, mimes); | 100 | wid, OFileSelector::Save, selector, startDir, file, mimes); |
101 | dlg.showMaximized(); | 101 | dlg.showMaximized(); |
102 | if( dlg.exec() ) | 102 | if( dlg.exec() ) |
diff --git a/libopie/ofileselector/ofilelistview.cpp b/libopie/ofileselector/ofilelistview.cpp index 0c7d45b..7108a5b 100644 --- a/libopie/ofileselector/ofilelistview.cpp +++ b/libopie/ofileselector/ofilelistview.cpp | |||
@@ -1,3 +1,6 @@ | |||
1 | 1 | ||
2 | #include <qpe/mimetype.h> | ||
3 | #include <qpe/resource.h> | ||
4 | |||
2 | #include "ofileselector.h" | 5 | #include "ofileselector.h" |
3 | #include "ofileselectoritem.h" | 6 | #include "ofileselectoritem.h" |
@@ -16,5 +19,5 @@ void OFileListView::clear() { | |||
16 | QListView::clear(); | 19 | QListView::clear(); |
17 | } | 20 | } |
18 | void OFileListView::addFile( const QString& mime, | 21 | void OFileListView::addFile( const QString&, |
19 | QFileInfo* info, | 22 | QFileInfo* info, |
20 | bool isSymlink ) { | 23 | bool isSymlink ) { |
@@ -34,6 +37,6 @@ void OFileListView::addFile( const QString& mime, | |||
34 | else { | 37 | else { |
35 | name = info->fileName(); | 38 | name = info->fileName(); |
36 | if( ( selector()->mode() == Open && !info->isReadable() )|| | 39 | if( ( selector()->mode() == OFileSelector::Open && !info->isReadable() ) || |
37 | ( selector()->mode() == Save && !info->isWritable() ) ){ | 40 | ( selector()->mode() == OFileSelector::Save && !info->isWritable() ) ){ |
38 | 41 | ||
39 | locked = true; pix = Resource::loadPixmap("locked"); | 42 | locked = true; pix = Resource::loadPixmap("locked"); |
@@ -49,6 +52,6 @@ void OFileListView::addFile( const QString& /*mime*/, const QString& /*dir*/, | |||
49 | 52 | ||
50 | } | 53 | } |
51 | void OFileListView::addDir( const QString& mime, | 54 | void OFileListView::addDir( const QString&, |
52 | QFileInfo* info, bool isSym ) { | 55 | QFileInfo* info, bool symlink ) { |
53 | 56 | ||
54 | bool locked = false; | 57 | bool locked = false; |
@@ -56,6 +59,6 @@ void OFileListView::addDir( const QString& mime, | |||
56 | QPixmap pix; | 59 | QPixmap pix; |
57 | 60 | ||
58 | if( ( selector()->mode() == Open && !info->isReadable() ) || | 61 | if( ( selector()->mode() == OFileSelector::Open && !info->isReadable() ) || |
59 | ( selector()->mode() == Save && !info->isWritable() ) ){ | 62 | ( selector()->mode() == OFileSelector::Save && !info->isWritable() ) ){ |
60 | 63 | ||
61 | locked = true; | 64 | locked = true; |
@@ -79,15 +82,15 @@ void OFileListView::addDir( const QString& mime, | |||
79 | 82 | ||
80 | } | 83 | } |
81 | void OFileListView::addDir( const QString& mime, const QString& dir, | 84 | void OFileListView::addDir( const QString& /*mime*/, const QString& /*dir*/, |
82 | const QString& file, bool ) { | 85 | const QString& /*file*/, bool ) { |
83 | 86 | ||
84 | } | 87 | } |
85 | void OFileListView::addSymlink( const QString& mime, | 88 | void OFileListView::addSymlink( const QString& /*mime*/, |
86 | QFileInfo* info, | 89 | QFileInfo* /*info*/, |
87 | bool isSym ) { | 90 | bool /*isSym*/ ) { |
88 | 91 | ||
89 | } | 92 | } |
90 | void OFileListView::addSymlink( const QString& mime, const QString& path, | 93 | void OFileListView::addSymlink( const QString& /*mime*/, const QString& /*path*/, |
91 | const QString& file, bool isSym ) { | 94 | const QString& /*file*/, bool /*isSym*/ ) { |
92 | 95 | ||
93 | } | 96 | } |
@@ -106,11 +109,15 @@ QString OFileListView::selectedName()const{ | |||
106 | } | 109 | } |
107 | QStringList OFileListView::selectedNames()const { | 110 | QStringList OFileListView::selectedNames()const { |
108 | 111 | QStringList list; | |
112 | list << selectedName(); | ||
113 | return list; | ||
109 | } | 114 | } |
110 | QString OFileListView::selectedPath()const { | 115 | QString OFileListView::selectedPath()const { |
111 | 116 | return QString::null; | |
112 | } | 117 | } |
113 | QString OFileListView::selectedPaths()const { | 118 | QStringList OFileListView::selectedPaths()const { |
114 | 119 | QStringList list; | |
120 | list << selectedPath(); | ||
121 | return list; | ||
115 | } | 122 | } |
116 | int OFileListView::fileCount() { | 123 | int OFileListView::fileCount() { |
diff --git a/libopie/ofileselector/ofileselector.cpp b/libopie/ofileselector/ofileselector.cpp index f655606..16ee3ee 100644 --- a/libopie/ofileselector/ofileselector.cpp +++ b/libopie/ofileselector/ofileselector.cpp | |||
@@ -247,5 +247,5 @@ bool OFileSelector::cd(const QString &path ) | |||
247 | void OFileSelector::setSelector(int mode ) | 247 | void OFileSelector::setSelector(int mode ) |
248 | { | 248 | { |
249 | QString text; | 249 | QString text; |
250 | switch( mode ){ | 250 | switch( mode ){ |
251 | case Normal: | 251 | case Normal: |
@@ -262,5 +262,5 @@ QString text; | |||
262 | } | 262 | } |
263 | 263 | ||
264 | void OFileSelector::setPopupFactory(OPopupMenuFactory *popup ) | 264 | void OFileSelector::setPopupFactory(OPopupMenuFactory */*popup*/ ) |
265 | { | 265 | { |
266 | /* m_custom = popup; | 266 | /* m_custom = popup; |
@@ -275,7 +275,7 @@ QString OFileSelector::selectedName() const | |||
275 | QString name; | 275 | QString name; |
276 | if( m_selector == Normal ){ | 276 | if( m_selector == Normal ){ |
277 | DocLnk lnk = m_select->selectedDocument(); | 277 | DocLnk lnk = m_select->selectedDocument(); |
278 | name = lnk.file(); | 278 | name = lnk.file(); |
279 | }else if( m_selector == Extended || m_selector == ExtendedAll ){ | 279 | }else { |
280 | if ( m_shLne ) { | 280 | if ( m_shLne ) { |
281 | name = m_currentDir + "/" +m_edit->text(); | 281 | name = m_currentDir + "/" +m_edit->text(); |
@@ -305,7 +305,7 @@ QString OFileSelector::selectedPath()const | |||
305 | if( m_selector == Normal ){ | 305 | if( m_selector == Normal ){ |
306 | path = QPEApplication::documentDir(); | 306 | path = QPEApplication::documentDir(); |
307 | }else if( m_selector == Extended || m_selector == ExtendedAll ){ | 307 | } /*else if( m_selector == Extended || m_selector == ExtendedAll ){ |
308 | ; //FIXME | 308 | ; |
309 | } | 309 | }*/ |
310 | return path; | 310 | return path; |
311 | } | 311 | } |
@@ -334,5 +334,5 @@ int OFileSelector::fileCount() | |||
334 | case ExtendedAll: | 334 | case ExtendedAll: |
335 | default: | 335 | default: |
336 | count = currentView()->childCount(); | 336 | count = currentView()->fileCount(); |
337 | break; | 337 | break; |
338 | } | 338 | } |
@@ -350,5 +350,5 @@ DocLnk OFileSelector::selectedDocument() const | |||
350 | case ExtendedAll: | 350 | case ExtendedAll: |
351 | default: | 351 | default: |
352 | lnk = DocLnk( selectedName() ); // new DocLnk | 352 | lnk = DocLnk( selectedName() ); |
353 | break; | 353 | break; |
354 | } | 354 | } |
@@ -373,4 +373,5 @@ void OFileSelector::slotCancel() | |||
373 | emit cancel(); | 373 | emit cancel(); |
374 | } | 374 | } |
375 | /* switch the views */ | ||
375 | void OFileSelector::slotViewCheck(const QString &sel) | 376 | void OFileSelector::slotViewCheck(const QString &sel) |
376 | { | 377 | { |
@@ -405,5 +406,5 @@ void OFileSelector::slotViewCheck(const QString &sel) | |||
405 | } | 406 | } |
406 | } | 407 | } |
407 | // not yet finished..... | 408 | |
408 | QString OFileSelector::currentMimeType() const{ | 409 | QString OFileSelector::currentMimeType() const{ |
409 | QString mime; | 410 | QString mime; |
@@ -632,5 +633,5 @@ void OFileSelector::initVars() | |||
632 | m_close = 0; | 633 | m_close = 0; |
633 | } | 634 | } |
634 | void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink) | 635 | void OFileSelector::addFile(const QString &, QFileInfo *info, bool ) |
635 | { | 636 | { |
636 | if(!m_files) | 637 | if(!m_files) |
@@ -643,5 +644,5 @@ void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink) | |||
643 | 644 | ||
644 | } | 645 | } |
645 | void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink ) | 646 | void OFileSelector::addDir(const QString &, QFileInfo *, bool ) |
646 | { | 647 | { |
647 | if(!m_dir) | 648 | if(!m_dir) |
@@ -926,5 +927,4 @@ bool OFileSelector::compliesMime( const QString& mime ) { | |||
926 | QStringList::Iterator it2; | 927 | QStringList::Iterator it2; |
927 | int pos; | 928 | int pos; |
928 | int pos2; | ||
929 | for ( it2 = list.begin(); it2 != list.end(); ++it2 ) { | 929 | for ( it2 = list.begin(); it2 != list.end(); ++it2 ) { |
930 | pos = (*it2).findRev("/*"); | 930 | pos = (*it2).findRev("/*"); |
@@ -950,6 +950,7 @@ void OFileSelector::slotSelectionChanged() | |||
950 | 950 | ||
951 | } | 951 | } |
952 | void OFileSelector::slotCurrentChanged(QListViewItem* item ) | 952 | void OFileSelector::slotCurrentChanged(QListViewItem* /*item*/ ) |
953 | { | 953 | { |
954 | /* | ||
954 | if( item == 0 ) | 955 | if( item == 0 ) |
955 | return; | 956 | return; |
@@ -969,8 +970,10 @@ void OFileSelector::slotCurrentChanged(QListViewItem* item ) | |||
969 | } | 970 | } |
970 | } | 971 | } |
971 | } | 972 | } */ |
972 | } | 973 | } |
973 | void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &, int) | 974 | void OFileSelector::slotClicked( int /*button*/, QListViewItem */*item*/, const QPoint &, int) |
975 | |||
974 | { | 976 | { |
977 | /* | ||
975 | if ( item == 0 ) | 978 | if ( item == 0 ) |
976 | return; | 979 | return; |
@@ -982,5 +985,5 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint & | |||
982 | default: | 985 | default: |
983 | break; | 986 | break; |
984 | case Extended: // fall through | 987 | case Extended: // fall through |
985 | case ExtendedAll:{ | 988 | case ExtendedAll:{ |
986 | OFileSelectorItem *sel = (OFileSelectorItem*)item; | 989 | OFileSelectorItem *sel = (OFileSelectorItem*)item; |
@@ -1002,5 +1005,5 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint & | |||
1002 | break; | 1005 | break; |
1003 | } | 1006 | } |
1004 | } | 1007 | } */ |
1005 | } | 1008 | } |
1006 | void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoint &, int ) | 1009 | void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoint &, int ) |
@@ -1013,5 +1016,5 @@ void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoin | |||
1013 | slotContextMenu( item ); | 1016 | slotContextMenu( item ); |
1014 | } | 1017 | } |
1015 | void OFileSelector::slotContextMenu( QListViewItem *item) | 1018 | void OFileSelector::slotContextMenu( QListViewItem */*item*/) |
1016 | { | 1019 | { |
1017 | 1020 | ||
@@ -1019,4 +1022,5 @@ void OFileSelector::slotContextMenu( QListViewItem *item) | |||
1019 | void OFileSelector::slotChangedDir() | 1022 | void OFileSelector::slotChangedDir() |
1020 | { | 1023 | { |
1024 | /* | ||
1021 | OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); | 1025 | OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); |
1022 | if(sel->isDir() ){ | 1026 | if(sel->isDir() ){ |
@@ -1024,7 +1028,9 @@ void OFileSelector::slotChangedDir() | |||
1024 | cd( sel->directory() + "/" + str[0].stripWhiteSpace() ); | 1028 | cd( sel->directory() + "/" + str[0].stripWhiteSpace() ); |
1025 | } | 1029 | } |
1030 | */ | ||
1026 | } | 1031 | } |
1027 | void OFileSelector::slotOpen() | 1032 | void OFileSelector::slotOpen() |
1028 | { | 1033 | { |
1034 | /* | ||
1029 | OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); | 1035 | OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); |
1030 | if(!sel->isDir() ){ | 1036 | if(!sel->isDir() ){ |
@@ -1035,4 +1041,5 @@ void OFileSelector::slotOpen() | |||
1035 | //emit fileSelected( lnk ); | 1041 | //emit fileSelected( lnk ); |
1036 | } | 1042 | } |
1043 | */ | ||
1037 | } | 1044 | } |
1038 | void OFileSelector::slotRescan() | 1045 | void OFileSelector::slotRescan() |
@@ -1046,4 +1053,5 @@ void OFileSelector::slotRename() | |||
1046 | void OFileSelector::slotDelete() | 1053 | void OFileSelector::slotDelete() |
1047 | { | 1054 | { |
1055 | /* | ||
1048 | OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); | 1056 | OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); |
1049 | QStringList list = QStringList::split("->", sel->text(1) ); | 1057 | QStringList list = QStringList::split("->", sel->text(1) ); |
@@ -1061,4 +1069,5 @@ void OFileSelector::slotDelete() | |||
1061 | m_View->takeItem( sel ); | 1069 | m_View->takeItem( sel ); |
1062 | delete sel; | 1070 | delete sel; |
1071 | */ | ||
1063 | } | 1072 | } |
1064 | void OFileSelector::cdUP() | 1073 | void OFileSelector::cdUP() |
@@ -1211,4 +1220,7 @@ OFileView* OFileSelector::currentView() { | |||
1211 | return 0l; | 1220 | return 0l; |
1212 | } | 1221 | } |
1222 | OFileView* OFileSelector::currentView() const{ | ||
1223 | return 0l; | ||
1224 | } | ||
1213 | int OFileSelector::filter() { | 1225 | int OFileSelector::filter() { |
1214 | int filter; | 1226 | int filter; |
@@ -1245,2 +1257,6 @@ void OFileSelector::internChangedDir( const QDir& s) { | |||
1245 | emit dirSelected( s ); | 1257 | emit dirSelected( s ); |
1246 | } | 1258 | } |
1259 | QPixmap OFileSelector::pixmap( const QString& s ) { | ||
1260 | |||
1261 | return (*m_pixmaps)[s]; | ||
1262 | } | ||
diff --git a/libopie/ofileselector/ofileselector.h b/libopie/ofileselector/ofileselector.h index 937569d..12af732 100644 --- a/libopie/ofileselector/ofileselector.h +++ b/libopie/ofileselector/ofileselector.h | |||
@@ -337,6 +337,8 @@ class OFileSelector : public QWidget { | |||
337 | 337 | ||
338 | OFileView* currentView(); | 338 | OFileView* currentView(); |
339 | OFileView* currentView()const; | ||
339 | int filter(); | 340 | int filter(); |
340 | int sorting(); | 341 | int sorting(); |
342 | QPixmap pixmap( const QString& ); | ||
341 | 343 | ||
342 | signals: | 344 | signals: |
diff --git a/libopie/ofileselector/ofileview.cpp b/libopie/ofileselector/ofileview.cpp index 71843c1..9bb40c9 100644 --- a/libopie/ofileselector/ofileview.cpp +++ b/libopie/ofileselector/ofileview.cpp | |||
@@ -27,2 +27,5 @@ void OFileView::changedDir( const QDir& d ) { | |||
27 | m_sel->internChangedDir( d ); | 27 | m_sel->internChangedDir( d ); |
28 | } | 28 | } |
29 | OFileSelector* OFileView::selector() const { | ||
30 | return m_sel; | ||
31 | } | ||
diff --git a/libopie/ofileselector/ofileview.h b/libopie/ofileselector/ofileview.h index 997266a..1b397f5 100644 --- a/libopie/ofileselector/ofileview.h +++ b/libopie/ofileselector/ofileview.h | |||
@@ -91,5 +91,5 @@ protected: | |||
91 | void changedDir(const QString &); | 91 | void changedDir(const QString &); |
92 | void changedDir(const QDir & ); | 92 | void changedDir(const QDir & ); |
93 | OFileSelector* selector(); | 93 | OFileSelector* selector()const; |
94 | 94 | ||
95 | private: | 95 | private: |