Diffstat (limited to 'noncore/apps/confedit/listviewconfdir.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/confedit/listviewconfdir.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/noncore/apps/confedit/listviewconfdir.cpp b/noncore/apps/confedit/listviewconfdir.cpp index f466f06..0c2feeb 100644 --- a/noncore/apps/confedit/listviewconfdir.cpp +++ b/noncore/apps/confedit/listviewconfdir.cpp | |||
@@ -15,39 +15,47 @@ | |||
15 | #include "listviewitemconffile.h" | 15 | #include "listviewitemconffile.h" |
16 | 16 | ||
17 | ListViewConfDir::ListViewConfDir(QString settingsPath, QWidget *parent, const char *name ) | 17 | ListViewConfDir::ListViewConfDir(QString settingsPath, QWidget *parent, const char *name ) |
18 | : QListView(parent,name), confDir(settingsPath) | 18 | : QListView(parent,name), confDir(settingsPath) |
19 | { | 19 | { |
20 | 20 | ||
21 | setRootIsDecorated( true ); | 21 | setRootIsDecorated( true ); |
22 | addColumn(tr("Files")); | 22 | addColumn(tr("Files")); |
23 | 23 | ||
24 | if (!confDir.isReadable()) | 24 | if (!confDir.isReadable()) |
25 | QMessageBox::critical(this,tr("Could not open"),tr("The directory ")+settingsPath+tr(" could not be opened."),1,0); | 25 | QMessageBox::critical(this,tr("Could not open"),tr("The directory ")+settingsPath+tr(" could not be opened."),1,0); |
26 | readConfFiles(); | 26 | readConfFiles(); |
27 | |||
28 | connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); | ||
27 | } | 29 | } |
28 | 30 | ||
29 | 31 | ||
30 | ListViewConfDir::~ListViewConfDir() | 32 | ListViewConfDir::~ListViewConfDir() |
31 | { | 33 | { |
32 | } | 34 | } |
33 | 35 | ||
34 | void ListViewConfDir::readConfFiles() | 36 | void ListViewConfDir::readConfFiles() |
35 | { | 37 | { |
36 | 38 | ||
37 | confDir.setFilter( QDir::Files | QDir::NoSymLinks ); | 39 | confDir.setFilter( QDir::Files | QDir::NoSymLinks ); |
38 | confDir.setSorting( QDir::Name ); | 40 | confDir.setSorting( QDir::Name ); |
39 | confDir.setNameFilter("*.conf"); | 41 | confDir.setNameFilter("*.conf"); |
40 | const QFileInfoList *list = confDir.entryInfoList(); | 42 | const QFileInfoList *list = confDir.entryInfoList(); |
41 | QFileInfoListIterator it( *list ); | 43 | QFileInfoListIterator it( *list ); |
42 | QFileInfo *fi; | 44 | QFileInfo *fi; |
43 | 45 | ||
44 | ListViewItemConfFile *fileEntry; | 46 | ListViewItemConfFile *fileEntry; |
45 | 47 | ||
46 | while ( (fi=it.current()) ) | 48 | while ( (fi=it.current()) ) |
47 | { | 49 | { |
48 | qDebug( "opening: >%s<", fi->fileName().data() ); | 50 | qDebug( "opening: >%s<", fi->fileName().data() ); |
49 | fileEntry = new ListViewItemConfFile( fi, this ); | 51 | fileEntry = new ListViewItemConfFile( fi, this ); |
50 | 52 | QListViewItem *dummy = new QListViewItem(fileEntry, "dummy"); | |
51 | ++it; | 53 | ++it; |
52 | } | 54 | } |
53 | } \ No newline at end of file | 55 | } |
56 | |||
57 | void ListViewConfDir::expand(QListViewItem *item) | ||
58 | { | ||
59 | ((ListViewItemConf*)item)->expand(); | ||
60 | } | ||
61 | |||