Diffstat (limited to 'noncore/apps/confedit/listviewconfdir.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/confedit/listviewconfdir.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/noncore/apps/confedit/listviewconfdir.cpp b/noncore/apps/confedit/listviewconfdir.cpp new file mode 100644 index 0000000..b76e425 --- a/dev/null +++ b/noncore/apps/confedit/listviewconfdir.cpp @@ -0,0 +1,53 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + // (c) 2002 Patrick S. Vogtp <tille@handhelds.org> + +#include "listviewconfdir.h" + +#include <qmessagebox.h> + +#include "listviewitemconffile.h" + +ListViewConfDir::ListViewConfDir(QString settingsPath, QWidget *parent, const char *name ) + : QListView(parent,name), confDir(settingsPath) +{ + + setRootIsDecorated( true ); + addColumn(tr("Files")); + + if (!confDir.isReadable()) + QMessageBox::critical(this,tr("Could not open"),tr("The directory ")+settingsPath+tr(" could not be opened."),1,0); + readConfFiles(); +} + + +ListViewConfDir::~ListViewConfDir() +{ +} + +void ListViewConfDir::readConfFiles() +{ + + confDir.setFilter( QDir::Files | QDir::NoSymLinks ); + confDir.setSorting( QDir::Name ); + + const QFileInfoList *list = confDir.entryInfoList(); + QFileInfoListIterator it( *list ); + QFileInfo *fi; + + ListViewItemConfFile *fileEntry; + + while ( (fi=it.current()) ) + { + qDebug( "opening: >%s<", fi->fileName().data() ); + fileEntry = new ListViewItemConfFile( fi, this ); + + ++it; + } +}
\ No newline at end of file |