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, 8 insertions, 4 deletions
diff --git a/noncore/apps/confedit/listviewconfdir.cpp b/noncore/apps/confedit/listviewconfdir.cpp index 0c2feeb..33bffe1 100644 --- a/noncore/apps/confedit/listviewconfdir.cpp +++ b/noncore/apps/confedit/listviewconfdir.cpp | |||
@@ -1,61 +1,65 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogtp <tille@handhelds.org> | 9 | // (c) 2002 Patrick S. Vogtp <tille@handhelds.org> |
10 | 10 | ||
11 | #include "listviewconfdir.h" | 11 | #include "listviewconfdir.h" |
12 | #include "listviewitemconffile.h" | ||
12 | 13 | ||
13 | #include <qmessagebox.h> | 14 | /* OPIE */ |
15 | #include <opie2/odebug.h> | ||
16 | using namespace Opie::Core; | ||
14 | 17 | ||
15 | #include "listviewitemconffile.h" | 18 | /* QT */ |
19 | #include <qmessagebox.h> | ||
16 | 20 | ||
17 | ListViewConfDir::ListViewConfDir(QString settingsPath, QWidget *parent, const char *name ) | 21 | ListViewConfDir::ListViewConfDir(QString settingsPath, QWidget *parent, const char *name ) |
18 | : QListView(parent,name), confDir(settingsPath) | 22 | : QListView(parent,name), confDir(settingsPath) |
19 | { | 23 | { |
20 | 24 | ||
21 | setRootIsDecorated( true ); | 25 | setRootIsDecorated( true ); |
22 | addColumn(tr("Files")); | 26 | addColumn(tr("Files")); |
23 | 27 | ||
24 | if (!confDir.isReadable()) | 28 | if (!confDir.isReadable()) |
25 | QMessageBox::critical(this,tr("Could not open"),tr("The directory ")+settingsPath+tr(" could not be opened."),1,0); | 29 | QMessageBox::critical(this,tr("Could not open"),tr("The directory ")+settingsPath+tr(" could not be opened."),1,0); |
26 | readConfFiles(); | 30 | readConfFiles(); |
27 | 31 | ||
28 | connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); | 32 | connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); |
29 | } | 33 | } |
30 | 34 | ||
31 | 35 | ||
32 | ListViewConfDir::~ListViewConfDir() | 36 | ListViewConfDir::~ListViewConfDir() |
33 | { | 37 | { |
34 | } | 38 | } |
35 | 39 | ||
36 | void ListViewConfDir::readConfFiles() | 40 | void ListViewConfDir::readConfFiles() |
37 | { | 41 | { |
38 | 42 | ||
39 | confDir.setFilter( QDir::Files | QDir::NoSymLinks ); | 43 | confDir.setFilter( QDir::Files | QDir::NoSymLinks ); |
40 | confDir.setSorting( QDir::Name ); | 44 | confDir.setSorting( QDir::Name ); |
41 | confDir.setNameFilter("*.conf"); | 45 | confDir.setNameFilter("*.conf"); |
42 | const QFileInfoList *list = confDir.entryInfoList(); | 46 | const QFileInfoList *list = confDir.entryInfoList(); |
43 | QFileInfoListIterator it( *list ); | 47 | QFileInfoListIterator it( *list ); |
44 | QFileInfo *fi; | 48 | QFileInfo *fi; |
45 | 49 | ||
46 | ListViewItemConfFile *fileEntry; | 50 | ListViewItemConfFile *fileEntry; |
47 | 51 | ||
48 | while ( (fi=it.current()) ) | 52 | while ( (fi=it.current()) ) |
49 | { | 53 | { |
50 | qDebug( "opening: >%s<", fi->fileName().data() ); | 54 | odebug << "opening: >" << fi->fileName().data() << "<" << oendl; |
51 | fileEntry = new ListViewItemConfFile( fi, this ); | 55 | fileEntry = new ListViewItemConfFile( fi, this ); |
52 | QListViewItem *dummy = new QListViewItem(fileEntry, "dummy"); | 56 | QListViewItem *dummy = new QListViewItem(fileEntry, "dummy"); |
53 | ++it; | 57 | ++it; |
54 | } | 58 | } |
55 | } | 59 | } |
56 | 60 | ||
57 | void ListViewConfDir::expand(QListViewItem *item) | 61 | void ListViewConfDir::expand(QListViewItem *item) |
58 | { | 62 | { |
59 | ((ListViewItemConf*)item)->expand(); | 63 | ((ListViewItemConf*)item)->expand(); |
60 | } | 64 | } |
61 | 65 | ||