summaryrefslogtreecommitdiff
authorskyhusker <skyhusker>2005-03-06 19:31:56 (UTC)
committer skyhusker <skyhusker>2005-03-06 19:31:56 (UTC)
commit578cc81bc489015320351efd4fabcbed3355ac23 (patch) (side-by-side diff)
treef40c155e58a993759b662e09b56051d8eb93cb49
parenta81251b503cba26ad326ac6c68a80a2930bef896 (diff)
downloadopie-578cc81bc489015320351efd4fabcbed3355ac23.zip
opie-578cc81bc489015320351efd4fabcbed3355ac23.tar.gz
opie-578cc81bc489015320351efd4fabcbed3355ac23.tar.bz2
Fix bug 1600: Removing . from directory listing
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/impl/dir/dir_lister.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp b/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp
index ff33cf2..5706598 100644
--- a/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp
+++ b/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp
@@ -27,49 +27,52 @@ Dir_DirLister::Dir_DirLister( bool list,bool rec,int recdepth )
owarn << "All Files " << m_allFiles << "" << oendl;
SlaveHelper::slaveConnectSignals( this );
m_Filter = (m_allFiles?"*":"*.jpg;*.jpeg;*.JPG;*.PNG;*.GIF;*.BMP;*.png;*.bmp;*.gif");
}
QString Dir_DirLister::defaultPath()const {
return QPEApplication::documentDir();
}
QString Dir_DirLister::setStartPath( const QString& path ) {
m_currentDir.cd( path );
if (!m_currentDir.exists() )
m_currentDir.cd(defaultPath());
return m_currentDir.absPath();
}
QString Dir_DirLister::currentPath()const {
return m_currentDir.absPath();
}
QStringList Dir_DirLister::folders()const {
- return m_currentDir.entryList( QDir::Dirs );
+ QStringList dirs = m_currentDir.entryList( QDir::Dirs );
+ dirs.remove(".");
+
+ return dirs;
}
QStringList Dir_DirLister::recFiles(const QString&aPath,int currentDepth)const
{
QStringList all;
if (currentDepth>m_recDepth) return all;
QString subPath;
subPath = aPath;
if (subPath.length()==0) {
subPath=".";
}
QDir checkDir(currentPath()+"/"+aPath);
QStringList p = checkDir.entryList( QDir::Dirs );
all+=checkDir.entryList(m_Filter,QDir::Files|QDir::Readable);
QStringList tmp;
for (unsigned i = 0; i < p.count();++i) {
if (p[i]=="." || p[i]=="..") continue;
tmp =recFiles(subPath+"/"+p[i],currentDepth+1);
for (unsigned j = 0; j < tmp.count();++j) {
all.append(p[i]+"/"+tmp[j]);
}
}