-rw-r--r-- | libopie/ofileselector/ofileselector.cpp | 15 | ||||
-rw-r--r-- | libopie/ofileselector/olister.cpp | 10 | ||||
-rw-r--r-- | libopie/ofileselector/olister.h | 18 | ||||
-rw-r--r-- | libopie/ofileselector/olocallister.cpp | 29 | ||||
-rw-r--r-- | libopie/ofileselector/olocallister.h | 5 |
5 files changed, 62 insertions, 15 deletions
diff --git a/libopie/ofileselector/ofileselector.cpp b/libopie/ofileselector/ofileselector.cpp index 255e79e..9ce07dd 100644 --- a/libopie/ofileselector/ofileselector.cpp +++ b/libopie/ofileselector/ofileselector.cpp | |||
@@ -264,4 +264,2 @@ void OFileSelector::setPopupFactory(OPopupMenuFactory */*popup*/ ) | |||
264 | 264 | ||
265 | //void OFileSelector::updateL | ||
266 | |||
267 | QString OFileSelector::selectedName() const | 265 | QString OFileSelector::selectedName() const |
@@ -273,7 +271,3 @@ QString OFileSelector::selectedName() const | |||
273 | }else { | 271 | }else { |
274 | if ( m_shLne ) { | 272 | name = currentLister()->selectedName(); |
275 | name = m_currentDir + "/" +m_edit->text(); | ||
276 | }else{ | ||
277 | name = m_currentDir + "/" + currentView()->selectedName(); | ||
278 | } | ||
279 | } | 273 | } |
@@ -424,3 +418,2 @@ void OFileSelector::slotLocationActivated(const QString &file) | |||
424 | cd(name ); | 418 | cd(name ); |
425 | reparse(); | ||
426 | } | 419 | } |
@@ -456,4 +449,2 @@ void OFileSelector::locationComboChanged() | |||
456 | cd( m_location->lineEdit()->text() ); | 449 | cd( m_location->lineEdit()->text() ); |
457 | |||
458 | reparse(); | ||
459 | } | 450 | } |
@@ -856,2 +847,4 @@ void OFileSelector::cdUP() | |||
856 | { | 847 | { |
848 | // FIXME won't work on non filesystem based systems | ||
849 | // better call the Olister | ||
857 | QDir dir( m_currentDir ); | 850 | QDir dir( m_currentDir ); |
@@ -864,4 +857,2 @@ void OFileSelector::cdUP() | |||
864 | m_location->setCurrentItem( indexByString( m_location, m_currentDir)); | 857 | m_location->setCurrentItem( indexByString( m_location, m_currentDir)); |
865 | //this wont work in all instances | ||
866 | // FIXME | ||
867 | } | 858 | } |
diff --git a/libopie/ofileselector/olister.cpp b/libopie/ofileselector/olister.cpp index ea09940..aaaf6a2 100644 --- a/libopie/ofileselector/olister.cpp +++ b/libopie/ofileselector/olister.cpp | |||
@@ -1,2 +1,3 @@ | |||
1 | #include <qcombobox.h> | 1 | #include <qcombobox.h> |
2 | #include <qlineedit.h> | ||
2 | 3 | ||
@@ -114,2 +115,5 @@ OFileSelector* OLister::view() { | |||
114 | } | 115 | } |
116 | OFileSelector* OLister::view()const { | ||
117 | return m_view; | ||
118 | } | ||
115 | OPixmapProvider* OLister::provider() { | 119 | OPixmapProvider* OLister::provider() { |
@@ -171 +175,7 @@ QString OListerCmbAccess::currentText()const { | |||
171 | } | 175 | } |
176 | QString OLister::lineEdit()const { | ||
177 | if ( view()->m_shLne ) | ||
178 | return view()->m_edit->text(); | ||
179 | |||
180 | return QString::null; | ||
181 | } | ||
diff --git a/libopie/ofileselector/olister.h b/libopie/ofileselector/olister.h index cd84316..4adb9f8 100644 --- a/libopie/ofileselector/olister.h +++ b/libopie/ofileselector/olister.h | |||
@@ -25,3 +25,7 @@ public: | |||
25 | virtual ~OLister(); | 25 | virtual ~OLister(); |
26 | virtual void reparse(const QString& path) = 0; | 26 | |
27 | /** | ||
28 | * if path == QString::null reread current dir | ||
29 | */ | ||
30 | virtual void reparse(const QString& path = QString::null ) = 0; | ||
27 | 31 | ||
@@ -37,2 +41,4 @@ public: | |||
37 | virtual void changedDir( const QString& dir, const QString& file, const QString& extra ) = 0; | 41 | virtual void changedDir( const QString& dir, const QString& file, const QString& extra ) = 0; |
42 | virtual QString selectedName()const = 0; | ||
43 | virtual QStringList selectedNames()const = 0; | ||
38 | protected: | 44 | protected: |
@@ -79,2 +85,3 @@ protected: | |||
79 | OFileSelector* view(); | 85 | OFileSelector* view(); |
86 | OFileSelector* view()const; | ||
80 | OPixmapProvider* provider(); | 87 | OPixmapProvider* provider(); |
@@ -82,2 +89,11 @@ protected: | |||
82 | void internChangedDir( const QString& dir ); | 89 | void internChangedDir( const QString& dir ); |
90 | |||
91 | /** | ||
92 | * try to take | ||
93 | * the text from the mainwindows | ||
94 | * lineedit | ||
95 | * if it's not available QString::null | ||
96 | * will be returned | ||
97 | */ | ||
98 | QString lineEdit()const; | ||
83 | private: | 99 | private: |
diff --git a/libopie/ofileselector/olocallister.cpp b/libopie/ofileselector/olocallister.cpp index 5d7884d..4d36d64 100644 --- a/libopie/ofileselector/olocallister.cpp +++ b/libopie/ofileselector/olocallister.cpp | |||
@@ -7,2 +7,3 @@ | |||
7 | #include "ofileselector.h" | 7 | #include "ofileselector.h" |
8 | #include "ofileview.h" | ||
8 | #include "olocallister.h" | 9 | #include "olocallister.h" |
@@ -12,2 +13,3 @@ OLocalLister::OLocalLister( OFileSelector* file ) | |||
12 | { | 13 | { |
14 | m_dir = QDir::homeDirPath(); | ||
13 | } | 15 | } |
@@ -53,5 +55,8 @@ QMap<QString, QStringList> OLocalLister::mimeTypes( const QString& curDir ) { | |||
53 | */ | 55 | */ |
54 | void OLocalLister::reparse( const QString& path ) { | 56 | void OLocalLister::reparse( const QString& pa ) { |
57 | if (!pa.isEmpty() ) | ||
58 | m_dir = pa; | ||
59 | |||
55 | QString currentMimeType; | 60 | QString currentMimeType; |
56 | QDir dir( path ); | 61 | QDir dir( m_dir ); |
57 | 62 | ||
@@ -125 +130,21 @@ void OLocalLister::changedDir( const QString& dir, const QString& file, const QS | |||
125 | } | 130 | } |
131 | /* | ||
132 | * assemble the the Url now | ||
133 | */ | ||
134 | QString OLocalLister::selectedName()const { | ||
135 | QString str = m_dir; | ||
136 | QString name = lineEdit(); | ||
137 | |||
138 | if ( name.isEmpty() ) | ||
139 | name = view()->currentView()->selectedName(); | ||
140 | |||
141 | str += "/" + name; | ||
142 | |||
143 | return str; | ||
144 | } | ||
145 | QStringList OLocalLister::selectedNames()const { | ||
146 | QStringList list; | ||
147 | list << selectedName(); | ||
148 | |||
149 | return list; | ||
150 | } | ||
diff --git a/libopie/ofileselector/olocallister.h b/libopie/ofileselector/olocallister.h index 01e6f3c..0cdf51f 100644 --- a/libopie/ofileselector/olocallister.h +++ b/libopie/ofileselector/olocallister.h | |||
@@ -13,2 +13,7 @@ public: | |||
13 | void changedDir( const QString& dir, const QString& file,const QString& ); | 13 | void changedDir( const QString& dir, const QString& file,const QString& ); |
14 | QString selectedName()const; | ||
15 | QStringList selectedNames()const; | ||
16 | |||
17 | private: | ||
18 | QString m_dir; | ||
14 | }; | 19 | }; |