summaryrefslogtreecommitdiff
path: root/libopie/ofileselector/olocallister.cpp
authorzecke <zecke>2002-10-29 19:08:40 (UTC)
committer zecke <zecke>2002-10-29 19:08:40 (UTC)
commit2957aae1073f4c41dd6783c41d1199be71cd9f4a (patch) (side-by-side diff)
tree2aa5c4f61105aa151867e170601de58511479fd8 /libopie/ofileselector/olocallister.cpp
parenta575fd4c862693705018902b4482c5135a8cb6a2 (diff)
downloadopie-2957aae1073f4c41dd6783c41d1199be71cd9f4a.zip
opie-2957aae1073f4c41dd6783c41d1199be71cd9f4a.tar.gz
opie-2957aae1073f4c41dd6783c41d1199be71cd9f4a.tar.bz2
the reverse getting of filenames is actually enabled
There will be some code clean ups... but the interfaces should be fine now
Diffstat (limited to 'libopie/ofileselector/olocallister.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector/olocallister.cpp29
1 files changed, 27 insertions, 2 deletions
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
@@ -5,11 +5,13 @@
#include <qpe/mimetype.h>
#include "ofileselector.h"
+#include "ofileview.h"
#include "olocallister.h"
OLocalLister::OLocalLister( OFileSelector* file )
: OLister( file )
{
+ m_dir = QDir::homeDirPath();
}
OLocalLister::~OLocalLister() {
}
@@ -51,9 +53,12 @@ QMap<QString, QStringList> OLocalLister::mimeTypes( const QString& curDir ) {
* filter files
* filter mimetypes
*/
-void OLocalLister::reparse( const QString& path ) {
+void OLocalLister::reparse( const QString& pa ) {
+ if (!pa.isEmpty() )
+ m_dir = pa;
+
QString currentMimeType;
- QDir dir( path );
+ QDir dir( m_dir );
dir.setSorting( view()->sorting() );
dir.setFilter( view()->filter() );
@@ -123,3 +128,23 @@ void OLocalLister::fileSelected( const QString& dir, const QString& file, const
void OLocalLister::changedDir( const QString& dir, const QString& file, const QString& ) {
internChangedDir( dir + "/" + file );
}
+/*
+ * assemble the the Url now
+ */
+QString OLocalLister::selectedName()const {
+ QString str = m_dir;
+ QString name = lineEdit();
+
+ if ( name.isEmpty() )
+ name = view()->currentView()->selectedName();
+
+ str += "/" + name;
+
+ return str;
+}
+QStringList OLocalLister::selectedNames()const {
+ QStringList list;
+ list << selectedName();
+
+ return list;
+}