diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 11:49:27 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 11:49:27 -0500 |
commit | c3f8ee64e905cdb103b5bfa07525fb4e85c31120 (patch) | |
tree | 46eabe44a1b3af79971dcafb743a104af8e18e69 /src/kbdirinfo.cpp | |
download | kasablanca-c3f8ee64e905cdb103b5bfa07525fb4e85c31120.tar.gz kasablanca-c3f8ee64e905cdb103b5bfa07525fb4e85c31120.zip |
Initial import of kasablanca 0.4.0.2
Diffstat (limited to 'src/kbdirinfo.cpp')
-rw-r--r-- | src/kbdirinfo.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/kbdirinfo.cpp b/src/kbdirinfo.cpp new file mode 100644 index 0000000..8f913d2 --- /dev/null +++ b/src/kbdirinfo.cpp @@ -0,0 +1,53 @@ +// +// C++ Implementation: kbdirinfo +// +// Description: +// +// +// Author: Magnus Kulke <mkulke@magnusmachine>, (C) 2004 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include <qregexp.h> + +#include <list> + +#include "kbconfig.h" +#include "kbdirinfo.h" + +using namespace std; + +KbDirInfo::KbDirInfo(KbFileInfo info) : KbFileInfo(info) +{ +} + +KbDirInfo::KbDirInfo(QString path) : KbFileInfo(path) +{ +} + +KbDirInfo::~KbDirInfo() +{ +} + +bool KbDirInfo::PrioritySort(const KbDirInfo *f1, const KbDirInfo *f2) +{ + QRegExp m_prioritylist(KbConfig::prioritylist()); + + if ((m_prioritylist.search(f1->fileName()) >= 0) > (m_prioritylist.search(f2->fileName()) >= 0)) return true; + else return false; +} + +KbDirInfo* KbDirInfo::AddDirectory(KbFileInfo info) +{ + if ((info.fileName() == ".") || (info.fileName() == "..")) return NULL; + KbDirInfo* dir = new KbDirInfo(info); + m_dirlist.push_back(dir); + return dir; +} + +void KbDirInfo::AddFile(KbFileInfo* file) +{ + m_filelist.push_back(file); +} |